Repository navigation
Add focus and Recently Closed history - #4160
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughAdds a focus and recently-closed history subsystem, History pane/menu UI, TabManager/AppDelegate recording and restore wiring, titlebar/shortcut/hint refactors and debug tooling, sidebar minimum-width persistence, icon/context-menu image normalization, extensive tests, and localization updates. ChangesHistory & Titlebar Integration
Sequence Diagram(s) sequenceDiagram
participant User
participant HistoryPanel
participant AppDelegate
participant ClosedItemHistoryStore
participant TabManager
User->>HistoryPanel: open/clear/reopen action
HistoryPanel->>AppDelegate: request reopen / open pane
AppDelegate->>ClosedItemHistoryStore: restoreFirstRestorable(...)
ClosedItemHistoryStore-->>AppDelegate: restored entry / failure
AppDelegate->>TabManager: restore panel/workspace/window / remap ids
TabManager-->>AppDelegate: remapped ids / success
Estimated code review effort 🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
Greptile SummaryThis PR adds a full History experience to cmux: a right-sidebar
Confidence Score: 4/5Safe to merge with awareness of the known unrestorable-panel-entry edge case in the closed history queue. The restore logic for workspaces and windows has been substantially hardened with content-validation guards and the previously-reported duplicate-menu and hollow-window-restore issues are addressed. New findings in this review are style-level (file boundary). The focus and closed history flows are complex and touch window/workspace lifecycle, which warrants a careful look at the remaining edge case where closing the last panel in a workspace leaves a panel history entry whose workspace no longer exists — every Cmd+Shift+T press against that entry will silently fail and re-queue, giving the user a beep with no path to recover or dismiss that record. Sources/TabManager.swift and Sources/Update/UpdateTitlebarAccessory.swift are both significantly over the 800-line threshold and received the largest additions in this PR; the panel-history orphan path is inside TabManager. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant AppDelegate
participant Store as ClosedItemHistoryStore
participant TM as TabManager
User->>AppDelegate: Cmd+Shift+T
AppDelegate->>Store: restoreFirstRestorable(newerThan:excluding:)
Store-->>AppDelegate: candidate entry
alt panel entry
AppDelegate->>TM: restoreClosedPanel(entry)
TM-->>AppDelegate: true or false
alt success
AppDelegate->>Store: remove record
else workspace gone
AppDelegate->>Store: onFailure — record stays queued
end
else workspace entry
AppDelegate->>TM: restoreClosedWorkspace(entry)
TM-->>AppDelegate: true or false
alt panels restored
AppDelegate->>Store: remove record
else no panels after restore
TM->>TM: closeWorkspace(recordHistory:false)
AppDelegate->>Store: onFailure — record stays queued
end
else window entry
AppDelegate->>AppDelegate: createMainWindow
AppDelegate->>AppDelegate: ClosedWindowRestoreValidation.hasUsableRestoredContent
alt valid content
AppDelegate->>Store: remove record
else hollow restore
AppDelegate->>AppDelegate: discardMainWindowWithoutClosedHistory
AppDelegate->>Store: onFailure — record stays queued
end
end
Reviews (72): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
cd42e62 to
663835c
Compare
663835c to
0f8712f
Compare
0f8712f to
b178443
Compare
d154d9c to
91814b0
Compare
b178443 to
84700e6
Compare
91814b0 to
0d91098
Compare
84700e6 to
0ca81ce
Compare
0d91098 to
5c47853
Compare
0ca81ce to
f5635b2
Compare
…dow-history # Conflicts: # cmuxTests/TerminalControllerSocketSecurityTests.swift
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
…dow-history # Conflicts: # Sources/Update/UpdateTitlebarAccessory.swift
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ae78f6d. Configure here.

Summary
This PR targets
maindirectly and supersedes #4098.Verification
xcodebuild -project cmux.xcodeproj -scheme cmux-unit -configuration Debug -destination 'platform=macOS,arch=arm64' -derivedDataPath /tmp/cmux-header-chrome-match-tests -resultBundlePath /tmp/cmux-header-chrome-match-tests.xcresult -only-testing:cmuxTests/AppDelegateShortcutRoutingTests/testRightSidebarHeaderChromeUsesSharedButtonsWithCompactIcons -only-testing:cmuxTests/AppDelegateShortcutRoutingTests/testRightSidebarPillChromeUsesHeaderIconColorAndWeight testgit diff --check./scripts/reload.sh --tag histplus/tmp/cmux-histstack/tmp/cmux-histpane-final6Demo
/tmp/cloud-histpane-after-reopen-history/screenshot.png/tmp/cloud-mac-histpane-history-alpha-filter-menu-demo/recording.mov/tmp/cloud-mac-histpane-history-menu-open-demo/recording.mov/tmp/cloud-mac-histpane-history-search-demo/recording.movSummary by CodeRabbit
New Features
Improvements
Tests
Localization
Note
Medium Risk
Touches window close/restore, session snapshots, and focus routing across TabManager and AppDelegate; regressions could affect layout restore or accidental history entries, but changes are largely user-facing navigation with explicit suppression for internal closes.
Overview
Adds focus history (back/forward via shortcuts, titlebar controls, and History menus) and a unified Recently Closed stack for closed tabs, workspaces, and windows, with Cmd+Shift+T reopening the latest closed item and per-row restore from the full History right-sidebar pane (search, day groups, clear closed).
Window and workspace teardown now records closed-window snapshots unless history is suppressed (session restore, moves, failed restores re-queue entries). Restore Previous App Launch replaces “Reopen Previous Session” in menus and the palette. Right sidebar gains a History mode; chrome tweaks include configurable sidebar minimum width, titlebar layout debug strings, richer config context-menu icons, and shared right-sidebar control metrics.
CI tests job timeout increases from 45 to 75 minutes.
Reviewed by Cursor Bugbot for commit e6dce82. Bugbot is set up for automated code reviews on this repo. Configure here.