Skip to content

feat(learning): pedagogical validation feedback with pass/fail/error states#64

Merged
OthmaneZ05 merged 2 commits into
mainfrom
feat/learning-validation-feedback
Jul 15, 2026
Merged

feat(learning): pedagogical validation feedback with pass/fail/error states#64
OthmaneZ05 merged 2 commits into
mainfrom
feat/learning-validation-feedback

Conversation

@OthmaneZ05

Copy link
Copy Markdown
Collaborator

Summary of Changes

The roadmap player previously rendered validation results raw ([pass]/[fail] text, validator type slugs, raw error codes). This PR turns them into real pedagogical feedback:

  • Per-validator cards with a ✓/✗/⚠ icon, colored left border, the backend message as primary text, and Expected/Observed values in monospace.
  • Aggregate step banner with three distinct families: green success (with an explicit Next step button, or a "roadmap complete" message on the last step), red pedagogical failure (encouraging tone), and amber infrastructure error — visually and verbally impossible to confuse with a learner mistake, with a Docker-specific wording when the daemon was unreachable.
  • Three-state step-list markers (✓/✗/⚠) via a shared stepOutcome helper: an infra error never shows as a learner failure. Error wins over fail in the aggregate because the step's real state is unknowable when a check couldn't run (documented in validationStatus.ts).
  • Shared status presets (icon/color/label) live once in features/learning/validationStatus.ts; icons carry role="img" + aria-label so status is announced by screen readers.
  • New --color-warning* CSS variables aligned with the existing amber infrastructure-error language (daemon banner, node badge, toast).
  • New i18n keys (en/fr) for the banner copy, CTA, and marker labels.

No backend changes; no changes to useLearningPlayer (revalidation already replaces the whole per-step response, so no stale artifacts by construction).

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

Drove the full flow in a real browser (Playwright + Chrome) against real Docker on the example roadmap:

  1. Pedagogical fail: validated step 1 on an empty project → red banner, ✗ card with message + Expected/Observed, red marker in the step list.
  2. Success + revalidation: created and started the web container, revalidated → green banner + Next step button, no artifacts from the failed attempt; CTA advances to step 2.
  3. Infrastructure error: with the Docker daemon unreachable, validated → amber banner with the Docker-specific "not your fault" wording, ⚠ cards with "Check couldn't run", amber marker; coexists with the global daemon banner. After restoring Docker, revalidated in the same session → clean recovery, no amber leftovers.
  4. Spot-checked all new strings in French.

Frontend suite: 203 tests green (8 new: three result families, aggregation precedence, fully-validated step, revalidation without artifacts, Next step CTA).

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 15, 2026 16:56
@OthmaneZ05 OthmaneZ05 merged commit 8c49468 into main Jul 15, 2026
2 checks passed
@OthmaneZ05 OthmaneZ05 deleted the feat/learning-validation-feedback branch July 15, 2026 17:00
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