Skip to content

Studio: keep the Bypass permissions pill label when composer pills collapse - #7231

Merged
shimmyshimmer merged 1 commit into
mainfrom
studio/keep-permission-pill-label
Jul 19, 2026
Merged

shimmyshimmer merged 1 commit into
mainfrom
studio/keep-permission-pill-label

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

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

  • Added data-keep-label to PermissionModeComposerPill, the existing opt-out the Compare pill uses, so the compact CSS never strips its label
  • Removed the compact-mode fallthrough in the glyph off switch handlers. It existed because the icon-only pill had nothing else to click for opening the menu. The pill is never icon-only now, so hovering the icon shows the X and clicking it turns bypass permissions off, same as expanded mode
  • Updated the compact-mode comment in index.css to cover both keep-label pills

Testing

  • npm run build passes (tsc plus vite)
  • Verified the built bundle carries the new attribute and the served page picks it up
  • Applies to both the single chat composer and the compare composer, which share the pill component

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.

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

Comment on lines 290 to 300
<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");
}}

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

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

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

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 9c11009768

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

@shimmyshimmer
shimmyshimmer merged commit c2cf2b4 into main Jul 19, 2026
41 checks passed
@shimmyshimmer
shimmyshimmer deleted the studio/keep-permission-pill-label branch July 19, 2026 06:15
VectorCipher pushed a commit to VectorCipher/unsloth that referenced this pull request Jul 20, 2026
…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.
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.

1 participant