Repository navigation
feat: add a recent windows switcher on mod-tab - #264
Merged
Merged
Conversation
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — Adds a recent-window switcher and makes mod-tab and mod-shift-tab built-in shortcuts. Human review is required to accept the new default keyboard behavior. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
qeude
force-pushed
the
feat/recent-windows-switcher
branch
from
November 11, 2026 17:00
1ff429b to
acd9809
Compare
Like Command-Tab, but per window and across workspaces and monitors, after Niri's recent windows switcher. The focus history behind focus-window-previous becomes a persisted most-recent-first list; the switcher selects without focusing and confirms through focus-window-id on mod release, cancels on Escape, and draws nothing for a brief press.
The switcher draws in SwiftUI on the same glass and gradient as the cheat sheet, with system fonts and a selection that follows the appearance.
Pruning the list first made the switcher read as closed, so the teardown skipped resetting the Escape capture, the panel and the show task.
qeude
force-pushed
the
feat/recent-windows-switcher
branch
from
November 11, 2026 17:03
acd9809 to
12618bb
Compare
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
mod-tabopens a recent windows switcher, like Command-Tab but per window and across every workspace and monitor. It follows Niri'snext-window/previous-window: the panel appears only after 150 ms, so a brief press switches back without drawing anything.focus-window-idnow switches workspace only when the window's workspace is inactive, likefocus-window-previous, so a confirmed switch to a visible window scrolls instead of taking the workspace-switch path. It was only reachable from the CLI before this change..tertiaryselection that follows the appearance. Unlike the cheat sheet it does not fade in, like Command-Tab.tabis a new key name and keeps its physical key on every layout, like the navigation keys.recent-windows next|previous|confirm|cancel), cheat sheet row (⌃⌥⇥, Shift: backward), Settings action, CONFIGURATION.md, README permissions table, site cheat sheet.window_previews = falseshows the app icon; the panel shows without animation, so Reduce Motion needs nothing more; holdingmodwith the switcher open never opens the cheat sheet (a key press already blocks the hold, and any command dismisses it).Evidence
main,recent-windowsis an unknown command, and the history keeps one entry (currentandprevious).After:
make verifypasses onacd9809d, rebased onmain(build, Swift tests, workflow tests). New and extended tests:WindowFocusHistoryTests: MRU order, a closed window skipped, persistence round trip, old stores still decode; the switcher opens onpreviousFocusedWindowTarget(brief press ==focus-window-previous), steps and wraps both ways, and a closed window leaves the listHotKeyTests: releasing the modifier confirms, releasing Shift does not, Escape is taken only while the switcher is openDaemonCommandPolicyTests:focus-window-idactivates a workspace only when it is inactiveModelTests,CheatsheetHotKeyTestsDaemonRecentWindowsTests: when every listed window closes, the switcher tears down: the Escape capture, the panel and the show task. It failed before the fix.defi-e2eVM: four windows on two workspaces; hold ⌃⌥ with several Tabs and ⇧Tab, then release; two brief presses there and back; Escape. Real VNC keyboard input, Screen Recording granted. It is local to the maintainer's machine:dist/recent-windows-demo.mp4in this worktree.defi service restartin the VM:focus-window-previousreturned to the window focused before the restart.Not run: the two-display lane,
verify.sh desktop, and the Screen Recording-denied path on a real desktop (the icon fallback is in code only).Merge Danger
Door: two-way
The topology key changes from
windowFocusHistorytorecentWindowIDs; older stores decode and start with an empty history once. A rollback ignores the new key in the same way.Blast Radius: keyboard
mod-tabandmod-shift-tabbecome built-in shortcuts, and every hotkey delivery parses the command to arm the switcher.focus-window-idnow scrolls rather than switches for a window that is already visible.Proof: unit and daemon tests (
make verify) plus a VM recording of the installed build with real keyboard input.Reviewed with review-loop: 2 rounds with claude-opus-5-5 on medium. Verdict: approved
Note
Add a mod-Tab recent windows switcher with daemon, UI, and hotkey support
Command.recentWindowswithnext,previous,confirm, andcancelactions, parsed from CLI asrecent-windows <action>, with default bindings mod-Tab and mod-Shift-Tab.RecentWindowsSwitchertracks window IDs and selection; releasing the held modifier confirms the selected window viafocus-window-id, and Escape cancels.RecentWindowsControllerpresents a nonactivating panel with horizontally scrolling window cards, live previews (requires Screen Recording permission), and app icons.RuntimeState.windowFocusHistoryis replaced by arecentWindowIDsordered list.WorkspaceTopologysnapshots now store this array, and old stores without it decode with an empty list.acceleratorKeyKeepsNamein hotkey resolution and the shortcut recorder.focus-window-idonly reports workspace activation when the target workspace differs from the active one.Macroscope summarized 12618bb.