Skip to content

refactor: Remove Legacy UI Waffle Flag Consumers — Phase 1a#1

Merged
farhan merged 4 commits into
remove-legacy-waffle-flagsfrom
farhan/remove-legacy-waffle-flags-phase-1a
May 26, 2026
Merged

refactor: Remove Legacy UI Waffle Flag Consumers — Phase 1a#1
farhan merged 4 commits into
remove-legacy-waffle-flagsfrom
farhan/remove-legacy-waffle-flags-phase-1a

Conversation

@farhan

@farhan farhan commented May 21, 2026

Copy link
Copy Markdown
Owner

Closes openedx/public-engineering#522

Summary

Removes all useNewCourseOutlinePage waffle flag checks that were gating legacy Studio UI fallbacks. The new React-based pages are now always used.

Changes

  • ChecklistItemComment.jsxgetPathToCourseOutlinePage always returns /course/${courseId}#${assignmentId}; removed useWaffleFlags and getConfig imports
  • CustomPages.tsx — course outline breadcrumb link always resolves to /course/${courseId}; removed useWaffleFlags import
  • card-item/index.tsxdestinationUrl always uses MFE URL for non-library courses; removed useWaffleFlags import
  • Textbooks.jsxuseTextbooks hook no longer receives waffleFlags; removed useWaffleFlags import
  • textbooks/hooks.jsx — breadcrumb always resolves to /course/${courseId}; removed AppContext and useWaffleFlags usage

Flags removed

useNewCourseOutlinePage

Testing instructions

PR changes have been tested by adding loggers in the changed files and opening the following URLs:

Change URL What to verify
card-item/index.tsx — course card link http://apps.local.openedx.io:2001/authoring/home Click a course card → navigates to /course/<id> (MFE, not legacy Django)
CustomPages.tsx — breadcrumb http://apps.local.openedx.io:2001/authoring/course/course-v1:axim+10+10/custom-pages Click "Content" breadcrumb → stays in MFE
ChecklistItemComment.jsx — assignment links http://apps.local.openedx.io:2001/authoring/course/course-v1:axim+10+10/checklists Assignment deadline links → /course/<id>#<assignmentId>
Textbooks/hooks.jsx — breadcrumb http://apps.local.openedx.io:2001/authoring/course/course-v1:axim+10+10/textbooks Click "Content" breadcrumb → stays in MFE

Browser console logs to verify correct rendering

Open DevTools → Console before visiting each URL. You should see:

Studio Home (/authoring/home)

[CardItem] destinationUrl: always MFE path for courses (useNewCourseOutlinePage removed): /course/course-v1:...

Custom Pages (/custom-pages)
(No explicit log — verify breadcrumb "Content" link resolves to /course/<id> in DevTools → Elements)

Checklists (/checklists)

[ChecklistItemComment] outline link always MFE path (useNewCourseOutlinePage removed): /course/course-v1:...#<assignmentId>

Textbooks (/textbooks)

[Textbooks] breadcrumb always uses MFE path (useNewCourseOutlinePage removed): /course/course-v1:...

Upstream test cases PR

openedx#3067

🤖 Generated with Claude Code

farhan and others added 4 commits May 21, 2026 18:52
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 useWaffleFlags usage from the Textbooks page and simplify useTextbooks(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.

@farhan farhan changed the title refactor: remove useNewCourseOutlinePage flag from textbooks breadcrumb refactor: Remove Legacy UI Waffle Flag Consumers — Phase 1a May 22, 2026

@salman2013 salman2013 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@farhan

farhan commented May 26, 2026

Copy link
Copy Markdown
Owner Author

@salman2013 Thanks for the review, test cases has been verified on this branch via upstream PR

@farhan farhan merged commit 22d72bb into remove-legacy-waffle-flags May 26, 2026
4 checks passed
farhan added a commit that referenced this pull request May 26, 2026
* refactor: remove useNewCourseOutlinePage flag from textbooks breadcrumb

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan farhan deleted the farhan/remove-legacy-waffle-flags-phase-1a branch June 5, 2026 13:12
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.

3 participants