Skip to content

fix(studio): show chat sidebar menu on touch devices - #7297

Merged
danielhanchen merged 7 commits into
unslothai:mainfrom
Souravrajvi0:fix/7276-ipad-chat-sidebar-menu
Jul 24, 2026
Merged

danielhanchen merged 7 commits into
unslothai:mainfrom
Souravrajvi0:fix/7276-ipad-chat-sidebar-menu

Conversation

@Souravrajvi0

@Souravrajvi0 Souravrajvi0 commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

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 stays opacity-0 pointer-events-none until 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() in app-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_pointers
  • Manual (not run here): on iPad or a mobile viewport, open Chat → Recents → tap the kebab on a chat → Delete is reachable

Compatibility

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

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

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

Comment on lines 841 to 849
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",
);

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

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",
    );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@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: 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";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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.
@Souravrajvi0

Souravrajvi0 commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Fixed in 3c97da4.

P1 — Make coarse-pointer override beat sidebar-row-action: Valid. The [@media(pointer:coarse)]:opacity-100 utilities on the element had equal specificity to .sidebar-row-action { opacity-0; pointer-events: none } in index.css, and the base rule came later in the cascade, so iPad/touch users still couldn't tap the kebab.

Fix: Moved the coarse-pointer override into index.css immediately after .sidebar-row-action, using @media (pointer: coarse) { .sidebar-row-action { opacity-100; pointer-events-auto } } so it reliably wins. Removed the ineffective inline arbitrary media utilities from renderChatSidebarItem (padding [@media(pointer:coarse)]:pr-* rules are unchanged — those apply to .sidebar-nav-btn, not .sidebar-row-action).

Tests: test_chat_sidebar_row_actions_visible_on_coarse_pointers (updated to assert CSS ordering) + npm run typecheck.

@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: 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".

Comment thread studio/frontend/src/index.css Outdated
@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 {

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 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.
@Souravrajvi0

Copy link
Copy Markdown
Contributor Author

Fixed in c756140.

P2 — Limit coarse-pointer visibility to padded rows: Valid. The global @media (pointer: coarse) { .sidebar-row-action } rule also revealed project/run/nav actions that still use hover-only padding (pr-2.5), so long labels could sit under always-visible buttons.

Fix: Introduced sidebar-touch-reveal on chat kebabs/unpin buttons from renderChatSidebarItem (the rows that already reserve [@media(pointer:coarse)]:pr-*). The CSS rule now targets .sidebar-row-action.sidebar-touch-reveal only. Project folders, Projects nav, and run rows stay hover/focus revealed.

Tests: test_chat_sidebar_row_actions_visible_on_coarse_pointers (asserts scoped selector) + npm run typecheck. Branch is current with main (0 behind).

@Souravrajvi0

Copy link
Copy Markdown
Contributor Author

Ready for review — re-verified locally:

  • Codex P1 (CSS specificity) fixed in 3c97da4c
  • Codex P2 (scope to padded chat rows) fixed in c75614074 via sidebar-touch-reveal
  • test_chat_sidebar_row_actions_visible_on_coarse_pointers passed
  • npm run typecheck clean
  • Branch current with main (0 behind)

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

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

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@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: 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) {

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 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 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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",

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 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 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fixed in f8c504a: coarse-pointer unpinned rows now reserve pr-10 so the title never sits under the always-visible kebab.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: f8c504a4f4

ℹ️ 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

Copy link
Copy Markdown
Member

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.

@danielhanchen
danielhanchen merged commit e2ccf4d into unslothai:main Jul 24, 2026
30 of 38 checks passed
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.

[Bug] Chat can not be deleted from an iPad (popover can not be opened since there is no mouse over)

2 participants