Repository navigation
fix(macos): focus the last-used workspace on Dock activation - #889
Merged
xintaofei merged 5 commits intoOct 9, 2026
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation matches the stated behavior and covers the key selection edge cases with tests.
0 open findings
What changed in this PR
Routes macOS Dock activation to the most recently used workspace instead of always opening the local window.
Changes:
- Selects the latest existing workspace while respecting restoration state.
- Reuses shared unminimize/show/focus behavior.
- Adds regression tests for MRU, hidden-local, and restoration cases.
| File | Description |
|---|---|
src-tauri/src/lib.rs |
Routes macOS Reopen events through workspace activation. |
src-tauri/src/commands/workspace_windows.rs |
Implements activation selection and tests. |
src-tauri/src/commands/windows.rs |
Exposes the shared focus helper internally. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
The setup comment claimed only the tray and explicit local-workspace actions bring a hidden `main` back, but a second launch and a `codeg://` link still do, and the Dock does once no other workspace is open or on its way back. The shared show-and-focus helper still routed Dock activation through `show_main_window`. The Reopen arm also lost the reason it ignores `has_visible_windows`: any auxiliary window makes it true while every workspace is hidden or minimized. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dock activation waits while a remote-only restore still has windows pending, and falls back to local once none are. No test covered the second half: narrowing the condition to `!restoring` passed every activation test. Closing the restored window before the restore finishes now has to reach the local workspace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`activate_workspace` said local is never shown while a remote-only launch is restoring. It is, once nothing is left pending; only windows still to be brought back make it wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
codeg work task |
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
Clicking the macOS Dock icon always brought forward the local main window, even when a remote workspace was the most recently used window. This could reveal the hidden local workspace while leaving the intended remote window minimized.
Validation
action_requiredwith zero jobs executed; CI validation is pending.Related work
Overlaps with the workspace-activation portion of #887. Companion changes: remote restoration and recovery and the local-workspace entry.