Repository navigation
feat(ui): add the Classic/AI interface switcher to the classic sidebar footer - #38861
Conversation
…r footer Classic mode now shows the shared AppModeSwitcher at the bottom of the left sidebar (bordered card when expanded, icon button when collapsed, both framed by core Card), matching AI mode. The User Interface section is removed from the profile dropdown along with InterfaceModeMenuItem and its i18n key. Refs open-metadata/openmetadata-collate#8999
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
ShaileshParmar11
left a comment
There was a problem hiding this comment.
Reviewed at 60bec24. The OpenMetadata side works: the switcher card and icon in the classic sidebar, removing the profile-dropdown section, and the variant refactor. One blocking issue: this change breaks Collate's Playwright AI-mode specs, and there is no companion Collate PR yet. See the inline comment on appMode.ts.
Checked, no issue
- The deleted
InterfaceModeMenuItemwas shown to everyone, with no feature or permission check, so moving the switch into the sidebar hides it from no one. - Nothing in OpenMetadata or Collate still uses
InterfaceModeMenuItem, thecompactprop orlabel.user-interface. Collate does not overridegetUserProfileExtraItems, so the newextraItems.lengthcheck is safe. - The core
Popoverpassesaria-labelon to its innerDialog, so the new "Switch interface" name is announced. - The core
Cardadds no padding of its own (only its header, content and footer parts do), so the 56px icon frame fits the collapsed rail. - The new tokens are valid:
tw:bg-brand-solidreplaces the rawtw:bg-blue-600, andtw:hover:bg-primary_hoverexists.
Outside the diff (cannot be commented inline)
- 🟡
AIUserMenu.test.tsx:437-446("does not offer an interface-mode switch") only checks thatinterface-mode-option-classicandinterface-mode-option-aiare absent. This PR deletes the only component that rendered them, so the test can no longer fail. Please delete it.
Checks
Validate PR Metadatafails because the description links the issue withRefs. It needsFixes open-metadata/openmetadata-collate#8999.Compatibility checksfails atcd ai-platform && mvn -B clean install -DskipTests. That step buildsai-platform, not this UI change; a re-run should clear it.- The description says "nothing changes on the Collate side". That is not the case; see the
appMode.tscomment.
…-items mock per test
Code Review ✅ Approved 🟡 Medium riskMoving interface switching from the profile menu to the sidebar changes how users reach mode selection, potentially disrupting established navigation. Unifies the Classic and AI interface switchers by adding a Classic mode card to the expanded sidebar footer, an icon button for the collapsed rail, and removing the User Interface section from the profile dropdown. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
Thanks for the review, ShaileshParmar11. All three inline comments are addressed and resolved. On the points outside the diff:
|
…r footer (#38861) (#38953) * feat(ui): add the Classic/AI interface switcher to the classic sidebar footer Classic mode now shows the shared AppModeSwitcher at the bottom of the left sidebar (bordered card when expanded, icon button when collapsed, both framed by core Card), matching AI mode. The User Interface section is removed from the profile dropdown along with InterfaceModeMenuItem and its i18n key. Refs open-metadata/openmetadata-collate#8999 * test(ui): drop assertions that can no longer fail and reset the extra-items mock per test (cherry picked from commit e2a8db3)
Describe your changes:
Fixes open-metadata/openmetadata-collate#8999
Companion Collate PR: open-metadata/openmetadata-collate#9004 updates Collate's own AI-mode Playwright helper, which clicked the removed
interface-mode-option-aitest id. Merge it before Collate's OpenMetadata submodule moves past this PR.Classic mode had no visible way to switch interface: the Classic/AI switch was a User Interface section buried in the navbar profile dropdown, while AI mode already has the shared
AppModeSwitcherin its sidebar footer. This PR unifies both modes on the same switcher, per the Unified Interface Switcher design:InterfaceModeMenuItem, its test, and the now-unusedlabel.user-interfacekey in all 21 locales.Type of change:
High-level design:
AppModeSwitchertakes avariantprop (inline|pill|card|icon) in place of the oldcompactboolean.inlineandpillare the two AI-mode looks that already existed (pillis the AI collapsed rail, now passed explicitly byUserProfileCard).cardandiconare new and used only by the classicLeftSidebar.cardandiconvariants are framed by coreCard, the same structure the AI sidebar'sUserProfileCarduses for this switcher, so there is no hand-rolled border, background or shadow. The trigger inside keeps layout classes only, and the icon-only trigger has an accessible name.AppModeSwitcher.constants.ts/AppModeSwitcher.types.ts.Switch interface), and its checked checkbox usestw:bg-brand-solidinstead of the rawtw:bg-blue-600.UserProfileIconrenders the extra-items strip (Collate adds items there) only when there are items, usingDivider+Boxinstead of a bordereddiv.AskCollateUtils.switchToAiModeViaProfileToggle), which clicked the removedinterface-mode-option-ai. open-metadata/openmetadata-collate#9004 moves it to the sidebar switcher.Tests:
Use cases covered
Unit tests
AppModeSwitcher.test.tsx: one test per variant (pill label, card sentence, icon-only accessible name + opens the popover)LeftSidebar.test.tsx: opens the switcher from the sidebar footer (real component)UserProfileIcon.test.tsx: no empty footer strip without extra items (the extra-items mock is reset inbeforeEach)AIUserMenu.test.tsx: removed the interface-mode-switch absence test, which could no longer failUserProfileCard.test.tsx: mock follows thevariantpropInterfaceModeMenuItem.test.tsxwith the componentjeston LeftSidebar, AppModeSwitcher, ai-shell Sidebar, UserProfileIcon: 134 / 134 passedBackend integration tests
Playwright (UI) tests
playwright/e2e/Utils/appMode.ts:switchToAiModeViaProfileToggle→switchToAiModeViaSidebarSwitcher(clicks the sidebar switcher); callers updated in the 4 AppMode specs andProfilePreferences.spec.ts, with the stale profile-dropdown test title and comments renamed.--project=chromium --no-deps, OSS): 18 passed, 1 failed.AppModeResolver › new tab in the same browser inherits AI mode via the cross-tab hint, also fails onmain(12bba3e) with the same error. The switch step itself passes; the new tab boots Classic instead of AI from the hint. This PR doesn't touch it.Manual testing performed
UI screen recording:
Not recorded. Screenshots of every changed surface are attached below instead.
Checklist:
Fixes <issue-number>: <short explanation>Fixes open-metadata/openmetadata-collate#8999above.UI_PR_REVIEW_GUIDELINES.mdand fixed the findings.Screenshots