Skip to content

Improvement plan phases 4–5: UX escalation, a11y, responsive layout, store fixes, docs#13

Merged
martinl5 merged 1 commit into
mainfrom
claude/repository-improvement-plan-l0a4p1
Jun 10, 2026
Merged

Improvement plan phases 4–5: UX escalation, a11y, responsive layout, store fixes, docs#13
martinl5 merged 1 commit into
mainfrom
claude/repository-improvement-plan-l0a4p1

Conversation

@martinl5

Copy link
Copy Markdown
Owner

Summary

Completes the remaining items from IMPROVEMENT_PLAN.md (follow-up to #12): the rest of Phase 1/3, Phase 4 UX & accessibility, and Pillar 5 docs.

Level content

  • Level 49 simplified: the variance CTE now uses the AVG(x²) − AVG(x)² identity (the same pattern level 63 teaches) instead of correlated subqueries that re-derived the mean twice.
  • Seed scaffolds normalized: runs of trailing whitespace collapsed to a single cursor-position space; whitespace-only line tails removed.
  • levels.ts split into per-epoch modules under src/data/levels/ (foundational/intermediate/advanced/expert + index) — all imports unchanged via the directory index.

Store fixes (found by the new tests)

Writing the store tests surfaced three real bugs, all fixed:

  1. XP farming — replaying an already-completed level awarded its XP again; XP is now granted once per level (the solve streak still counts every solve).
  2. Past-the-end level — completing level 63 set currentLevel to 64, which has no data; now clamped to MAX_LEVEL.
  3. Broken back navigationgoToPreviousLevel never persisted the popped history, so repeated presses bounced between the last two levels instead of walking back.

UX & accessibility (Phase 4)

  • Escalating disclosure: after 3 failed attempts on a level, a "Harbour Master's Dossier" panel reveals the expected result's shape — row count and column names — never its values. Works even when the user's SQL has syntax errors.
  • Dialog semantics: role="dialog"/aria-modal/labelled headings, initial focus, and Escape-to-close on both the level-up modal and the level navigator drawer; aria-labels on icon-only buttons; aria-pressed on the schema/data tabs; aria-current on the active level tile.
  • Responsive layout: the editor and schema/data panels stack full-width below the lg breakpoint instead of overflowing at fixed widths.

Docs (Pillar 5)

  • MIT LICENSE (per owner's choice).
  • CONTRIBUTING.md with the level-authoring guide: description contract, when to use ORDER BY/orderMatters, seed-scaffold conventions, and the test gates.
  • README links + plan status updated.

Verification

  • npm run lint — clean
  • npm run typecheck — clean
  • npm test278/278 (8 new store tests)
  • npm run build — succeeds

https://claude.ai/code/session_01RQVRtRAigoNCzJc37A5Ses


Generated by Claude Code

…, docs

- Rewrite level 49 variance with AVG(x^2) - AVG(x)^2 identity (no more
  correlated subqueries); normalize seed-scaffold whitespace
- Split levels.ts into per-epoch modules under src/data/levels/
- Fix three store bugs found while writing its tests: XP could be
  farmed by replaying completed levels, completing the final level
  advanced currentLevel past MAX_LEVEL, and goToPreviousLevel never
  consumed history (back button bounced between two levels)
- Escalating disclosure: after 3 failed attempts reveal the expected
  result's shape (columns + row count), never its values
- A11y: dialog roles/aria-modal/focus and Escape handling on the
  level-up modal and level navigator, aria-labels on icon buttons,
  aria-pressed on the schema/data tabs
- Responsive: editor and schema panels stack full-width below lg
- Docs: MIT LICENSE, CONTRIBUTING.md with level-authoring guide,
  README links, plan status update

https://claude.ai/code/session_01RQVRtRAigoNCzJc37A5Ses
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
sqlwak Ready Ready Preview, Comment Jun 10, 2026 9:43am

@martinl5 martinl5 marked this pull request as ready for review June 10, 2026 09:50
@martinl5 martinl5 merged commit a102004 into main Jun 10, 2026
3 checks passed
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