Repository navigation
Fixes 9150: Compact the AI-mode sidebar search box and draw the shortcut as icons - #39794
Conversation
…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.
❌ 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 |
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).
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.
Code Review ✅ Approved 🟢 Low risk 4 closed / 4 findingsThe 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 ✅ 4 closed✅ Quality: -mt-1.5 depends on Collate's 10px sidebar gap, which nothing records
✅ Quality: OPEN_SEARCH_KEYS doc says 17-unit canvas, but the icons are now 20×20
Closed: Bug: KeyboardControl now draws the word "Ctrl", not ^, so the non-Apple badge is tiny text
Closed: Quality: Visible 'ctrl' key label is a hardcoded literal, not translated
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 |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Not backported to
|
…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]>
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+Ktext badge with icons from the design system, because the box looked oversized next to the rest of the sidebar.-mt-1.5takes 6px off the sidebar gap above the box (4px with Collate's 10px gap).mb-0.5adds 2px below it.Badge(type="color" color="gray" size="xs" bordered={false}) with atw:bg-tertiarykeycap (gray-100 light, gray-800 dark, lighter than the gray-950 search box) and a 16px icon infg-quaternary.Badgehas no keycap color, so the background comes fromclassName; a core keycap color would replace it. Key glyphs are new core icons from design (KeyboardCommand,KeyboardControl,KeyboardK, plusKeyboardOption,KeyboardAlt,KeyboardAfor 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 pageurl(#id)resolved to a hidden copy and blanked the glyph. Icons were generated withyarn icons:generate; 38 unrelated icons the generator rewrote (pre-existing drift) were left out.GlobalSearch.constants.ts: addsOPEN_SEARCH_KEYS([KeyboardCommand, KeyboardK]or[KeyboardControl, KeyboardK]) from the sameIS_APPLEcheck asOPEN_SEARCH_SHORTCUT. The text constant stays: it is the button'saria-label(the key badges arearia-hidden) and the collapsed rail's label.Related:
ShortcutKeysandKeyboardOption. It depends on this PR, so merge this one first.Type of change:
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
Unit tests
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.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
select_playwright_tests.pymaps this diff to 17 specs, mainlyFeatures/AIMode/GlobalSearch.spec.ts,Features/AIMode/AppModeSidebarPersonaCustomization.spec.ts,Features/AppMode/*,Flow/Navbar.spec.tsandPages/DataMarketplace.spec.ts. No spec asserts the⌘K/Ctrl+Kbadge text or the trigger's size; the only matches are visual-regression baselines, and that lane is off.Manual testing performed
[email protected]and switched to AI mode.margin-bottom: 2px, and an 18px badge with ⌘ + K icons.navigator.platform = 'Win32'). The badge showed ctrl + K, thearia-labelread "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:
Fixes <issue-number>: <short explanation>Fixes open-metadata/openmetadata-collate#9150above (cross-repo).REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.488fbf67bbde179b1b371496e3342cb55e28a819. No 🔴 findings.MainPanel.tsxrenders this, in the AI-mode sidebar. The icon barrel only gains exports, so OSS and Collate imports are unaffected.aria-labelstill use. The icons were the design's call and are kept.sizeprop because the redline wants 12px text on a 20px line.size="text-xs"gives an 18px line.🤖 Generated with Claude Code