Skip to content

feat(ui): add the Classic/AI interface switcher to the classic sidebar footer - #38861

Merged
Rohit0301 merged 2 commits into
mainfrom
Rohit0301/classic-ai-switcher-add
Nov 27, 2026
Merged

Rohit0301 merged 2 commits into
mainfrom
Rohit0301/classic-ai-switcher-add

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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-ai test 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 AppModeSwitcher in its sidebar footer. This PR unifies both modes on the same switcher, per the Unified Interface Switcher design:

  • Classic, expanded sidebar: a Classic mode card at the bottom of the left sidebar, under Logout, opening the shared Switch interface popover (Classic · Deprecated / AI / Open in … when I log in).
  • Classic, collapsed sidebar: a square icon button in the rail opening the same popover.
  • Profile dropdown: the User Interface section is removed, along with InterfaceModeMenuItem, its test, and the now-unused label.user-interface key in all 21 locales.
  • AI mode: unchanged, apart from the shared popover being 16px wider (240 → 256px) so Open in Classic when I log in fits on one line.

Type of change:

  • Improvement

High-level design:

  • AppModeSwitcher takes a variant prop (inline | pill | card | icon) in place of the old compact boolean. inline and pill are the two AI-mode looks that already existed (pill is the AI collapsed rail, now passed explicitly by UserProfileCard). card and icon are new and used only by the classic LeftSidebar.
  • The card and icon variants are framed by core Card, the same structure the AI sidebar's UserProfileCard uses 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.
  • Constants and prop types moved to AppModeSwitcher.constants.ts / AppModeSwitcher.types.ts.
  • The popover now has an accessible name (Switch interface), and its checked checkbox uses tw:bg-brand-solid instead of the raw tw:bg-blue-600.
  • UserProfileIcon renders the extra-items strip (Collate adds items there) only when there are items, using Divider + Box instead of a bordered div.
  • Collate has no switcher component of its own; it consumes this one through the OpenMetadata mirror. Collate's Playwright suite does keep its own copy of the switch-to-AI helper (AskCollateUtils.switchToAiModeViaProfileToggle), which clicked the removed interface-mode-option-ai. open-metadata/openmetadata-collate#9004 moves it to the sidebar switcher.

Tests:

Use cases covered

  • Classic user opens the switcher from the sidebar footer (expanded and collapsed) and switches to AI
  • Profile dropdown no longer shows a User Interface section, and shows no empty strip when there are no extra items
  • AI mode switcher (expanded inline row, collapsed pill) is unchanged

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 in beforeEach)
  • AIUserMenu.test.tsx: removed the interface-mode-switch absence test, which could no longer fail
  • UserProfileCard.test.tsx: mock follows the variant prop
  • Removed InterfaceModeMenuItem.test.tsx with the component
  • jest on LeftSidebar, AppModeSwitcher, ai-shell Sidebar, UserProfileIcon: 134 / 134 passed

Backend integration tests

  • Not applicable (no backend API changes).

Playwright (UI) tests

  • playwright/e2e/Utils/appMode.ts: switchToAiModeViaProfileToggle → switchToAiModeViaSidebarSwitcher (clicks the sidebar switcher); callers updated in the 4 AppMode specs and ProfilePreferences.spec.ts, with the stale profile-dropdown test title and comments renamed.
  • Ran the 5 affected specs locally (--project=chromium --no-deps, OSS): 18 passed, 1 failed.
  • The one failure, AppModeResolver › new tab in the same browser inherits AI mode via the cross-tab hint, also fails on main (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

  1. Ran the UI dev server against a local OpenMetadata server, logged in as admin in Classic mode.
  2. Expanded sidebar: the Classic mode card sits under Logout and opens the Switch interface popover; switching to AI lands in the AI shell.
  3. Collapsed sidebar: the icon button opens the same popover.
  4. Profile dropdown: no User Interface section.
  5. AI mode: sidebar switcher and popover as before; switching back to Classic works.

UI screen recording:

Not recorded. Screenshots of every changed surface are attached below instead.

Checklist:

  • I have read CONTRIBUTING.md (the pre-review gate) and the contributor docs.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes open-metadata/openmetadata-collate#8999 above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: reviewed the final diff against UI_PR_REVIEW_GUIDELINES.md and fixed the findings.

Screenshots

Classic mode - expanded sidebar with the Classic mode card

Classic mode - Switch interface popover

Classic mode - collapsed sidebar icon button with popover

Profile dropdown without the User Interface section

AI mode - unchanged switcher

Playwright run - 18 passed, 1 failure that also fails on main

…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
@Rohit0301
Rohit0301 requested a review from a team as a code owner November 26, 2026 13:32
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@ShaileshParmar11 ShaileshParmar11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 InterfaceModeMenuItem was 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, the compact prop or label.user-interface. Collate does not override getUserProfileExtraItems, so the new extraItems.length check is safe.
  • The core Popover passes aria-label on to its inner Dialog, so the new "Switch interface" name is announced.
  • The core Card adds 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-solid replaces the raw tw:bg-blue-600, and tw:hover:bg-primary_hover exists.

Outside the diff (cannot be commented inline)

  • 🟡 AIUserMenu.test.tsx:437-446 ("does not offer an interface-mode switch") only checks that interface-mode-option-classic and interface-mode-option-ai are absent. This PR deletes the only component that rendered them, so the test can no longer fail. Please delete it.

Checks

  • Validate PR Metadata fails because the description links the issue with Refs. It needs Fixes open-metadata/openmetadata-collate#8999.
  • Compatibility checks fails at cd ai-platform && mvn -B clean install -DskipTests. That step builds ai-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.ts comment.

@gitar-bot

gitar-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Moving 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.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@Rohit0301

Copy link
Copy Markdown
Contributor Author

Thanks for the review, ShaileshParmar11. All three inline comments are addressed and resolved. On the points outside the diff:

  • AIUserMenu.test.tsx "does not offer an interface-mode switch": deleted in 5c855c5.
  • Collate side: companion PR open-metadata/openmetadata-collate#9004 moves Collate's helper to the sidebar switcher. The description now links it and no longer says nothing changes on the Collate side.
  • Validate PR Metadata: the description now says Fixes open-metadata/openmetadata-collate#8999. A re-run still fails: the check honours a cross-repo link only for org members, and its membership lookup for my account returns 404. I'll sort out the membership visibility, or a maintainer can apply skip-pr-checks.
  • Compatibility checks: running again on the new push.

@Rohit0301
Rohit0301 merged commit e2a8db3 into main Nov 27, 2026
58 of 61 checks passed
@Rohit0301
Rohit0301 deleted the Rohit0301/classic-ai-switcher-add branch November 27, 2026 06:09
Rohit0301 added a commit that referenced this pull request Nov 27, 2026
…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)
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.

2 participants