Repository navigation
feat(save): save-first E-01 to E-05 let logged-out learners save and sign in later - #65
Merged
Merged
Conversation
…sign in later
- save-first E-01: the selection popup button says "Learn more or Save"
("Learn" when saved, now also for a phrase saved on this browser, whose
translation is reused). The popup help text matches.
- save-first E-02: a logged-out learner gets Save on the word card instead
of "Login to save this phrase" (new LocalSaveSection). The phrase goes
to chrome.storage.local (pendingSaves, one list) with everything
createPhrase needs plus the page URL and title. One copy per phrase.
phrase_saved gets logged_in: false (logged-in saves get true).
- save-first E-03: from the 3rd local phrase, each save shows "Sign in to
keep your N phrases and review them tomorrow" with Sign in (login source
save_prompt) and Not now. At 50 local phrases the card replaces Save.
Events save-signin-card_viewed (count, required), _clicked, _dismissed.
- save-first E-04: after sign-in (login window, popup open, or a page
load with a signed-in user) each local phrase goes to the account with
createPhrase and deviceId, and leaves the list only when the server
accepts it. The bundle comes from getBundleSuggestionForPage for the
saved page, else "Saved phrases". One run at a time (a lock in
chrome.storage.local), stops at the save limit and keeps the rest.
Event pending-saves_synced (sent, failed, left).
- save-first E-05: the toolbar popup shows "N phrases waiting. Sign in to
keep them" to logged-out learners with local phrases.
- The old save-login-prompt_viewed / _clicked events go with the old
button; the sign-in card events replace them.
Work list: subturtle-doc docs/tech/save-first-implementation.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ave" together Design change from Navid: from the first phrase on, a logged-out learner sees both choices on the word card. - "Save without login" saves on this browser (as before) and sends save-without-login_clicked (count). - "Login to save" opens the login window (source save_prompt). The existing save-login-prompt_viewed (once per word, when the choices show) and save-login-prompt_clicked events stay on it. - The soft sign-in card from the 3rd local phrase and the 50-phrase cap (only sign-in offered) are unchanged. Work list: subturtle-doc docs/tech/save-first-implementation.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🎉 This PR is included in version 1.19.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.
Logged-out learners can now save a phrase. It is kept in the extension and sent to their account after they sign in. No server change.
Why: subturtle-doc
docs/tech/save-first-implementation.md(rows save-first E-01 to E-05). In the last 90 days, 246 people looked up a word while logged out and only 16 while logged in, and logged-out people could not save.save-first E-01: "Learn more or Save"
save-first E-02: Save without login
LocalSaveSection.vue): Save without login and Login to save. (Design change from Navid; the first version showed only Save.)save_prompt) and keeps thesave-login-prompt_viewed(once per word) andsave-login-prompt_clickedevents. Save without login sendssave-without-login_clicked(count).chrome.storage.local(pendingSaves, one list). It keeps everythingcreatePhraseneeds (phrase, translation, language, context, direction, language info, linguistic data, chunks, source URL), plus the page title and the time.phrase_savedgetslogged_in: false. Logged-in saves now sendlogged_in: true, so the two can be compared.save-first E-03: ask for sign-in after a few saves
save_prompt).save-signin-card_viewed(count,required),save-signin-card_clicked(count),save-signin-card_dismissed(count).save-first E-04: send local saves after sign-in
pending-saves-sync.ts. It runs:createPhraseanddeviceId. It leaves the list only after the server accepts it.chrome.storage.local(ends by itself after 2 minutes). If two tabs still race, the server already reuses a phrase with the same text, so no duplicates.withAuthRetry, because that falls back to the shared anonymous account.pending-saves_synced(sent,failed,left, andlimit_reachedwhen true).save-first E-05: waiting phrases in the popup
Decisions different from the work list
getBundleSuggestionForPage) needs a signed-in user. So the page URL and title are stored, and the sync asks for the suggestion after sign-in. This also reuses a bundle the user already has for that page. If there is no suggestion, the phrase goes to a bundle called "Saved phrases". Phrases saved from the toolbar popup have no page, so they go there too.How tested
pending-saves,pending-saves-sync,local-save(word card),pending-saves-banner,selection-popup-label, plus login-window sync messages inlogin-analytics.yarn typecheck: clean.yarn test: 40 files, 334 tests pass.yarn build: OK.yarn test:e2e(CI stub settings): 22 of 22 pass.🤖 Generated with Claude Code