Repository navigation
Studio: keep the Bypass permissions pill label when composer pills collapse - #7231
Conversation
With 5 or more pills active the composer collapses every pill to an icon, which hid the Bypass permissions label behind a small glyph. Exempt the permission pill via data-keep-label so it always shows its label, with the collapsed icons lining up to its right. Since the pill is never icon-only now, drop the compact-mode fallthrough in the glyph off switch so it works while the other pills are collapsed.
There was a problem hiding this comment.
Code Review
This pull request updates the permission mode selector pill to retain its label in compact mode by adding the data-keep-label="true" attribute, which ensures the "off" switch remains clickable. It also simplifies the event handlers by removing the compact-mode checks. The review feedback points out that nesting an interactive element inside a native button (the dropdown trigger) violates HTML and accessibility standards, and suggests restructuring them as sibling buttons to avoid complex event propagation and focus issues.
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.
| <span | ||
| role="button" | ||
| aria-label="Turn off bypass permissions" | ||
| tabIndex={-1} | ||
| onPointerDown={(e) => { | ||
| if (e.currentTarget.closest('[data-pill-compact="true"]')) { | ||
| return; | ||
| } | ||
| e.stopPropagation(); | ||
| }} | ||
| onClick={(e) => { | ||
| if (e.currentTarget.closest('[data-pill-compact="true"]')) { | ||
| return; | ||
| } | ||
| e.stopPropagation(); | ||
| setPermissionMode("off"); | ||
| }} |
There was a problem hiding this comment.
Nesting an interactive element inside a native <button> (the DropdownMenuTrigger) is invalid HTML and violates accessibility standards. Instead of nesting the element and relying on complex pointerdown or click event propagation control, structure the element as a sibling button of the dropdown trigger. This allows native focus and clean interaction without breaking focus restoration mechanisms.
<div className="flex items-center">
<button
onClick={() => setPermissionMode("off")}
aria-label="Disable permission mode"
>
Off
</button>
<DropdownMenuTrigger>
{/* Trigger content */}
</DropdownMenuTrigger>
</div>
References
- Avoid calling e.preventDefault() on pointerdown for interactive elements that open dialogs. Instead, structure the element as a sibling button of the dropdown trigger to allow native focus without complex pointerdown handling.
There was a problem hiding this comment.
This mirrors the existing glyph off switch on the MCP and Knowledge Base pills, which use the same nested span inside the Radix DropdownMenuTrigger button. The span is tabIndex -1 so it never enters the tab order, and keyboard and screen reader users turn the feature off through the Off item inside the menu itself. Splitting the pill into sibling buttons would break the shared composer-pill-btn styling (hover, compact sizing, tooltip, X swap) that keys on a single trigger element, so if we restructure this it should be done for all three pills in a dedicated refactor rather than here.
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
…nslothai#7231) With 5 or more pills active the composer collapses every pill to an icon, which hid the Bypass permissions label behind a small glyph. Exempt the permission pill via data-keep-label so it always shows its label, with the collapsed icons lining up to its right. Since the pill is never icon-only now, drop the compact-mode fallthrough in the glyph off switch so it works while the other pills are collapsed.
What
When 5 or more options are active in the chat composer, every pill collapses into an icon-only button to cut clutter. That also shrank the Bypass permissions pill down to a small alert glyph, which is easy to miss for something that controls tool call approval.
This keeps the permission pill at full width with its label in compact mode. The pill already renders first among the toggles, right after the plus button, so the remaining collapsed icons line up to its right.
How
data-keep-labeltoPermissionModeComposerPill, the existing opt-out the Compare pill uses, so the compact CSS never strips its labelindex.cssto cover both keep-label pillsTesting
npm run buildpasses (tsc plus vite)