Skip to content

feat(learning): progressive step hints with gated solution reveal#65

Merged
OthmaneZ05 merged 1 commit into
mainfrom
feat/learning-progressive-hints
Jul 16, 2026
Merged

feat(learning): progressive step hints with gated solution reveal#65
OthmaneZ05 merged 1 commit into
mainfrom
feat/learning-progressive-hints

Conversation

@OthmaneZ05

Copy link
Copy Markdown
Collaborator

Summary of Changes

The roadmap player now surfaces the hints[] and solution fields that the roadmap format has carried since v1. Between the instruction and the failure message, a learner who is stuck gets a middle rung: progressive hints revealed one at a time, with the full solution as a distinct, gated last step.

  • Progressive reveal, strictly sequential — one button reveals the next hint ("Show hint (2/3)"); there is no way to jump ahead. Revealed hints stay readable for the whole session, including when navigating between steps and back.
  • Solution behind a light brake — after the last hint, the button switches to "Reveal the solution"; the first click arms a confirmation label, the second reveals. The armed state resets when the step changes. The solution card is styled distinctly (amber, key icon) from hint cards (accent, lightbulb).
  • Hints are available without a prior validation attempt — a learner stuck before even trying needs the first nudge most.
  • Steps with no hints and no solution render no hint controls at all.
  • Reveal state lives in useLearningPlayer as revealedHintsByStepId (mirrors resultsByStepId: reset on roadmap open/close, kept across step navigation) — the natural seam for the upcoming local-progression persistence to pick up.
  • The lightweight markdown renderer (renderInstruction + CodeBlock) moved from RoadmapPlayer.tsx to a shared InstructionMarkdown.tsx so hints and solutions render code fences exactly like instructions (mechanical extraction, no behavior change).
  • i18n en/fr for all new labels. No backend changes.

Types of Changes

  • New feature / node type addition
  • Bug fix (non-breaking change resolving an issue)
  • Refactoring / structural cleanup
  • Documentation update

Verification & Testing

Automated Checks

  • Run npm run lint successfully with no errors
  • Run npm run build successfully with no compilation errors
  • Run npm test successfully (all tests pass)

Manual Verification

Frontend suite: 213 tests green (10 new — StepHints.test.tsx covers ordered reveal, no skipping, the two-click solution brake, solution-only and hint-less steps, revisit with persisted state; useLearningPlayer.test.ts covers increment/clamp, per-step persistence across navigation, reset on open/close). Backend suite untouched and green (217).

End-to-end against real Docker (headless Chrome driving the app on the example roadmap): 17/17 checks — revealed hints survive step navigation, the solution brake arms then reveals, the arming resets when leaving the step, a 1-hint step without solution shows no solution button, and the FR locale renders all new labels.

Checklist

  • My code follows the repository's code style and lint standards
  • I have updated the documentation or instructions if necessary
  • All unit and integration tests are passing

@OthmaneZ05
OthmaneZ05 requested a review from Derssa as a code owner July 16, 2026 18:21
@OthmaneZ05
OthmaneZ05 merged commit 3d67921 into main Jul 16, 2026
2 checks passed
@OthmaneZ05
OthmaneZ05 deleted the feat/learning-progressive-hints branch July 16, 2026 19:01
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