Preserve focus after workspace transition invalidation#485
Conversation
📝 WalkthroughWalkthroughWorkspace transitions now support a separate callback for invalidated post-layout refreshes. Window navigation uses guarded focus logic for both callback paths, with an async runtime test covering invalidated transition behavior. ChangesWorkspace focus handoff
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant WindowActionHandler
participant LayoutRefreshController
participant WorkspaceLayout
participant TargetWindow
WindowActionHandler->>LayoutRefreshController: commitWorkspaceTransition with focusTarget callbacks
LayoutRefreshController->>WorkspaceLayout: invalidate during refresh
LayoutRefreshController->>WindowActionHandler: invoke invalidated post-layout callback
WindowActionHandler->>TargetWindow: verify workspace state and focus target
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thank you will look at this tomorrow and if all good will merge it |
|
Sorry will look at this tomorrow as tonight I'll be pushing a new release that targets one specific problem that is a bit risky and might break stuff, just wanted to let you know that I'm not ignoring and that I appreciate the PR and help |
Fixes #484.
Preserves the exact-window focus handoff when a workspace reveal invalidates its relayout, without allowing stale focus steals.
Reproduced across Chrome, VS Code, Spotify, ChatGPT, Safari, Mail, and iTerm2; regression tests, format, and lint pass.
Summary by CodeRabbit
Bug Fixes
Tests
Trace: https://gist.github.com/henry-p/a39baac2dc3ec8218436c058c854d2b8