Skip to content

feat: add localStorage mark-as-understood progress tracker - #24

Merged
hoce1n merged 1 commit into
mainfrom
260810-feat-progress-tracker
Aug 10, 2026
Merged

hoce1n merged 1 commit into
mainfrom
260810-feat-progress-tracker

Conversation

@monkeycode-global

Copy link
Copy Markdown
Contributor

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 wrapping localStorage under a single runtimejs:progress key. Reuses the stable concept ids from js-eras.ts (nothing new invented). Exposes isConceptDone, toggleConcept, and getProgress (total computed across all eras). Every localStorage access 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 a done / total concepts readout in the Timeline sidebar header. A client-only hook initialises empty for hydration parity and syncs from localStorage on 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 when localStorage is unavailable.

Scope

  • Only tracks the era/concept content already present in js-eras.ts. No interview pattern library or broader roadmap content is added.

Verification

  • bun run typecheck — clean
  • bun run lint — 0 errors (8 pre-existing warnings)
  • bun run test — 39 pass / 0 fail
  • bun run build — success
  • Manually verified in a headless browser: toggling persists across a full page reload, aria-pressed and the struck-through title update correctly, and the overall count tracks the total (0/21 → 1/21 → 2/21 → 0/21).

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>
@vercel

vercel Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
runtimejs Ready Ready Preview Aug 10, 2026 11:35am

@hoce1n
hoce1n merged commit 83d57f0 into main Aug 10, 2026
3 checks passed
@hoce1n
hoce1n deleted the 260810-feat-progress-tracker branch August 10, 2026 11:35

This branch was successfully deployed

1 active deployment
Preview — 557edc76 Deployed Aug 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants