feat(lab2): course route with level navigation + MSW fixtures [2/4]#73488
Draft
stephenliang wants to merge 11 commits into
Draft
feat(lab2): course route with level navigation + MSW fixtures [2/4]#73488stephenliang wants to merge 11 commits into
stephenliang wants to merge 11 commits into
Conversation
8f5fa79 to
cf4bfa1
Compare
489b6dc to
e6660cc
Compare
cf4bfa1 to
e2fe438
Compare
e6660cc to
f8a31ad
Compare
e2fe438 to
c53f1be
Compare
Spec-driven change for the Lab2 host/loader role in frontend/apps/studio, with AI for Oceans as the first course: proposal, design (decisions, data flow, test strategy), four capability specs (lab-base, course-level-routes, milestone-reporting, oceans-course), and TDD task list. Committed for PR review only: openspec/ is normally untracked via .git/info/exclude; files are force-added and the PR will be discarded after review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
c53f1be to
fe03c1f
Compare
f8a31ad to
51feef7
Compare
Scaffold the labs/base package (@code-dot-org/lab) from wilkie's music-lab prototype (frontend/packages/labs/music), adapted to prop-driven levelId + map (no redux, no theme provider). Includes Lab shell with ErrorBoundary, Loading, metrics reporter, and LevelPropertiesContext. Wire into the existing oceans project route as an integration proof. Add cross-package lint rule preventing oceans from importing @code-dot-org/lab directly. Lab2-studio-oceans tasks §1-2 (1.1–2.2). Co-authored-by: wilkie <david.wilkinson@code.org> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ack, metrics attributes, dead code Key fixes: - Key ErrorBoundary on levelId so error state resets on level change - Use static ERROR_MESSAGE constant for fallback to avoid stale-state capture - Conditionally render alert region only when errorMessage is non-empty - Fix defaultOnError signature to accept componentStack - Remove dead isLoading prop from Loading - Remove duplicate useMaybeLevelProperties (identical to useLevelProperties) - Include all 4 metric dimensions in getCommonAttributes - Remove redundant object spreads in metric methods - Add tests for conditional alert and error recovery Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lert"
The separate errorMessage state and live-region div persisted a stale
alert after the ErrorBoundary recovered via key={levelId} remount.
Consolidate to a single <p role="alert"> as the ErrorBoundary fallback —
it unmounts with the boundary on recovery, eliminating the false
announcement. Also removes redundant aria-live/aria-atomic (implicit
on role="alert") and replaces getByTestId with getByText in recovery
test.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reverts accidental removal of comments that explain non-obvious behavior: createFileRoute auto-wiring, lazy-load code-splitting, MSW fixture registration coupling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds lint-config/eslint/lab.mjs extending react.mjs with a no-restricted-imports rule preventing embeddable labs from depending on the framework package. Updates oceans, music, ailab, and the lab codegen template to use it. Verified via turbo gen lab smoke test. Also removes openspec change files from this PR (they belong in the proposal branch). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ntent Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a824702 to
5f9b09b
Compare
Add the /courses/:name/units/:u/lessons/:l/levels/:p route with: - Permissive Zod schemas for script_structure and level_properties endpoints (passthrough for unknown serializer fields) - Query key factory excluding levelPosition for in-lesson cache reuse - Position→activeId→levelId join (resolveCourseLevel) - AppName-keyed lab entrypoint resolver (fish→oceans, standalone_video→stub) - Level navigation with prev/next links, live-region position indicator - MSW fixtures captured from production for all 8 oceans levels - Signed-out auth stub in enableMocks for standalone MSW mode - A11y: aria-live position announcements, label-in-name buttons, correct heading hierarchy on fallback states Lab2-studio-oceans tasks §3 (3.1–3.9). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
51feef7 to
fd5b25d
Compare
d4629d0 to
3a12612
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
/courses/:name/units/:u/lessons/:l/levels/:proute with permissive Zod schemas forscript_structureandlevel_propertiesendpoints. Query-key cache reuse across in-lesson navigation. Position→activeId→levelId join (resolveCourseLevel), appName-keyed lab entrypoint resolver (fish→oceans,standalone_video→stub). Level navigation with prev/next links and live-region position indicator.Lab2-studio-oceans tasks §3 (3.1–3.9). No Rails changes.
Stack: [1/4] #73487 → [2/4] ← this PR → [3/4] #73490 → [4/4] #73496
Links
openspec/changes/lab2-studio-oceans/design.md(on proposal branch)Testing story
resolveCourseLevel,getLabEntrypointByAppName,LevelNavigationyarn typecheck+./tools/hooks/pre-commitpassDeployment notes
Standard merge-and-deploy. New route only activates when navigated to directly — no existing routes affected.
🤖 Generated with Claude Code