Skip to content

feat(practice): add "Walk me through it" walkthrough on a wrong drill answer (#11) - #32

Merged
tsenoner merged 2 commits into
mainfrom
fix/11-walk-me-through
Jun 23, 2026
Merged

feat(practice): add "Walk me through it" walkthrough on a wrong drill answer (#11)#32
tsenoner merged 2 commits into
mainfrom
fix/11-walk-me-through

Conversation

@tsenoner

Copy link
Copy Markdown
Owner

Closes #11. Roadmap item 7/7 — the finale. 🎉

After a wrong answer, StepTrace shows the right final values but not the arithmetic — so a learner can't tell which step they slipped on. This adds an opt-in "Walk me through it" toggle that reveals the full engine-derived mnemonic walkthrough for the exact date just missed: century anchor → Odd+11 substeps → year's doomsday → month anchor → cast-out-sevens offset → answer.

Changes

  • workedExample.ts — export walkthroughFor(y, m, d) wrapping the existing private datedExample('full', …). Every value derives from explain(), so it's engine-correct for any proleptic date (leap-Feb, BC/exotic centuries, max year).
  • WorkedExample.tsx — extract the step card as the exported WorkedExampleCard; Learn's "Show another" flow is unchanged.
  • components/Walkthrough.tsx — a shared button → card toggle.
  • QuickDrill + GuidedSolve — render <Walkthrough> only on a wrong answer, below StepTrace (additive — the trace still shows). Absent on a correct answer.

Design notes (for review)

  • Wrong-answer only (not always-available-collapsed) — the simplest default that matches StepTrace's defaultOpen={!correct} philosophy. Easy to also offer it on correct answers if you want.
  • Practice-only (Quick Drill + Guided Solve) — the Learn lesson drills include number/boolean steps where a full date walkthrough doesn't apply; wiring it there is a separate effort.
  • Shows the correct path, not a per-step diff against the learner's wrong intermediate (Guided already flags each step ✓/✕ live via PR Guided Solve: flag each intermediate step the moment it's answered #16). True per-step diffing remains a fair follow-up.

Verification

typecheck ✓ · lint --max-warnings 0 ✓ · 301 tests ✓ · build ✓. walkthroughFor is asserted against the engine across normal/leap-Feb/BC/max-year dates; both drills assert the control appears on a wrong answer with the card matching explain() for the missed date, and is absent on a correct answer. Adversarial review of the diff: 0 Critical/Important (1 Minor — an asymmetric test assertion — fixed in this PR).

🤖 Generated with Claude Code

… answer (#11)

After a wrong answer, StepTrace shows the right final values but not the
arithmetic, so a learner can't tell which step they slipped on. Add an opt-in
"Walk me through it" toggle that reveals the full engine-derived mnemonic
walkthrough — century anchor → Odd+11 substeps → year's doomsday → month anchor →
cast-out-sevens offset → answer — for the EXACT date just missed.

- workedExample.ts: export walkthroughFor(y,m,d) wrapping datedExample('full',...);
  every value derives from explain(), so it's engine-correct for any proleptic date
  (incl. leap-Feb and BC/exotic centuries).
- WorkedExample.tsx: extract the step card as the exported WorkedExampleCard
  (Learn's "Show another" flow unchanged).
- components/Walkthrough.tsx: a shared button → card toggle.
- QuickDrill + GuidedSolve: render <Walkthrough> only on a wrong answer, below
  StepTrace (additive — StepTrace still shows). Wrong-only; absent on correct.

Tests: walkthroughFor matches the engine across normal/leap-Feb/BC/max-year dates;
QuickDrill + GuidedSolve assert the control appears on a wrong answer and the card
matches explain() for the missed date, and is absent on a correct answer.
301 tests, typecheck, lint, build all green. Adversarial review: 0 Critical/Important.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
daycipher Ready Ready Preview, Comment Jun 23, 2026 5:52pm

Cleanup from /simplify + /code-review on the "Walk me through it" PR:
- Drop the in-JSX IIFE in Walkthrough; compute the example only when open.
- Extract the shared borderless burgundy link-button style into
  linkButtonStyle (PrimaryButton), reused by Walkthrough and WorkedExample
  instead of two copies of the same inline style object.
- Add resetTestDb to GuidedSolve.test.tsx: GuidedSolve persists attempts via
  useGuided -> recordAttempt, so reset between tests like the other DB suites.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tsenoner
tsenoner merged commit 0104631 into main Jun 23, 2026
3 checks passed
@tsenoner
tsenoner deleted the fix/11-walk-me-through branch June 24, 2026 07:38
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.

Add "Walk me through it" full mnemonic walkthrough on a wrong drill answer

1 participant