Skip to content

Remove Legacy UI Waffle Flags [DEPR]#3069

Open
farhan wants to merge 4 commits into
openedx:masterfrom
farhan:remove-legacy-waffle-flags
Open

Remove Legacy UI Waffle Flags [DEPR]#3069
farhan wants to merge 4 commits into
openedx:masterfrom
farhan:remove-legacy-waffle-flags

Conversation

@farhan

@farhan farhan commented May 26, 2026

Copy link
Copy Markdown

Closes: #3063

Description

See ticket for the detailed implemented in this PR

Followup tickets:

#3090
#3086

Waffle Flags Removed

useNewCourseOutlinePage, useNewCustomPages, useNewExportPage, useNewFilesUploadsPage, useNewHomePage, useNewImportPage, useNewPdfEditor, useNewTextbooksPage, useNewUnitPage, useNewUpdatesPage, useNewVideoUploadsPage

Testing instructions

Phase 1a:

Files cleaner: card-item/index.tsx, CustomPages.tsx, ChecklistItemComment.jsx, Textbooks.jsx, textbooks/hooks.jsx
flags removed: useNewCourseOutlinePage

Test URLs:


Phase 1b:

Files cleaned: Header.tsx, ChecklistItemBody.jsx, Breadcrumbs.tsx, AddComponent.tsx
flags removed: useNewHomePage, useNewCourseOutlinePage, useNewUnitPage, useNewPdfEditor, useNewCertificatesPage removed

Test URLs:


Phase 1c:

Files cleaned: CourseAuthoringContext.tsx, VideoEditorModal.tsx, VideoSettingsModal/index.tsx, header/hooks.tsx, PageSettingButton.jsx
flags removed: useNewUnitPage, useNewCourseOutlinePage, useNewUpdatesPage, useNewFilesUploadsPage, useNewImportPage, useNewExportPage, useNewCertificatesPage, useNewVideoUploadsPage, useNewTextbooksPage, useNewCustomPages removed

Test URLs:

Best Practices Checklist

We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:

  • Any new files are using TypeScript (.ts, .tsx).
  • Avoid propTypes and defaultProps in any new or modified code.
  • Tests should use the helpers in src/testUtils.tsx (specifically initializeMocks)
  • Do not add new fields to the Redux state/store. Use React Context to share state among multiple components.
  • Use React Query to load data from REST APIs. See any apiHooks.ts in this repo for examples.
  • All new i18n messages in messages.ts files have a description for translators to use.
  • Avoid using ../ in import paths. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

Screen shots:

Tested both new and legacy flows for the PDF editor, unit page, and video uploads page waffle flags. Despite flags being set to false in the serializer, the new React-based flows are consistently rendered apparently due to hard codings. These flags required dedicated testing because their values are controlled via waffle flags in edx-platform, and changing them could directly impact which editor or page flow is served to course authors in Studio.

Screenshots attached showing the new UI in the enabled state — safe to remove these flag checks.

screencapture-apps-local-openedx-io-2001-authoring-course-course-v1-axim-6-6-container-block-v1-axim-6-6-type-vertical-block-87df004dcc4c4e02bd1d259ccd1d07ae-block-v1-axim-6-6-type-sequential-block-86cb3f498cfc4f82bc6fc35e0f1b3a17-2026-06-1 ---- screencapture-apps-local-openedx-io-2001-authoring-course-course-v1-axim-6-6-container-block-v1-axim-6-6-type-vertical-block-0518fc2f958540deb005d86aad4e8cbe-block-v1-axim-6-6-type-sequential-block-86cb3f498cfc4f82bc6fc35e0f1b3a17-2026-06-1 ---- screencapture-apps-local-openedx-io-2001-authoring-course-course-v1-axim-6-6-container-block-v1-axim-6-6-type-vertical-block-4103ef24a4bd486293001bfa04effc3c-block-v1-axim-6-6-type-sequential-block-86cb3f498cfc4f82bc6fc35e0f1b3a17-2026-06-1

@farhan farhan self-assigned this May 26, 2026
@farhan farhan changed the title refactor: Remove Legacy UI Waffle Flag Consumers — Phase 1a (#1) Remove Legacy UI Waffle Flags [DEPR] May 26, 2026
@farhan farhan force-pushed the remove-legacy-waffle-flags branch from 4c64b12 to 22d72bb Compare May 26, 2026 15:01
@codecov

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.63%. Comparing base (b0efcd6) to head (3a28254).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3069      +/-   ##
==========================================
+ Coverage   95.62%   95.63%   +0.01%     
==========================================
  Files        1392     1392              
  Lines       33131    33072      -59     
  Branches     7707     7691      -16     
==========================================
- Hits        31681    31630      -51     
+ Misses       1385     1379       -6     
+ Partials       65       63       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@farhan farhan force-pushed the remove-legacy-waffle-flags branch 3 times, most recently from 7244e03 to 16407a2 Compare May 26, 2026 17:29
@farhan farhan force-pushed the remove-legacy-waffle-flags branch 2 times, most recently from cd34b30 to 64e2fa1 Compare June 5, 2026 14:02
@farhan farhan closed this Jun 5, 2026
@farhan farhan reopened this Jun 5, 2026
@farhan farhan closed this Jun 6, 2026
@farhan farhan reopened this Jun 6, 2026
@farhan farhan closed this Jun 7, 2026
@farhan farhan reopened this Jun 7, 2026
@farhan farhan force-pushed the remove-legacy-waffle-flags branch 4 times, most recently from c630456 to 31907fb Compare June 8, 2026 09:13
@farhan farhan requested a review from Copilot June 8, 2026 10:52

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

Note

Copilot was unable to run its full agentic suite in this review.

This PR removes multiple waffle-flag / config gated “legacy vs MFE” code paths and standardizes navigation to always use the MFE routes (e.g., /course/:courseId/...), while also cleaning up related flags, config, and tests.

Changes:

  • Removed usage of several waffle flags and config toggles across navigation, breadcrumbs, and unit-page components, defaulting behavior to MFE routes/UI.
  • Deleted legacy unit-page/new-design branching logic and related helpers/config.
  • Updated tests and mocks to reflect the removal of the deprecated flags and legacy fallbacks.

Reviewed changes

Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/textbooks/hooks.tsx Always links breadcrumbs to MFE course routes; removes waffle/config branching.
src/textbooks/Textbooks.tsx Adjusts ConnectionErrorAlert import path.
src/studio-home/card-item/index.tsx Removes waffle-flag gating for destination URL selection.
src/plugin-slots/CourseAuthoringUnitSidebarSlot/index.tsx Removes conditional sidebar class logic; always applies sidebar.
src/pages-and-resources/pages/PageSettingButton.jsx Removes waffle-flag based legacy/new link logic; always uses MFE route for supported legacy links.
src/pages-and-resources/pages/PageSettingButton.test.jsx Removes legacy/flag-branch test cases; updates expectations.
src/pages-and-resources/pages/PageCard.test.jsx Adjusts waffle flags API mock response.
src/index.jsx Removes unit-page related config keys.
src/header/hooks.tsx Always uses MFE URLs for content/tools menu items; removes several waffle-flag branches.
src/header/hooks.test.tsx Updates tests to match always-MFE URL behavior; removes flag-specific setup.
src/header/Header.tsx Removes waffle-flag dependency; always uses MFE outline link and sets isNewHomePage true.
src/editors/containers/VideoEditor/components/VideoSettingsModal/index.tsx Removes useNewVideoUploadsPage prop and gating; always renders back button when not library.
src/editors/containers/VideoEditor/components/VideoSettingsModal/index.test.tsx Updates test to reflect removal of useNewVideoUploadsPage.
src/editors/containers/VideoEditor/components/VideoEditorModal.tsx Removes waffle-flag plumbing to VideoSettingsModal.
src/data/apiHooks.test.tsx Updates waffle-flag test to assert useReactMarkdownEditor instead of removed flags.
src/data/apiHooks.mock.ts Updates documentation comment for mock usage examples.
src/data/api.ts Removes deprecated waffle-flag defaults.
src/custom-pages/CustomPages.tsx Removes waffle-flag gated breadcrumb link; always uses MFE route.
src/custom-pages/CustomPages.test.tsx Adjusts waffle flags API mock response.
src/course-unit/xblock-container-iframe/index.tsx Removes legacy manage-tags modal path; always uses new flow (sidebar + iframe message).
src/course-unit/utils.ts Removes isUnitPageNewDesignEnabled helper and related config import.
src/course-unit/unit-sidebar/unit-info/UnitVisibilityInfo.tsx Removes legacy visibility UI and prop; always renders new visibility content.
src/course-unit/unit-sidebar/unit-info/PublishControls.tsx Stops passing legacy-only openVisibleModal prop.
src/course-unit/unit-sidebar/UnitSidebar.tsx Removes legacy sidebar branching; always uses new sidebar.
src/course-unit/header-title/HeaderTitle.tsx Removes legacy settings/configure modal UI; keeps inline title editing.
src/course-unit/header-title/HeaderTitle.test.tsx Removes config setup tied to unit-page-new-design flag.
src/course-unit/header-navigations/HeaderNavigations.tsx Removes new-design feature gate; always shows new-design buttons/behavior.
src/course-unit/header-navigations/HeaderNavigations.test.tsx Removes config setup tied to unit-page-new-design flag.
src/course-unit/breadcrumbs/Breadcrumbs.tsx Removes waffle/config-based URL adaptation; always uses MFE URLs.
src/course-unit/breadcrumbs/Breadcrumbs.test.tsx Removes legacy-fallback test and updates waffle mock response.
src/course-unit/add-component/AddComponent.tsx Removes useNewPdfEditor gating; always treats PDF creation as new flow.
src/course-unit/add-component/AddComponent.test.tsx Removes test validating legacy PDF-editor path.
src/course-unit/CourseUnit.tsx Removes unit-page-new-design gating for StatusBar; always renders for vertical units.
src/course-unit/CourseUnit.test.tsx Removes config toggles for unit-page-new-design across test cases.
src/course-checklist/ChecklistSection/ChecklistSection.test.jsx Adjusts waffle flags API mock response.
src/course-checklist/ChecklistSection/ChecklistItemComment.jsx Removes waffle/config gating; always links to MFE outline anchor.
src/course-checklist/ChecklistSection/ChecklistItemBody.jsx Simplifies update links; always uses MFE outline URL and removes waffle dependency.
src/CourseAuthoringContext.tsx Removes legacy unit-page URL branching and full-page navigation; always uses SPA navigation to MFE unit route.
plugins/course-apps/proctoring/Settings.test.jsx Updates expected network call count after removing waffle flag fetch.
.env.development Removes deprecated env flags for unit page / new video upload page.
.env Removes deprecated env flags for unit page / unit page new design.
Comments suppressed due to low confidence (3)

src/textbooks/Textbooks.tsx:1

  • This switches from the project’s @src/... import alias style to a relative import. To keep imports consistent (and avoid brittleness when files move), prefer using the existing alias import (e.g., @src/generic/ConnectionErrorAlert) unless there’s a specific reason the alias cannot be used here.
    src/pages-and-resources/pages/PageSettingButton.jsx:1
  • The identifier determineLinkDestination reads like a function, but it’s a memoized value (string/null). Renaming it to something like linkDestination / destinationHref would better match its actual type and reduce confusion for future readers.
    src/header/Header.tsx:1
  • Passing isNewHomePage with no value hard-codes it to true. If the legacy home page behavior is fully removed, consider deleting the prop entirely from the downstream component API (and any related branching) to reduce dead/obsolete configuration surface area. If legacy behavior is still needed in some contexts, this should remain conditional rather than always-on.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/course-apps/proctoring/Settings.test.jsx
@farhan farhan force-pushed the remove-legacy-waffle-flags branch from 23d3018 to 65f4d7a Compare June 8, 2026 12:03
@farhan farhan marked this pull request as ready for review June 9, 2026 05:56
@farhan farhan requested a review from bradenmacdonald June 9, 2026 05:59
farhan and others added 4 commits June 13, 2026 15:17
Removes all conditional routing based on deprecated waffle flags
(useNewCourseOutlinePage, useNewUnitPage, useNewFilesUploadsPage,
useNewTextbooksPage, useNewCustomPages, useNewVideoUploadsPage,
useNewImportPage, useNewExportPage, useNewUpdatesPage, useNewHomePage,
useNewPdfEditor). MFE paths are now always used.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes the 11 flags that were cleaned from all consumers in Phase 1:
useNewHomePage, useNewCourseOutlinePage, useNewUnitPage, useNewUpdatesPage,
useNewFilesUploadsPage, useNewVideoUploadsPage, useNewTextbooksPage,
useNewCustomPages, useNewImportPage, useNewExportPage, useNewPdfEditor.

WaffleFlagName type is auto-updated via keyof typeof waffleFlagDefaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updates apiHooks.test.tsx to use useReactMarkdownEditor as the example
flag (still present, default true). Removes useNewCourseOutlinePage and
useNewVideoUploadsPage from all test mocks and HTTP response fixtures.

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

Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.

}
return `${getConfig().STUDIO_BASE_URL}/container/${locator}`;
};
const getUnitUrl = (locator: string) => `/course/${courseId}/container/${locator}`;
} else {
window.location.assign(url);
}
navigate(getUnitUrl(locator));
Comment thread src/header/Header.tsx
searchButtonAction={meiliSearchEnabled ? openSearchModal : undefined}
containerProps={containerProps}
isNewHomePage={waffleFlags.useNewHomePage}
isNewHomePage
Comment thread src/header/hooks.tsx
...(getConfig().ENABLE_TAGGING_TAXONOMY_PAGES === 'true'
? [{
href: `${studioBaseUrl}/course/${courseId}#export-tags`,
href: `${getConfig().STUDIO_BASE_URL}/course/${courseId}#export-tags`,
Comment on lines +25 to +29
const determineLinkDestination = useMemo(() => (
legacyLink?.includes('textbooks') || legacyLink?.includes('tabs')
? `/course/${courseId}/${id.replace('_', '-')}`
: null
), [legacyLink, courseId, id]);
@farhan farhan force-pushed the remove-legacy-waffle-flags branch from ae90a5d to 3a28254 Compare June 13, 2026 15:26
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.

[Part 1] Remove usage of 12 - legacy waffle flags

2 participants