Skip to content

Studio: move sidebar search into the header - #7304

Merged
danielhanchen merged 3 commits into
mainfrom
studio-sidebar-search-in-header
Jul 22, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
studio-sidebar-search-in-header

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Jul 21, 2026 •

Copy link
Copy Markdown
Member

What this does

Moves the Studio sidebar Search action out of its own full-width nav row and into the sidebar header, as an icon button sitting right next to the sidebar toggle. This keeps New Chat as the only fixed row above the scrolling thread list, which reads cleaner and matches the layout people expect.

Changes

  • Search is now an icon button in the sidebar header, placed just left of the collapse toggle. It opens the same search dialog and its tooltip shows the Cmd K shortcut.
  • The old full-width Search row is hidden in the expanded sidebar on macOS and web, but kept for the collapsed icon rail.
  • On Windows and Linux desktop builds the header uses a custom window titlebar, so there is no header search button there. On those platforms the full-width search row stays visible exactly as before, so no platform loses access to search.
  • Added a small bottom gap (5px) under New Chat only while the list is scrolled and New Chat is pinned as a header. The normal, unscrolled spacing is unchanged, and the change eases in with a padding transition.

Scope and risk

  • Frontend only. This touches the sidebar component and nothing in the training, inference, or backend paths, so no compute pathway is affected.
  • No behavior change to the search dialog itself or the Cmd K binding.

Put the search action as an icon button next to the sidebar toggle in
the header instead of a full-width nav row, so New Chat is the only
fixed row above the scrolling list. The search row is kept for the
collapsed icon rail only. Also add a small bottom gap under New Chat
when it is pinned during scroll.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request moves the search button to the sidebar header, wrapping it alongside the close sidebar button, and hides the original search navigation row unless the sidebar is collapsed. It also dynamically adjusts the sidebar group's padding based on its scroll state. The feedback suggests hiding the search tooltip on mobile devices to prevent it from getting stuck on tap, and dynamically displaying either "⌘K" or "Ctrl+K" in the tooltip depending on the user's operating system.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 1099 to 1103
<TooltipContent
side="bottom"
sideOffset={6}
className="tooltip-compact"
className="tooltip-compact flex items-center gap-1.5"
>

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.

medium

On mobile devices, hover tooltips can get "stuck" on the screen after tapping the interactive element. To prevent this, we should hide the tooltip on mobile by passing hidden={isMobile} to the TooltipContent component, consistent with how other tooltips in the sidebar are configured.

Suggested change
<TooltipContent
side="bottom"
sideOffset={6}
className="tooltip-compact"
className="tooltip-compact flex items-center gap-1.5"
>
<TooltipContent
side="bottom"
sideOffset={6}
className="tooltip-compact flex items-center gap-1.5"
hidden={isMobile}
>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch, applied in 7732c64. The header search button renders on mobile too, so its tooltip needed the same hidden={isMobile} guard the SidebarMenuButton tooltips use.

Comment on lines +1105 to +1107
<kbd className="rounded bg-black/10 px-1 py-px text-[10px] font-medium leading-none dark:bg-white/15">
⌘K
</kbd>

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.

medium

The keyboard shortcut in the tooltip is hardcoded to ⌘K. On non-Mac platforms (Windows/Linux), the standard modifier key is Ctrl rather than ⌘. Since the search dialog's event listener in chat-search-dialog.tsx supports both metaKey and ctrlKey, we should dynamically display ⌘K or Ctrl+K based on the user's platform to avoid confusion.

Suggested change
<kbd className="rounded bg-black/10 px-1 py-px text-[10px] font-medium leading-none dark:bg-white/15">
⌘K
</kbd>
<kbd className="rounded bg-black/10 px-1 py-px text-[10px] font-medium leading-none dark:bg-white/15">
{typeof navigator !== "undefined" && /Mac|iPod|iPhone|iPad/.test(navigator.userAgent) ? "⌘K" : "Ctrl+K"}
</kbd>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed, fixed in 7732c64. It now shows Cmd K on Mac and Ctrl K elsewhere. I used getClientPlatform() rather than a userAgent regex so it also covers navigator.userAgentData, and it stays correct on the web build where the Tauri titlebar helpers report false on a Mac browser.

The header search button only renders on mac/web where the brand row
shows. On win/linux custom titlebars there's no header button, so keep
the full-width search row visible instead of hiding it.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f79d2ce8d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

icon={Search01Icon}
label={t("shell.navigation.search")}
active={false}
className="hidden group-data-[collapsible=icon]:block"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep search visible with custom titlebars

When Studio runs in Tauri on Windows/Linux, shouldUseCustomWindowTitlebar() makes showSidebarBrand false, so the new header search button is not rendered because that header content is gated by {showSidebarBrand && ...}. Hiding this NavItem in the expanded sidebar therefore removes the only visible Search action for those users unless they collapse the sidebar; keep this row visible for the custom-titlebar branch or add the header button there too.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was already handled in 25913ce, before this review landed. On custom-titlebar platforms (win/linux) showSidebarBrand is false, so the row keeps its default visibility instead of being hidden; only mac/web hide the row and use the header button. Verified across the platform matrix.

- Hide the search tooltip on mobile (hidden={isMobile}), matching the
  SidebarMenuButton tooltip convention.
- Show Cmd K on Mac and Ctrl K elsewhere instead of a hardcoded glyph;
  the search dialog binds both meta and ctrl. Uses getClientPlatform so
  it is correct on web too, not just Tauri.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 7732c64004

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 8517721 into main Jul 22, 2026
41 checks passed
@danielhanchen
danielhanchen deleted the studio-sidebar-search-in-header branch July 22, 2026 06:25
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