Repository navigation
Studio: open the Images and Audio workflows from the collapsed sidebar rail - #13731
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 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); |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| <DropdownMenuTrigger asChild> | ||
| <span | ||
| aria-hidden | ||
| tabIndex={-1} |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 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); |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 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". |
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:
Tests:
tests/media-rail-workflows.test.ts(new; fails on main, passes here).tests/more-menu-separator-gap.test.tsnow 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 -bclean, and ESLint findings onapp-sidebar.tsxare the same as on main.Browser check on two isolated Studio installs (merge base vs this branch), sidebar collapsed, no model loaded:
The same checks pass in Chromium, Firefox and WebKit.
Fixes #13655