Skip to content

Fixes 9150: Compact the AI-mode sidebar search box and draw the shortcut as icons - #39794

Merged
Rohit0301 merged 11 commits into
mainfrom
Rohit0301/ai-mode-search-box-values
Dec 4, 2026
Merged

Rohit0301 merged 11 commits into
mainfrom
Rohit0301/ai-mode-search-box-values

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes open-metadata/openmetadata-collate#9150

I tightened the AI-mode sidebar search box (SidebarSearchButton) to the design redline and replaced its ⌘K / Ctrl+K text badge with icons from the design system, because the box looked oversized next to the rest of the sidebar.

  • Search box: 32px tall (was 38px) with 6px vertical padding, 12px "Search" text and 20px line height.
  • Spacing: -mt-1.5 takes 6px off the sidebar gap above the box (4px with Collate's 10px gap). mb-0.5 adds 2px below it.
  • Shortcut badge: ⌘ K on Apple devices and Ctrl K elsewhere. Each key is a core Badge (type="color" color="gray" size="xs" bordered={false}) with a tw:bg-tertiary keycap (gray-100 light, gray-800 dark, lighter than the gray-950 search box) and a 16px icon in fg-quaternary. Badge has no keycap color, so the background comes from className; a core keycap color would replace it. Key glyphs are new core icons from design (KeyboardCommand, KeyboardControl, KeyboardK, plus KeyboardOption, KeyboardAlt, KeyboardA for Collate's Ask AI badge) on a shared 20×20 canvas. The design SVGs' fixed-id <mask>s were removed: they clipped nothing, and with two copies of an icon on a page url(#id) resolved to a hidden copy and blanked the glyph. Icons were generated with yarn icons:generate; 38 unrelated icons the generator rewrote (pre-existing drift) were left out.
  • GlobalSearch.constants.ts: adds OPEN_SEARCH_KEYS ([KeyboardCommand, KeyboardK] or [KeyboardControl, KeyboardK]) from the same IS_APPLE check as OPEN_SEARCH_SHORTCUT. The text constant stays: it is the button's aria-label (the key badges are aria-hidden) and the collapsed rail's label.

Related:

  • openmetadata-collate#9247 (merged) keeps Collate's AI sidebar gap at 10px. The spacing above assumes that gap.
  • open-metadata/openmetadata-collate#9313 draws the Ask AI composer badge with ShortcutKeys and KeyboardOption. It depends on this PR, so merge this one first.

Type of change:

  • Improvement

High-level design:

N/A: a small styling change. Seven of the ten files are the generated icons and their SVG sources.

Tests:

Which test layer and why

Jest: the change is one leaf component's markup. Its only behavioural surface is what the badge renders, and the existing component test covers that.

Use cases covered

  • The AI-mode sidebar search box renders at the redline size, with the shortcut badge drawn as icons.
  • On a non-Apple platform the badge shows ctrl + K and the accessible name reads "Search (Ctrl+K)".
  • Ctrl+K and Esc still open and close global search.

Unit tests

  • Updated SidebarSearchButton.test.tsx: the badge holds two key badges with 16px icons. The keyboard and press tests are unchanged.
  • jest src/components/platform/ai-shell: 327 tests passed, 0 failed.
  • ESLint and Prettier are clean on the changed UI files. Prettier is clean on the generated icon files.

Backend integration tests

  • Not applicable: no backend changes.

Ingestion integration tests

  • Not applicable: no ingestion changes.

Playwright (UI) tests

  • No new Playwright test: the change is visual only and the Jest test covers the badge.
  • Not run locally (pending). select_playwright_tests.py maps this diff to 17 specs, mainly Features/AIMode/GlobalSearch.spec.ts, Features/AIMode/AppModeSidebarPersonaCustomization.spec.ts, Features/AppMode/*, Flow/Navbar.spec.ts and Pages/DataMarketplace.spec.ts. No spec asserts the ⌘K / Ctrl+K badge text or the trigger's size; the only matches are visual-regression baselines, and that lane is off.

Manual testing performed

  1. Ran the Collate stack locally: Collate server in Docker on :8585, plus the Collate UI dev server built against this branch's OSS sources.
  2. Logged in as [email protected] and switched to AI mode.
  3. Checked the sidebar search box: 32px tall, 242px wide, computed margin-bottom: 2px, and an 18px badge with ⌘ + K icons.
  4. Emulated Windows in Chromium (Windows user agent, navigator.platform = 'Win32'). The badge showed ctrl + K, the aria-label read "Search (Ctrl+K)", Ctrl+K opened global search and Esc closed it.

Search box, Mac (⌘ K):

Search box, Windows (Ctrl K):

The Ask AI badge screenshots are on openmetadata-collate#9313.

UI screen recording:

Not applicable: a styling change to an existing control, not a new feature. Screenshots are above.

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#9150 above (cross-repo).
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable.
  • For a UI feature or feature task: not applicable, this is a styling change (see above).
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
    • Reviewed SHA 488fbf67bbde179b1b371496e3342cb55e28a819. No 🔴 findings.
    • Placement: only MainPanel.tsx renders this, in the AI-mode sidebar. The icon barrel only gains exports, so OSS and Collate imports are unaffected.
    • Trade-off: the design's icon badge (every key drawn as an icon) vs the "Ctrl" text the tooltip and aria-label still use. The icons were the design's call and are kept.
    • Recommendation: approve.
    • 🟡 answered: the font size is set on the trigger rather than through Typography's size prop because the redline wants 12px text on a 20px line. size="text-xs" gives an 18px line.
  • Decision check: not applicable, this is styling only.

🤖 Generated with Claude Code

…cut as icons

Tighten the sidebar search trigger to the design redline (32px tall, 12px
text, 6px less space above it, 2px more below) and render its shortcut badge
with new KeyboardCommand/KeyboardControl/KeyboardK core icons instead of text.
@Rohit0301
Rohit0301 requested a review from a team as a code owner December 4, 2026 10:24
@Rohit0301
Rohit0301 requested review from shah-harshit and removed request for a team December 4, 2026 10:24
@github-actions

github-actions Bot commented Dec 4, 2026

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.

Ctrl replaces the caret glyph, so the Windows search badge reads "ctrl K".
Option, Alt and A let Collate draw its Ask AI shortcut (⌥⌘A / Ctrl+Alt+A)
with the same key glyphs.
Each design SVG sat its glyph at a different height (alt 1.7 units low, ctrl
0.2, the capitals 0.55 high), so mixed badges like "ctrl alt A" looked
uneven. Shift each viewBox so the glyph's bounds are centered.
The word glyphs (ctrl, alt) had to fit a square icon box, so they rendered at
about half the height of A and K. A shared ShortcutKeys renderer now draws
letters and named keys as 10px text next to the ⌘/⌥ icons, in one color, and
the unused KeyboardK/KeyboardA/KeyboardAlt/KeyboardControl icons are removed.
New Ctrl, Alt, K, A, ⌘ and ⌥ glyphs from design. ShortcutKeys renders each
icon 12px wide so all glyphs share the design scale (the word keys sit on
shorter canvases).
New Ctrl, K, A, ⌘ and ⌥ glyphs from design on a shared 20x20 canvas. Each key
renders 16px in its own bg-tertiary keycap, written inline in the search
button (the shared ShortcutKeys wrapper is gone).
@Rohit0301 Rohit0301 added the To release Will cherry-pick this PR into the release branch label Dec 4, 2026
Each design SVG clipped its glyph with a fixed-id <mask> that cut nothing. With
the icon rendered twice on a page (the composer mounts a hidden copy), url(#id)
resolved to the hidden copy's mask and the glyph vanished.
Matches the other keyboard icons: 1.3 stroke on the shared 20x20 canvas, so
Alt no longer renders larger and heavier than Ctrl and A.
Each key is a borderless gray xs Badge with a bg-tertiary keycap and an
fg-quaternary icon.
@gitar-bot

gitar-bot Bot commented Dec 4, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟢 Low risk 4 closed / 4 findings

The changes only adjust sidebar search presentation and add display icons; the existing shortcut label and activation behavior are unchanged.

Compacts the AI-mode sidebar search box to the design redline (32px tall, 12px text) and replaces the ⌘K / Ctrl+K text badge with keyboard icons on a shared 20×20 canvas. The spacing assumes Collate's 10px sidebar gap, and the OPEN_SEARCH_KEYS doc now matches the 20×20 icon size. No open issues found.

✅ 4 closed
✅ Quality: -mt-1.5 depends on Collate's 10px sidebar gap, which nothing records

📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/Sidebar/SidebarSearchButton.tsx:28
The description says the tw:-mt-1.5 offset on the trigger "assumes the 10px Collate sidebar gap (openmetadata-collate#9247)". That makes the layout here depend on a spacing value defined in another repository. Nothing in the tree records this: no comment on line 28 and no file in docs/decisions/. The repo squash-merges, so the description will not reach git log. If the Collate gap changes or #9247 is reverted, the search box will sit misaligned and no one will know why.

The rule to record is: "The AI-mode sidebar search trigger offsets itself by -6px (tw:-mt-1.5) on the assumption that the Collate sidebar places a 10px gap above it; changing that gap requires changing this offset." You can add it as a decision record, or at minimum as a why-comment next to TRIGGER_CLASS that cites the Collate PR.

✅ Quality: OPEN_SEARCH_KEYS doc says 17-unit canvas, but the icons are now 20×20

📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/GlobalSearch/GlobalSearch.constants.ts:67 📄 openmetadata-ui-core-components/src/main/resources/ui/src/icons/KeyboardControl.tsx:32
This commit adds a doc comment saying each key icon "is trimmed to its glyph on a 17-unit-tall canvas". The same commit moves every keyboard icon to a 20×20 viewBox with a 16×16 mask, and KeyboardAlt to 0 -1.6 20 20. So the comment describes geometry that no longer exists, and anyone sizing the keycaps from it (SidebarSearchButton uses height={16} with auto width) gets the wrong picture. Please update it to match the new icons, or remove it.

Closed: Bug: KeyboardControl now draws the word "Ctrl", not ^, so the non-Apple badge is tiny text

📄 openmetadata-ui-core-components/src/main/resources/ui/src/icons/KeyboardControl.tsx:35-38 📄 openmetadata-ui-core-components/src/main/resources/ui/icons/keyboard-control.svg:2 📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/GlobalSearch/GlobalSearch.constants.ts 📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/Sidebar/SidebarSearchButton.tsx:54-57
This commit swaps the KeyboardControl glyph from a caret chevron (m16 13-6-6-6 6) to the filled word "Ctrl". OpenSearchModIcon in GlobalSearch.constants.ts resolves to KeyboardControl on non-Apple devices, and SidebarSearchButton renders it with size={12}. Windows and Linux users will see the full word "Ctrl" squeezed into a 12px square. Its letters fill only about y 5.8–14.6 of the 20-unit viewBox, which makes them about 5px tall next to a full-size K. The PR description says the badge shows "^ + K elsewhere", so the code and the stated design disagree. Swapping the glyph also changes every existing consumer of KeyboardControl with no visible reason in the diff. Fix: keep KeyboardControl as the ^ glyph and add the "Ctrl" word as its own icon (e.g. KeyboardCtrl) if one is needed. If "Ctrl" is the intended design, update the description and give the badge a wider glyph so the text stays readable.

Closed: Quality: Visible 'ctrl' key label is a hardcoded literal, not translated

📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/GlobalSearch/GlobalSearch.constants.ts:64-66 📄 openmetadata-ui/src/main/resources/ui/src/components/platform/ai-shell/ShortcutKeys/ShortcutKeys.tsx:34-36
Off Apple devices, OPEN_SEARCH_KEYS puts the literal 'ctrl' into the sidebar badge, and ShortcutKeys renders it as is. That is user-facing text outside i18n. The repo already translates key names in badges, for example <kbd>{t('label.shift')}</kbd> in CommentComposer.tsx and KeyHelp.tsx, so this label won't follow the user's locale. To fix it, add a label.ctrl key to en-us.json, run yarn i18n, and have ShortcutKeys translate named keys. For example, keep translation keys in the constant and render them with t(...), or make the caller pass already-translated strings.

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
Rohit0301 merged commit 95b9051 into main Dec 4, 2026
30 of 32 checks passed
@Rohit0301
Rohit0301 deleted the Rohit0301/ai-mode-search-box-values branch December 4, 2026 14:38
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.1 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

gh-bot-collate Bot commented Dec 4, 2026

Copy link
Copy Markdown

🤖 Backport to 2.1 opened as #39854 (clean cherry-pick). It merges itself once the checks pass.

@gh-bot-collate

gh-bot-collate Bot commented Dec 4, 2026

Copy link
Copy Markdown

🤖 Not backported to 2.0. Claude looked at the conflict and declined to resolve it:

Backport aborted: PR #39794 → 2.0

Reason

This PR tweaks the AI-shell sidebar search box (SidebarSearchButton.tsx,
GlobalSearch.constants.ts under
openmetadata-ui/.../components/platform/ai-shell/) and draws its keyboard
shortcut using new icon components added to the shared
openmetadata-ui-core-components icon library (src/icons/Keyboard*.tsx,
exported from src/icons/index.ts and consumed via
@openmetadata/ui-core-components/icons).

Neither of these exists on 2.0:

  • The ai-shell feature directory does not exist anywhere on 2.0
    (git grep -l "ai-shell" HEAD and a search for SidebarSearchButton
    / GlobalSearch.constants.ts both return nothing). There is no
    SidebarSearchButton component or ai-shell sidebar search box to
    compact.
  • The shared PascalCase icon component library
    (openmetadata-ui-core-components/src/main/resources/ui/src/icons/,
    e.g. Key.tsx, Key01.tsx, and the new KeyboardCommand.tsx etc. this
    PR adds) does not exist on 2.0. The core-components module on 2.0
    only has scattered one-off icon files (checkbox-icons.tsx,
    video-player/icons.tsx, foundations/dot-icon.tsx, …) with no shared
    icon registry or @openmetadata/ui-core-components/icons import path.

Porting this change would mean first building the entire AI-shell sidebar
feature and the shared icon-component system on 2.0 — well outside the
scope of this backport. There is nothing to "compact" or "redraw as icons"
on 2.0, since the target UI doesn't exist there.

Recommendation

Do not backport. If the AI-shell feature is later backported to 2.0 as
its own effort, this cosmetic follow-up (#39794) should be re-evaluated at
that time, once the dependent icon system and sidebar component exist.

State left behind

The repository is left mid-cherry-pick (git cherry-pick 95b9051803f0a521998dba3a06fbda71fa5f0aad
in progress, conflicts unresolved) as found. No files were staged or
committed by this pass.

resolver run

Rohit0301 added a commit that referenced this pull request Dec 4, 2026
…cut as icons (#39794) (#39854)

* Fixes 9150: Compact the AI-mode sidebar search box and draw the shortcut as icons

Tighten the sidebar search trigger to the design redline (32px tall, 12px
text, 6px less space above it, 2px more below) and render its shortcut badge
with new KeyboardCommand/KeyboardControl/KeyboardK core icons instead of text.

* Add Option, Alt, Ctrl and A keyboard icons for the shortcut badges

Ctrl replaces the caret glyph, so the Windows search badge reads "ctrl K".
Option, Alt and A let Collate draw its Ask AI shortcut (⌥⌘A / Ctrl+Alt+A)
with the same key glyphs.

* Center the keyboard glyphs in their icon boxes

Each design SVG sat its glyph at a different height (alt 1.7 units low, ctrl
0.2, the capitals 0.55 high), so mixed badges like "ctrl alt A" looked
uneven. Shift each viewBox so the glyph's bounds are centered.

* Record why the sidebar search box margins assume Collate's 10px gap

* Draw shortcut letters and named keys as text, keep icons for ⌘ and ⌥

The word glyphs (ctrl, alt) had to fit a square icon box, so they rendered at
about half the height of A and K. A shared ShortcutKeys renderer now draws
letters and named keys as 10px text next to the ⌘/⌥ icons, in one color, and
the unused KeyboardK/KeyboardA/KeyboardAlt/KeyboardControl icons are removed.

* Draw every shortcut key with the design's keyboard icons at one scale

New Ctrl, Alt, K, A, ⌘ and ⌥ glyphs from design. ShortcutKeys renders each
icon 12px wide so all glyphs share the design scale (the word keys sit on
shorter canvases).

* Draw each shortcut key as its own keycap with the design's outline icons

New Ctrl, K, A, ⌘ and ⌥ glyphs from design on a shared 20x20 canvas. Each key
renders 16px in its own bg-tertiary keycap, written inline in the search
button (the shared ShortcutKeys wrapper is gone).

* Drop the masks from the keyboard icons

Each design SVG clipped its glyph with a fixed-id <mask> that cut nothing. With
the icon rendered twice on a page (the composer mounts a hidden copy), url(#id)
resolved to the hidden copy's mask and the glyph vanished.

* Describe the keyboard icons' 20x20 canvas in the OPEN_SEARCH_KEYS doc

* Use the design's outline Alt key icon

Matches the other keyboard icons: 1.3 stroke on the shared 20x20 canvas, so
Alt no longer renders larger and heavier than Ctrl and A.

* Render the search shortcut keycaps with core Badge

Each key is a borderless gray xs Badge with a bg-tertiary keycap and an
fg-quaternary icon.

(cherry picked from commit 95b9051)

Co-authored-by: Rohit Jain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants