Repository navigation
feat: add localStorage mark-as-understood progress tracker - #24
Merged
Merged
Conversation
Add a lightweight 'mark as understood' tracker for era concepts: - src/lib/progress.ts: SSR-safe localStorage-backed progress store under a single runtimejs:progress key, reusing stable concept ids from js-eras.ts. - Timeline.tsx: small per-concept checkbox toggle (dimmed/struck-through title when done) plus a 'done / total concepts' readout in the sidebar. - tests/progress.test.ts: toggle, persistence, and graceful-degradation coverage with a mocked localStorage. No backend, no accounts, no new dependencies. Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Adds a lightweight, privacy-conscious "mark as understood" tracker to the era/concept content.
localStorage-only: no backend, no accounts, no cross-device sync, no new dependencies.Changes
src/lib/progress.ts(new): small SSR-safe module wrappinglocalStorageunder a singleruntimejs:progresskey. Reuses the stable conceptids fromjs-eras.ts(nothing new invented). ExposesisConceptDone,toggleConcept, andgetProgress(total computed across all eras). EverylocalStorageaccess is guarded (typeof localStorage === "undefined") so server rendering is safe, and it degrades gracefully to "nothing marked" in private browsing or on malformed data.src/components/devtools/Timeline.tsx: per-concept checkbox toggle next to each concept title (small, monospace-consistent with the existing tab/badge UI; done concepts get a subtle checkmark plus dimmed/struck-through title). Adds adone / total conceptsreadout in the Timeline sidebar header. A client-only hook initialises empty for hydration parity and syncs fromlocalStorageon mount.tests/progress.test.ts(new): coverage for toggle round-trips, persistence across reads, independence of distinct concepts, total computation, malformed stored data, and graceful degradation whenlocalStorageis unavailable.Scope
js-eras.ts. No interview pattern library or broader roadmap content is added.Verification
bun run typecheck— cleanbun run lint— 0 errors (8 pre-existing warnings)bun run test— 39 pass / 0 failbun run build— successaria-pressedand the struck-through title update correctly, and the overall count tracks the total (0/21 → 1/21 → 2/21 → 0/21).