Repository navigation
Conversation
…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>
This was referenced Oct 16, 2026
Closed
Collaborator
Author
|
Replaced by #62, which combines all extension rows (E-01 to E-06) into one PR. |
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.
What
deviceId. This is the install's analytics id (analyticsAnonymousIdinchrome.storage.local). It goes withtranslateWithContext(simple and detailed),translationAdviceandcreatePhrase. These are the calls where the server fires an analytics event or uses credits.userIdis still sent, for old servers.trigger:caption: whole-caption translation (Netflix and the support template)word: a hovered caption word (marker store and the template)selection: the Nibble selection popupdetail: the word detail paneldefinitionis in the type for the server contract. No caller uses it today, becauseDefinition.vueno longer exists.src/common/helper/install-id.ts. It reads the id from storage, or creates it with the same key and format assrc/plugins/mixpanel.ts.mixpanel.tsnow imports the key and the id maker from it.Why
Server events could not be joined to the extension's analytics id. Logged-out users all shared one anonymous account id. The server also could not tell what asked for a translation. Work list: subturtle-doc
docs/tech/analytics-fixes-implementation.md(rows E-01, E-05).The id is loaded from storage asynchronously. So each call waits for the stored id instead of sending an empty value. It reads the id on every call, so after logout (which makes a new id) the next call sends the new one. Two calls at the same time on the very first page share one read, so they do not create two different ids.
How tested
tests/translate-analytics-args.test.ts(deviceId and trigger for every call, id created when missing, no empty id).yarn typecheck: clean.yarn test: 41 files, 368 tests pass.yarn build: OK.Dependencies
🤖 Generated with Claude Code