Repository navigation
Studio: quick eject from the model selector - #6654
Conversation
Add a one-click eject shortcut to the loaded-model pill so users do not have to open the picker to unload a model. - The loaded-status indicator shows a green checkmark at rest and swaps to a red eject icon on pill hover, with an "Eject model" tooltip. Clicking it ejects without opening the picker. - On Device tab now uses the placeholder "Search local models" instead of "Search Unsloth models". - The picker's "Eject model" button uses medium font weight.
There was a problem hiding this comment.
Code Review
This pull request introduces an eject model feature to the model selector UI, allowing users to eject a loaded model directly from the trigger. It also refines the search placeholder in the hub model picker based on the active section and adds font styling to the picker's eject button. However, the review points out an issue where an interactive span (acting as a button) is nested inside a native <button> element, which violates the HTML specification and can cause accessibility 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" | ||
| tabIndex={0} | ||
| aria-label="Eject model" | ||
| data-eject-hit={true} |
There was a problem hiding this comment.
Nesting an interactive element (the span with role="button" and tabIndex={0}) inside a native <button> element (the outer trigger on line 168) is invalid HTML according to the HTML specification. A <button> must not contain any interactive content descendants. This can cause unexpected behavior in screen readers and keyboard navigation.
To resolve this, consider refactoring the outer <button> on line 168 to a <div> with role="button" and tabIndex={0} (and updating the closing tag on line 272 to </div>), or restructuring the layout so that the eject button is a sibling of the popover trigger rather than nested inside it. If you use role="button" on a non-interactive element like <div>, remember to also add an onKeyDown handler for Enter and Space keys to ensure full keyboard accessibility.
References
- When using role='button' on non-interactive elements, ensure accessibility by adding an onKeyDown handler for Enter and Space keys and setting tabIndex={0} to make the element focusable.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79c43684b0
ℹ️ 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".
| <span | ||
| role="button" | ||
| tabIndex={0} |
There was a problem hiding this comment.
Keep the eject control out of the trigger button
When a model is loaded and onEject is passed, this creates a focusable role="button"/tabIndex control inside the popover trigger's outer <button>. HTML buttons cannot contain focusable descendants, so browsers and assistive tech may expose the selector/eject affordances inconsistently for keyboard and screen-reader users; please split the trigger and eject affordance into sibling controls or make the outer trigger a non-button wrapper instead of nesting this control.
Useful? React with 👍 / 👎.
The eject shortcut was a focusable span (role/tabIndex) nested inside the trigger button. A button's content model forbids focusable descendants, so make it a plain decorative span (aria-hidden, no role/tabIndex) that keeps the mouse shortcut. Keyboard and screen-reader users eject via the picker's "Eject model" button.
|
Thanks for the review. Both notes flagged the same valid issue: the inline eject control was a focusable span (role plus tabIndex) nested inside the trigger button, which a button's content model does not allow. Fixed in 2a38b1b. The eject control is now a plain decorative span (aria-hidden, no role or tabIndex), so the trigger button has no focusable or interactive descendants. The mouse shortcut still works, and keyboard and screen-reader users eject via the picker's "Eject model" button, which is fully accessible. Verified across Chromium, Firefox and WebKit with Playwright: the trigger has zero focusable/interactive descendants, the control is not in the tab order, clicking it ejects without opening the picker, and the hover icon swap and pill-hover behavior are unchanged. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a38b1bdab
ℹ️ 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".
| <HugeiconsIcon | ||
| icon={RemoveCircleIcon} | ||
| strokeWidth={1.75} | ||
| className="hidden size-3.5 text-red-500 group-hover/trigger:block" |
There was a problem hiding this comment.
Expose the eject affordance before accepting taps
On touch/mobile layouts this shortcut is still clickable, but the destructive icon is only revealed by group-hover/trigger; before the tap users see the green checkmark status icon and no native title tooltip, so tapping the left side of the selector can unload the model instead of opening the picker with no visible eject affordance. Consider disabling this inline shortcut on non-hover pointers or showing an explicit eject icon/label before it can fire.
Useful? React with 👍 / 👎.
On touch (no hover) the red eject icon and title tooltip never reveal, so tapping the loaded pill could unload the model with no visible affordance. Add [@media(hover:none)]:pointer-events-none so taps fall through to the trigger and open the picker; touch users eject from the picker instead.
|
Good catch on the touch behavior. Confirmed it was a real footgun: on a no-hover device the red eject icon and title tooltip never reveal, yet a tap on the left of the pill still unloaded the model. Fixed in 71c1d42 by adding [@media(hover:none)]:pointer-events-none to the inline control. On touch (no hover) the control ignores pointer events, so taps fall through to the trigger and open the picker; touch users eject from the picker's "Eject model" button. Hover-capable devices keep the shortcut unchanged. Verified with Playwright on Chromium, Firefox and WebKit: with hasTouch the context reports hover:none, the control computes pointer-events:none, and tapping it opens the picker with zero ejects; on hover contexts pointer-events stays auto and click still ejects. |
Sync 59 upstream commits. Resolve the lone pickers.tsx conflict by fully adopting upstream quick-eject (unslothai#6654) into the refactored picker: thread onEject + RemoveCircleIcon + floating pill through HubModelPicker, wire it from model-selector, and guard the footer eject button to non-hub tabs so the hub tab shows only the pill.
Summary
Adds a one-click eject shortcut to the loaded-model pill in Studio's model selector, so you no longer need to open the picker and scroll to the "Eject model" button just to unload the current model.
What changed
Notes
The existing "Eject model" entries inside the picker are kept as-is. The pill shortcut is an addition, and the in-picker button remains the discoverable path.