Fix saved concepts not appearing on Profile (#90) - #96
Merged
Conversation
The saved list only had bare slugs, so the app could not name a saved concept
without the bundled demo catalog. Add a 'saved' field carrying {slug,title,topic}
alongside the existing 'bookmarks' slugs (kept for membership/count and for
already-installed apps that don't read the new field).
Signed-in bookmarks were resolved against the bundled 20-concept catalog, so server-catalog saves never showed. Render from savedConcepts when present, fall back to the bundled catalog for the signed-out demo. Broaden CategoryChip to accept any label string (topic names match the Category values).
toggleBookmark reloads /me/state to refresh the saved list, but a failed reload threw after the save had already persisted, so ProgressContext rolled the UI back to un-saved. Catch the reload failure and patch in place instead, so a succeeded toggle is never reverted; the saved list catches up on the next load.
This was referenced Sep 5, 2026
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.
Closes #90.
Root cause
The Profile "Saved concepts" list mapped
progress.bookmarks(server conceptslugs) through the bundled 20-concept demo catalog (
CONCEPTS_BY_ID). Forsigned-in users on the 125+ server catalog, those slugs aren't in the bundle, so
every saved lesson resolved to nothing and the list stayed empty. (Same class as
the Stats bug #35.)
/me/statealso only returned bare slugs, so the app had notitle/topic to render anyway.
Fix
Backend —
/v1/me/statenow returns asavedarray of{concept_slug, title, topic_name}(likelearnedalready does), additive: the existingbookmarksslug list is unchanged, so already-installed apps keep working andthe backend can deploy independently.
Mobile —
ProgressState.savedConceptscarries the server details; the Profile rendersthe saved list from it, falling back to the bundled catalog only for the
signed-out demo.
/me/state(the toggle endpoint returnsno body) so the list reflects the change; the optimistic bookmark flip still
updates the card + count instantly.
CategoryChipnow accepts any label string (topic names match the Categoryvalues).
Verification
back with title + topic.
npx tsc --noEmitclean.Note
Backend and mobile ship together for the full fix, but they're decoupled: the
backend change is safe to deploy before the app update (old apps ignore the new
field), and the app update degrades gracefully if it sees no
savedfield.