Repository navigation
fix(studio): show chat sidebar menu on touch devices - #7297
Conversation
Recents/Pinned chat row actions were hidden until hover, so iPad users could not open the kebab menu to delete chats. Reveal actions on coarse pointers using the same pattern as hub model rows. Fixes unslothai#7276
There was a problem hiding this comment.
Code Review
This pull request ensures that chat sidebar row actions are immediately visible and tappable on touch/coarse pointer devices (such as iPads) by applying media query-based Tailwind classes for opacity, pointer events, and padding. A contract test has also been added to verify these changes. The reviewer noted that reserving extra padding (pr-16) for pinned items is redundant since there is no inline unpin button on hover, and suggested simplifying the padding logic to prevent unnecessary title truncation.
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.
| variant === "project" | ||
| ? "group-hover/project-chat-item:pr-6 group-has-[.sidebar-row-action[data-state=open]]/project-chat-item:pr-6" | ||
| ? "group-hover/project-chat-item:pr-6 group-has-[.sidebar-row-action[data-state=open]]/project-chat-item:pr-6 [@media(pointer:coarse)]:pr-6" | ||
| : isPinned | ||
| ? // Pinned rows show an extra unpin button on hover, so reserve more room | ||
| // (pr-8 when the menu is open keeps the unpin button clear of the title). | ||
| "group-hover/recent-item:pr-16 group-has-[.sidebar-row-action[data-state=open]]/recent-item:pr-8" | ||
| "group-hover/recent-item:pr-16 group-has-[.sidebar-row-action[data-state=open]]/recent-item:pr-8 [@media(pointer:coarse)]:pr-16" | ||
| : // Hover room for the kebab only; title keeps one more character. | ||
| "group-hover/recent-item:pr-6 group-has-[.sidebar-row-action[data-state=open]]/recent-item:pr-6", | ||
| "group-hover/recent-item:pr-6 group-has-[.sidebar-row-action[data-state=open]]/recent-item:pr-6 [@media(pointer:coarse)]:pr-6", | ||
| ); |
There was a problem hiding this comment.
There is no inline unpin button rendered on hover for pinned rows in renderChatSidebarItem (the only pin/unpin action is inside the dropdown menu). As a result, reserving pr-16 (64px of padding) on hover and coarse pointers for pinned items is redundant and causes pinned chat titles to truncate unnecessarily early, especially on mobile/touch devices where space is limited.
We can simplify the padding logic and reclaim this space by treating pinned and unpinned recent items identically.
variant === "project"
? "group-hover/project-chat-item:pr-6 group-has-[.sidebar-row-action[data-state=open]]/project-chat-item:pr-6 [@media(pointer:coarse)]:pr-6"
: "group-hover/recent-item:pr-6 group-has-[.sidebar-row-action[data-state=open]]/recent-item:pr-6 [@media(pointer:coarse)]:pr-6",
);
There was a problem hiding this comment.
Incorrect premise: renderChatSidebarItem renders an inline unpin button for pinned recent rows (is-unpin-action) in addition to the kebab, so pr-16 is required; collapsing to pr-6 would overlap the title.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6ef7dc275
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Touch/coarse pointers have no hover, so reveal row actions immediately | ||
| // (mirrors hub model rows and project chat lists). | ||
| const touchVisibleAction = | ||
| "[@media(pointer:coarse)]:opacity-100 [@media(pointer:coarse)]:pointer-events-auto"; |
There was a problem hiding this comment.
Make coarse-pointer override beat sidebar-row-action
On coarse-pointer devices these arbitrary media utilities have only the same class specificity as .sidebar-row-action, which is declared later in src/index.css with opacity-0 pointer-events-none; unlike the hover/focus selectors, they do not gain extra specificity. That means the generated @media(pointer:coarse) declarations are overridden and the iPad/touch-only case this commit targets still leaves the chat kebab hidden and untappable unless it is focused or opened. Move the coarse override into a later/higher-specificity rule or make it important so it actually wins.
Useful? React with 👍 / 👎.
Resolve app-sidebar conflict: keep main's pin quick-action padding and preserve touch-device coarse-pointer visibility for project chat rows.
Move the touch-device override into index.css after .sidebar-row-action so it wins the cascade. Arbitrary Tailwind media utilities on the element had equal specificity and were overridden by the base rule.
|
Fixed in 3c97da4. P1 — Make coarse-pointer override beat sidebar-row-action: Valid. The Fix: Moved the coarse-pointer override into Tests: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d3bf268f8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @apply absolute top-0 bottom-0 right-0 inline-flex cursor-pointer items-center justify-end pl-2 pr-1.5 opacity-0 pointer-events-none outline-none; | ||
| } | ||
| @media (pointer: coarse) { | ||
| .sidebar-row-action { |
There was a problem hiding this comment.
Limit coarse-pointer visibility to padded rows
On coarse-pointer devices this selector makes every .sidebar-row-action in the sidebar visible, not just the chat rows that were updated to reserve touch padding. For example, pinned project rows still keep pr-2.5 unless hovered/open while their two absolute action buttons (New chat and Project options) become always visible, so long project names can render underneath the buttons and the right edge tap target changes from toggling the row to hitting an action. Scope the coarse override to the chat row actions, or add matching coarse padding to every row action this rule reveals.
Useful? React with 👍 / 👎.
Only chat kebabs/unpin buttons that reserve touch padding get sidebar-touch-reveal, so project/run/nav rows stay hover-revealed.
|
Fixed in c756140. P2 — Limit coarse-pointer visibility to padded rows: Valid. The global Fix: Introduced Tests: |
|
Ready for review — re-verified locally:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c75614074d
ℹ️ 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".
| .sidebar-row-action { | ||
| @apply absolute top-0 bottom-0 right-0 inline-flex cursor-pointer items-center justify-end pl-2 pr-1.5 opacity-0 pointer-events-none outline-none; | ||
| } | ||
| @media (pointer: coarse) { |
There was a problem hiding this comment.
Reveal chat menus when any touch pointer is present
On hybrid devices with a mouse/trackpad and touchscreen, the primary pointer is fine even though touch input is available as any-pointer: coarse; this media query therefore does not match, leaving these chat actions at the base opacity-0 pointer-events-none state. Tapping a chat row navigates instead of exposing its menu, so touch-capable Windows/tablet-laptop users still cannot open the sidebar menu. Use any-pointer: coarse (or equivalent input-aware handling) for the touch reveal.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Intentional scope: hybrid devices keep a working hover path, and any-pointer: coarse would force permanently visible kebabs on every touchscreen laptop even when driven by a mouse. Issue 7276 targets pure-touch primary-pointer devices.
| "group-hover/recent-item:pr-16 group-has-[.sidebar-row-action[data-state=open]]/recent-item:pr-8 [@media(pointer:coarse)]:pr-16" | ||
| : // Hover room for the kebab only; title keeps one more character. | ||
| "group-hover/recent-item:pr-6 group-has-[.sidebar-row-action[data-state=open]]/recent-item:pr-6", | ||
| "group-hover/recent-item:pr-6 group-has-[.sidebar-row-action[data-state=open]]/recent-item:pr-6 [@media(pointer:coarse)]:pr-6", |
There was a problem hiding this comment.
Reserve the full menu hit area on touch rows
For unpinned Recent chats on coarse-pointer devices, the new permanent menu button occupies 38px (pl-2 + its 24px glyph + pr-1.5), but this touch-only padding reserves only pr-6 (24px). The last 14px of each title lies under a pointer-enabled menu button, so tapping that visible portion opens Chat options rather than the chat and text can render beneath the kebab. Increase the coarse-pointer right padding to cover the complete action button.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f8c504a: coarse-pointer unpinned rows now reserve pr-10 so the title never sits under the always-visible kebab.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Reviewed and verified this fixes a real issue: on touch devices the chat sidebar menu was unreachable because it only revealed on hover. The change surfaces it on tap without regressing the desktop hover path. Simulated the before and after and confirmed the control is reachable across pointer and touch inputs. No behavior change for mouse users. Codex review has no open items. The remaining red CI is pre-existing upstream breakage (Core HF/TRL and Repo tests CPU) unrelated to this change. Good to merge. |
Problem
On iPad and other touch devices, chat rows in the Recents/Pinned sidebar could not be deleted. The kebab menu that exposes Rename / Pin / Delete is rendered with
sidebar-row-action, which staysopacity-0 pointer-events-noneuntil hover. Touch devices have no persistent hover, so the menu button was invisible and untappable.Reported in #7276.
Fix
Reveal chat row actions on coarse pointers (
[@media(pointer:coarse)]) and reserve title padding on touch so the kebab stays tappable. This matches the existing Studio pattern used in hub model rows (models-catalog-rows.tsx) and project chat lists (chat-page.tsx), rather than adding a new long-press interaction.Changes are limited to
renderChatSidebarItem()inapp-sidebar.tsx.Verification
npm run typecheck(studio/frontend)pytest tests/studio/test_desktop_reliability_frontend_contract.py::test_chat_sidebar_row_actions_visible_on_coarse_pointersCompatibility
Frontend only, scoped to Recents/Pinned chat sidebar rows. Desktop hover behaviour is unchanged: fine pointers still hide the kebab until hover/focus/open. Training runs, Projects nav, and other sidebar rows are untouched.
Fixes #7276