Repository navigation
fix(analytics): E-01 to E-06 to main (cherry-picked, without the rest of dev) - #64
Merged
Merged
Conversation
… page - chrome.runtime.onInstalled now tracks extension_installed (reason install) or extension_updated (with previous_version) on the install's analytics id. The id is created when missing, with the same key and format as plugins/mixpanel.ts (new helper common/helper/install-id.ts). - The service worker has no window or document, so mixpanel-browser is not loaded there. The events go to Mixpanel's /track endpoint with fetch, through MIXPANEL_API_HOST, in the same shape mixpanel-browser sends. A failed request never throws. - On install it opens https://subturtle.app/?install_id=<id>&utm_source=extension&utm_medium=install for the landing page (D-01). Unpacked builds (local dev, CI e2e) skip the tab, so they do not open the site or count fake installs. - Tests: tests/install-tracking.test.ts. Work list: subturtle-doc docs/tech/analytics-fixes-implementation.md Pairs with landing D-01 (codebridger/subturtle-dashboard-app#144). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit b7ddfd6)
…te each caption once - E-04: TranslateService keeps a map of requests in flight by cache key. An identical call made before the first one answers waits for it and gets the same answer, so only one request goes out. The entry is removed when the request settles; a failure reaches every waiting caller and is never cached. - E-06: new src/subtitle/helpers/caption-translation-gate.ts. With "translate whole caption" on, the Netflix and support-template caption components wait about 150 ms for the caption to settle, then send it only when the joined text differs from the caption already translated on screen. A failed caption can be sent again. Turning the option on still translates at once. - Tests: in-flight cases in tests/translate.service.test.ts, new tests/caption-translation-gate.test.ts. Work list: subturtle-doc docs/tech/analytics-fixes-implementation.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 7c0a3b2)
- Word card: save-login-prompt_viewed fires once per word view when "Login to save this phrase" shows (a new word or a new view resets it). Clicking it sends save-login-prompt_clicked. - OpenLoginWindowMessage carries a source (save_prompt, practice, popup). The background puts it on the login window URL (popup.html#/login?source=...), and LoginView reads it. No source means the toolbar popup. - user_logged-in gains source. New login_failed with source and reason: window_closed (Google consent window closed), google_error (no Google token), server_error (our server failed or sent no token, or the password login was rejected). - The Google flow no longer stores an empty token when the server reply has none; it counts as a failed login. - practice-now_login-clicked is kept. - Tests: tests/save-login-prompt.test.ts, tests/login-analytics.test.ts. Work list: subturtle-doc docs/tech/analytics-fixes-implementation.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit efec688)
…E-01 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 3658d71)
…ation calls - New helper src/common/helper/install-id.ts reads the install's analytics id (analyticsAnonymousId in chrome.storage.local), or creates it with the same key and format as plugins/mixpanel.ts. It waits for storage, so a call never sends an empty id, and it reads on each call, so it follows the new id after logout. - translateWithContext (simple and detailed), translationAdvice and createPhrase now send deviceId. userId stays for old servers. - Each translation caller sends trigger: caption (both caption components), word (marker store, hovered caption word), selection (selection popup), detail (word detail). "definition" is in the type for the server contract; no caller uses it today (Definition.vue is gone). - Tests: tests/translate-analytics-args.test.ts. Work list: subturtle-doc docs/tech/analytics-fixes-implementation.md Pairs with server B-01 / B-03. The server ignores unknown args today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 1466a8f)
|
🎉 This PR is included in version 1.18.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings only the analytics fixes from #62 to
main. The rest ofdev(multilingual work) is not ready for production, so these five commits are cherry-picked (-x) ontomain.What is in it
deviceId) and thetriggergo with translation calls;deviceIdalso goes withcreatePhrase.extension_installed/extension_updated, and the welcome page on first install.user_logged-insource,login_failed.Conflicts resolved (dev-only code left out)
translate.service.ts: keptmain's language code; took only the install-id import, theTranslationTriggertype anddeviceId. The multilingual imports andtranslationLanguageArg()stay ondev.SaveWordSectionV2.vue: keptmain'screatePhraseargs and added onlydeviceId.CLAUDE.mdtest map: kept only the E-02 / E-03 test lines.How tested
yarn typecheck: clean (with the sibling dashboard-app checked out, as in CI).yarn test: 36 files, 298 tests pass.yarn build: passes.After merge
The
mainrelease builds a zip; the Chrome Web Store upload is still manual. The latermain→devback-merge meets the same changes already ondev; keep thedevside in the three files above.Work list: subturtle-docs
docs/tech/analytics-fixes-implementation.md.🤖 Generated with Claude Code