refactor: gate CourseBreadcrumbs on the queries - #2072
Draft
brian-smith-tcril wants to merge 1 commit into
Draft
brian-smith-tcril wants to merge 1 commit into
brian-smith-tcril wants to merge 1 commit into
Conversation
CourseBreadcrumbs swaps the slice's courseStatus/sequenceStatus strings for useIsCourseLoaded(courseId) and useSequenceMetadata(sequenceId).isSuccess — both ids were already props. Model reads are untouched. With this, the transitional status bridge's only remaining readers are CoursewareContainer and TabPage. Part of #1976. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
brian-smith-tcril
added this pull request to stack #2062
September 16, 2026 08:20
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## bsmith/course-loaded-sequence-ids #2072 +/- ##
=====================================================================
- Coverage 93.77% 93.77% -0.01%
=====================================================================
Files 367 367
Lines 6039 6038 -1
Branches 1428 1395 -33
=====================================================================
- Hits 5663 5662 -1
- Misses 359 360 +1
+ Partials 17 16 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2 tasks
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.
Summary
Gate
CourseBreadcrumbson the queries instead of the Redux status strings:useIsCourseLoaded(courseId)anduseSequenceMetadata(sequenceId).isSuccessreplace the slice's'loaded' && 'loaded'comparison — both ids were already props. This is layer A4 (of six) of the courseware slice teardown #1976 (plan), stacked on the loaded-gate layer #2071, and deliberately tiny: one consumer whose inputs both exist. Part of #1976 — the teardown's final layer closes it.With this, the transitional status bridge's only remaining readers are
CoursewareContainerandTabPage— exactly the surface of the two teardown layers that follow.What changed
CourseBreadcrumbs.jsx: the twouseSelectorstatus reads become the query gates; theuseMemodeps follow;react-reduxleaves the file. Model reads (useModel/useModels) untouched — read conversions are Dissolve the model-store normalized cache #1977's home.CourseBreadcrumbs.test.jsx: gains theQueryClientProviderthe component now needs and async settles on the loaded-gated assertions. Its pre-existing/preview/coursespathname cases now genuinely exercise the preview-keyed sequence query (useSequenceMetadataderivesisPreviewfrom the pathname, refactor: derive sequence status from the sequence query #2070).Testing
npm run types(0 errors),npm run lint(clean), full jest suite green at head (111 suites, 1131 passed / 3 pre-existing skips). Manual pass on tutor local in the details block below — including a note on a pre-existing jump-nav preview-prefix gap observed while testing (untouched by this stack, not filed per review).Decisions
Full decision log
Decisions — CourseBreadcrumbs onto the query gates (#1976, layer A4)
Pure consumer swap.
CourseBreadcrumbsgates its breadcrumb links onuseIsCourseLoaded(courseId) && useSequenceMetadata(sequenceId).isSuccessinstead of the slice's
'loaded' && 'loaded'strings — both ids werealready props. The
useMemodeps swap the two strings for the twobooleans.
react-reduxleaves the file. Model reads (useModel/useModelsfor the course/sections/sequences) are untouched — Dissolve the model-store normalized cache #1977'shome.
Kept as its own tiny layer rather than folding into A3: the layer
boundary is "one consumer, both inputs already exist", and the diff reads
in one screen.
Tests: the suite gains the
QueryClientProviderthe component nowneeds and async settles (
findAllByTestId/findByText) for theloaded-gated assertions. Its pre-existing
/preview/coursespathnamecases now genuinely exercise the preview-keyed sequence query
(
useSequenceMetadataderivesisPreviewfrom the pathname);initializeTestStore's sequence mock matches either preview param.Behavior deltas: the standard posture (the component's own query
subscriptions; results bridge into the model store as before). Otherwise
faithful: same gate, same render output.
Manual testing
Manual testing — CourseBreadcrumbs onto the query gates (#1976, layer A4)
In-browser verification for layer A4, against tutor local
(
http://apps.local.openedx.io:2000/learning, DemoX). This layer claimszero user-facing change: breadcrumbs gate on the queries instead of the
Redux status strings.
Verify by hand
CourseBreadcrumbsonly renders through theorg.openedx.frontend.learning.course_breadcrumbs.v1slot, which is emptyby default: re-inject the default component via
env.config.jsxper theslot's README first. Then open a unit: the breadcrumb bar shows Course home
plus the section and sequence crumbs once loaded; the section/sequence
dropdowns navigate.
Results
The render check passed (2026-09-16, tutor local, DemoX, default breadcrumbs
re-injected via
env.config.jsx, run against the local branch @05c90e75):crumbs render once loaded and the dropdowns navigate.
A preview-route check was dropped: with jump nav enabled (the staff/preview
context), crumb clicks go through
JumpNavMenuItem.destinationUrl(), whichhas never carried the
/previewprefix — pre-existing onmaster(neitherBreadcrumbItem.tsxnorJumpNavMenuItem.jsxchanges in this stack), so itcan't verify this layer. Not filed, per review.
🤖 Generated with Claude Code