Repository navigation
fix(studio): return focus after schedule edits and scope the filter shortcut - #2316
Merged
Merged
Conversation
peppescg
approved these changes
Oct 15, 2026
peppescg
left a comment
Contributor
There was a problem hiding this comment.
Thanks Daniel. Passing the trigger as the opener and gating the / registration on whether the search box is rendered are both clean fixes, and the defaultPrevented assertions are a good way around Radix's focus trap.
Nits:
apps/web/src/features/schedules/schedules-workspace.tsx:168:closeEditorfocuses the opener without checking it's still in the DOM, so focus falls back to<body>when creating the first schedule from the empty state (the empty-state button unmounts), or when a save moves the row out of the active filter (e.g. enabling a schedule while "Paused" is selected). Fall back to the "Schedule task" button or the page heading when!editorOpener.current?.isConnected.
kantord
force-pushed
the
studio-followups/06-schedules-focus-shortcuts
branch
4 times, most recently
from
October 15, 2026 09:29
32425fc to
876ec2f
Compare
Base automatically changed from
studio-followups/05-schedules-refresh
to
main
October 15, 2026 12:25
…hortcut Edit from a row menu now returns focus to the row's Actions button (the menu item is gone), and the detail page returns it to its actions menu after cancel or save. The schedule form and delete confirmations suppress global shortcuts while open, and useShortcut takes an enabled flag so `/` is not swallowed while the schedule list is loading or empty. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
kantord
force-pushed
the
studio-followups/06-schedules-focus-shortcuts
branch
from
October 15, 2026 12:25
876ec2f to
c9bc784
Compare
Merged
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Edit from a row menu lost focus to the body, the detail page never restored it, and
/was swallowed in dialogs and in loading or empty states.Part of #2303 ("Tiny follow-up fixes"); it does not close it. This is PR 6 of 14 in a stack of draft PRs, reviewed and merged in order.
What changed
closeEditor()(cancel and successful save) that refocuses the actions menu.useShortcut(id, handler, enabled = true)skips registration when disabled; the workspace enablesschedules.filteronly for a supported, non-empty list.useShortcutSuppressionis used inScheduleForm(mounted only while open) and for both pages' delete dialogs. The shared Dialog and AlertDialog primitives are untouched.Behavior changes
Focus returns to the row's Actions button or the detail actions menu after the edit dialog closes.
/is no longer prevented while loading, empty, or in a schedule dialog. Suppression also blocks other global shortcuts (mod+k, ?) while a schedule dialog is open, like the chat modals.Screenshots
Before is the parent branch (#2315), after is this PR, with the same keyboard steps and offline mock data: open the actions menu from the keyboard, choose Edit, press Escape.
No focus ring anywhere (
document.activeElementisBODY).Focus ring on the row's Actions button (
BUTTON, "Actions for daily-report").No focus ring (
BODY).Focus ring on the Actions button ("Actions for daily-report").
The
/fix has no screenshot pair: Radix keeps focus inside an open dialog even before the fix, so the search box never visibly takes focus. The tests assert that the keystroke is no longer claimed (defaultPrevented === false) while a schedule dialog is open and while the list is loading or empty.Verification
Biome, typecheck, the full Studio test suite and
pnpm generated:checkpass on this branch, run on the assembled stack. The full Playwright suite passes on the stack tip (122 passed, 30 skipped, 0 failed, includingchat-approvalagainst a realmecatedbuild). Six new tests fail without the fix. Two workspace dialog tests assertdefaultPrevented === falseon/with Cancel focused (a plainactiveElementassertion was vacuous because Radix pulls focus into the dialog). The detail page has no/shortcut of its own, so its test registers a probe shortcut.Not included
The BFF outcome change.
Fully or partially written by an AI agent.
🤖 Generated with Claude Code