Skip to content

Studio: open the Images and Audio workflows from the collapsed sidebar rail - #13731

Merged
danielhanchen merged 4 commits into
mainfrom
studio-rail-media-workflows
Oct 14, 2026
Merged

danielhanchen merged 4 commits into
mainfrom
studio-rail-media-workflows

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

With the sidebar collapsed to its icon rail, there was no way to reach the Images workflows other than Create. The workflow rows (Edit, Transform, Inpaint, Extend, Upscale, Reference) live under the Images row and are only drawn when the sidebar is expanded, and the Images page heading only names the active workflow. Clicking the rail icon opened Create, so a user who keeps the sidebar collapsed could not get to Edit at all. Audio had the same gap for its workflows.

This is the collapsed-rail counterpart of #13101, which fixed the same problem for an unpinned Images row in More.

Changes:

  • On the collapsed rail, hovering the Images or Audio icon opens a flyout listing every workflow, headed by the row name. ArrowRight on the focused icon opens it from the keyboard; arrow keys, Enter and Escape work as in the More menu.
  • Escape returns focus to the icon after a keyboard open; a click elsewhere keeps its own focus. ArrowRight on a menu already opened by hover moves focus into it.
  • Picking a workflow selects it and opens the page, through the same handler the expanded sidebar rows use. Workflows the loaded model cannot run are greyed out with the same hint as elsewhere.
  • Clicking the icon itself still just opens the page. The flyout takes the place of the label tooltip on those two icons, since it already shows the name.
  • Nothing changes on the expanded sidebar, the mobile sheet, or for rows that are disabled or still being checked.

Tests: tests/media-rail-workflows.test.ts (new; fails on main, passes here). tests/more-menu-separator-gap.test.ts now picks out the More menu by its ref, because it matched the first right-side menu in the file and the new flyout comes first. Full frontend suite: 12125 passed, 0 failed. tsc -b clean, and ESLint findings on app-sidebar.tsx are the same as on main.

Browser check on two isolated Studio installs (merge base vs this branch), sidebar collapsed, no model loaded:

Check main this PR
Hover the Images icon tooltip only, no menu menu with 7 workflows
Pick Edit from it not possible, page stays on Create images page heading reads Edit
ArrowRight on the focused icon nothing focus on the first workflow
Escape after that focus on the icon focus on the icon
Click into the prompt while the menu is open n/a focus stays in the prompt, menu closes
Click the icon itself opens Images opens Images

The same checks pass in Chromium, Firefox and WebKit.

Collapsed rail, pointer on the Images icon: main shows only the tooltip, this PR lists the workflows

After choosing Edit from the rail menu: main has no way to get there and stays on Create images, this PR opens Edit

Fixes #13655

@danielhanchen danielhanchen self-assigned this Oct 14, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T15:06:50.152937Z f8ffc46 Manual request
🔒 Security Review ⚠️ Failed 2026-10-14T13:55:55.635979Z bfbce18 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@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: bfbce18033

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

const setOpen = useCallback(
(next: boolean) => {
dismiss();
if (!next) setKeyboardOpen(false);

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 Preserve keyboard-open state until focus is restored

When a keyboard user opens this flyout with ArrowRight and dismisses it with Escape, Radix calls onOpenChange(false), and this line clears keyboardOpen before onCloseAutoFocus runs on the closed render. That callback then sees false, while also unconditionally preventing Radix's default focus restoration, so focus falls back to the document instead of the Images/Audio button and keyboard navigation cannot continue. Retain the keyboard-open origin in a ref until close autofocus completes, or restore focus before clearing it.

Useful? React with 👍 / 👎.

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.

Fixed in a441d1b: the keyboard origin is kept in a ref until close autofocus runs, and a press elsewhere clears it so that focus is not pulled back.

Comment on lines +1141 to +1144
<DropdownMenuTrigger asChild>
<span
aria-hidden
tabIndex={-1}

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 Expose flyout semantics on the focusable navigation row

In the collapsed sidebar, Radix attaches aria-haspopup, aria-expanded, aria-controls, and the menu's labelling relationship to this unfocusable, aria-hidden span rather than to the actual SidebarMenuButton. NavItem also removes that button's tooltip whenever a flyout is present, while its text child is hidden in icon mode, so assistive-technology users cannot identify the Images/Audio control or discover that ArrowRight opens a menu. Forward the trigger semantics and an accessible name to the real button instead of hiding the only Radix trigger.

Useful? React with 👍 / 👎.

@danielhanchen danielhanchen Oct 14, 2026 •

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.

Not a regression from this PR: on a collapsed rail the Images icon has no accessible name on main either (checked in Chromium on both builds: no button named Images in the sidebar's accessibility tree on either side), since every rail icon relies on the hover tooltip for its label. Giving all rail icons a name is a separate change. The button still opens the page, the menu carries an Images label, and the same workflows stay reachable from the expanded sidebar.

<DropdownMenuItem
key={tab.id}
disabled={!enabled(tab.id)}
title={enabled(tab.id) ? undefined : WORKFLOW_UNAVAILABLE}

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 Make disabled workflow hints reachable

When the loaded image model does not support a workflow, the explanation is placed only in this disabled item's native title. The shared DropdownMenuItem styles apply data-[disabled]:pointer-events-none, so the item can neither receive hover to display that title nor receive keyboard focus; users of the collapsed-rail flyout therefore see a greyed-out choice without the promised reason. Put the hint on a pointer-enabled wrapper or expose it through an accessible tooltip/description.

Useful? React with 👍 / 👎.

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.

Matches the existing More submenu on main (same disabled item and title); the greyed state is the signal and the expanded sidebar shows the same hint. Out of scope here.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@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: a441d1b977

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

if (event.key !== "ArrowRight") return;
event.preventDefault();
returnFocus.current = true;
setKeyboardOpen(true);

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 Focus an already-hovered flyout on ArrowRight

When hovering has already set hover.open to true, pressing ArrowRight only sets keyboardOpen; the combined open value remains true, so the content does not reopen and Radix's onOpenAutoFocus never runs. Focus consequently stays on the rail button and subsequent arrow/Enter keys cannot navigate the advertised workflow menu. As the existing More-menu handler does for an open hover preview, explicitly focus contentRef when ArrowRight promotes an already-open preview to keyboard-open.

Useful? React with 👍 / 👎.

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.

Fixed in f8ffc46: ArrowRight on an open hover preview now focuses its first enabled item, so the arrow keys, Enter and Escape work from there.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 14, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 14, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: f8ffc46602

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

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] UI did not transfer from Image Gen mode into Edit Mode (Qwen2.1)

1 participant