refactor: Remove Legacy UI Waffle Flag Consumers — Phase 1a#1
Conversation
The flag always resolves to the MFE route; hardcode to /course/${courseId}
and drop waffleFlags from the useTextbooks signature and its caller.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…crumb
Hardcode breadcrumb to /course/${courseId} and drop the useWaffleFlags
call and import, as the flag is no longer needed in this component.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Courses always use the MFE destination URL now; drop the waffle flag guard and its call/import from the card-item component. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Hardcode outline link to MFE path and drop the waffle flag guard, useWaffleFlags call, and getConfig import from ChecklistItemComment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR removes reliance on the useNewCourseOutlinePage waffle flag for “course outline” navigation in a few UI entry points, and standardizes those links to always route within this MFE via /course/${courseId}. It also simplifies the textbooks hook API by dropping waffleFlags from useTextbooks.
Changes:
- Remove
useWaffleFlagsusage from the Textbooks page and simplifyuseTextbooks(courseId)signature. - Hardcode “Content” / course outline breadcrumb destinations to
/course/${courseId}in Textbooks and Custom Pages. - Remove waffle-flag-based URL selection from Studio Home course cards and Checklist assignment links, defaulting to MFE routes.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/textbooks/Textbooks.jsx | Drops waffle flag fetching and calls useTextbooks(courseId) directly. |
| src/textbooks/hooks.jsx | Removes waffleFlags + AppContext dependency; hardcodes breadcrumbs to /course/${courseId} routes. |
| src/studio-home/card-item/index.tsx | Removes waffle flag logic from course destination URL selection (keeps legacy base URL behavior for libraries). |
| src/custom-pages/CustomPages.tsx | Removes waffle flag usage; hardcodes breadcrumb “Content” link to /course/${courseId}. |
| src/course-checklist/ChecklistSection/ChecklistItemComment.jsx | Removes waffle flag + legacy Studio URL fallback; links assignments to /course/${courseId}#${assignmentId}. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
salman2013
left a comment
There was a problem hiding this comment.
LGTM, the testing steps mentioned in the description look fine to me, Tests are not runing in this PR, and i believe the tests would fix in the feature branch after merging all phase PRs.
|
@salman2013 Thanks for the review, test cases has been verified on this branch via upstream PR |
* refactor: remove useNewCourseOutlinePage flag from textbooks breadcrumb Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes openedx/public-engineering#522
Summary
Removes all
useNewCourseOutlinePagewaffle flag checks that were gating legacy Studio UI fallbacks. The new React-based pages are now always used.Changes
ChecklistItemComment.jsx—getPathToCourseOutlinePagealways returns/course/${courseId}#${assignmentId}; removeduseWaffleFlagsandgetConfigimportsCustomPages.tsx— course outline breadcrumb link always resolves to/course/${courseId}; removeduseWaffleFlagsimportcard-item/index.tsx—destinationUrlalways uses MFE URL for non-library courses; removeduseWaffleFlagsimportTextbooks.jsx—useTextbookshook no longer receiveswaffleFlags; removeduseWaffleFlagsimporttextbooks/hooks.jsx— breadcrumb always resolves to/course/${courseId}; removedAppContextanduseWaffleFlagsusageFlags removed
useNewCourseOutlinePageTesting instructions
PR changes have been tested by adding loggers in the changed files and opening the following URLs:
card-item/index.tsx— course card link/course/<id>(MFE, not legacy Django)CustomPages.tsx— breadcrumbChecklistItemComment.jsx— assignment links/course/<id>#<assignmentId>Textbooks/hooks.jsx— breadcrumbBrowser console logs to verify correct rendering
Open DevTools → Console before visiting each URL. You should see:
Studio Home (
/authoring/home)Custom Pages (
/custom-pages)(No explicit log — verify breadcrumb "Content" link resolves to
/course/<id>in DevTools → Elements)Checklists (
/checklists)Textbooks (
/textbooks)Upstream test cases PR
openedx#3067
🤖 Generated with Claude Code