Repository navigation
iOS: add terminal tab overview - #6370
austinywang wants to merge 43 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a Safari-style "All Tabs" terminal overview to the iOS app: a new SwiftUI full-screen cover presenting tab cards with text previews and a close affordance. The Mac host gains a ChangesTerminal Tab Overview Feature
Sequence Diagram(s)sequenceDiagram
rect rgba(70, 130, 180, 0.5)
note over WorkspaceDetailView,MobileShellComposite: All Tabs Overview Refresh
WorkspaceDetailView->>MobileShellComposite: .task(id: terminalOverviewRefreshKey)
MobileShellComposite->>MobileShellComposite: refreshTerminalOverviewPreviews(in: workspaceID)
loop per terminal
MobileShellComposite->>MacHost: mobile.terminal.replay
MacHost-->>MobileShellComposite: render-grid rows
MobileShellComposite->>MobileShellComposite: cache preview lines (if client still current)
end
MobileShellComposite-->>WorkspaceDetailView: terminalOverviewItems updated
end
rect rgba(180, 100, 60, 0.5)
note over WorkspaceDetailView,MacHost: Close Terminal (remote)
WorkspaceDetailView->>WorkspaceDetailContainer: onClose(terminalID)
WorkspaceDetailContainer->>MobileShellComposite: closeTerminal(id:in:)
MobileShellComposite->>MacHost: mobile.terminal.close
alt ≥2 terminals remain
MacHost-->>MobileShellComposite: updated workspaces list
MobileShellComposite->>MobileShellComposite: clear preview cache, applyRemoteWorkspaceList
else last terminal
MacHost-->>MobileShellComposite: error (protected)
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (3 errors, 1 warning)
✅ Passed checks (19 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/TerminalTabOverviewView.swift`:
- Around line 89-91: The String.localizedStringWithFormat call in the tab count
section uses the plural key mobile.terminal.overview.tabCount.many, which
diverges from the repository's ICU-style plural convention. Replace the .many
plural key with .other to align with the standard plural handling pattern used
throughout the repo (using .one and .other keys for ICU-style localization).
This ensures consistent plural handling across all supported locales.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e97fb8f2-714e-4ef7-9584-fad064cdb912
⛔ Files ignored due to path filters (1)
cmux-assets/issue-6347-ios-tab-overview/ios-simulator/2026-06-17Tfinal/tab-overview-grid.pngis excluded by!**/*.png
📒 Files selected for processing (17)
Packages/iOS/CmuxMobileRPC/Sources/CmuxMobileRPC/MobileCoreRPCClient.swiftPackages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite+TerminalOutputDelivery.swiftPackages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite+TerminalOverview.swiftPackages/iOS/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite.swiftPackages/iOS/CmuxMobileShell/Tests/CmuxMobileShellTests/MobileShellCompositePreviewTests.swiftPackages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/TerminalTabOverviewCard.swiftPackages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/TerminalTabOverviewItem.swiftPackages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/TerminalTabOverviewView.swiftPackages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/WorkspaceDetailContainer.swiftPackages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/WorkspaceDetailView.swiftPackages/iOS/CmuxMobileSupport/Sources/CmuxMobileSupport/UITestConfig.swiftResources/Localizable.xcstringsSources/Mobile/MobileHostService+Capabilities.swiftSources/Mobile/MobileHostService.swiftSources/TerminalController.swiftios/cmux/Resources/Localizable.xcstringsios/cmuxPackage/Sources/cmuxFeature/CMUXMobileRootScene.swift
👮 Files not reviewed due to content moderation or server errors (1)
- Sources/TerminalController.swift
Greptile SummaryThis PR adds an iOS Safari-style "All Tabs" terminal overview feature: a full-screen grid of preview cards with selection, per-tab close, a tab count, Done, and New Terminal actions. It also wires up
Confidence Score: 5/5Safe to merge — the terminal close path is correctly protected against the last-tab case on both sides, capability gating is end-to-end, and the can_close staleness signals are all wired and cleaned up. The Mac-side close handler properly short-circuits before calling the side-effectful mobileCloseSurfaceRecordingHistoryIfAllowed when only one terminal remains. The iOS generation counter correctly discards stale responses from concurrent close requests. The debug harness is correctly isolated to the Debug/ folder and guarded by #if DEBUG. Localization coverage matches the iOS catalog's two-locale surface. No logic gaps or data-race risks were found across the full diff. No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant iOS as iOS (MobileShellComposite)
participant Mac as Mac (TerminalController)
participant WS as Workspace
note over iOS: User opens All Tabs overview
iOS->>iOS: refreshTerminalOverviewPreviews()
iOS->>Mac: mobile.terminal.replay (per terminal)
Mac-->>iOS: renderGrid (full frame)
iOS->>iOS: cache terminalOverviewPreviewLinesByID
note over iOS: User taps close on a card
iOS->>Mac: mobile.terminal.close
Mac->>WS: canClosePanelWithoutPrompt()
alt close allowed
WS-->>Mac: true
Mac->>WS: mobileCloseSurfaceRecordingHistoryIfAllowed()
WS-->>Mac: panel closed
Mac->>Mac: clearMobileViewportReports()
Mac-->>iOS: MobileSyncWorkspaceListResponse
iOS->>iOS: applyRemoteWorkspaceList()
else close protected
WS-->>Mac: false
Mac-->>iOS: err protected
iOS->>iOS: refreshWorkspaces()
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant iOS as iOS (MobileShellComposite)
participant Mac as Mac (TerminalController)
participant WS as Workspace
note over iOS: User opens All Tabs overview
iOS->>iOS: refreshTerminalOverviewPreviews()
iOS->>Mac: mobile.terminal.replay (per terminal)
Mac-->>iOS: renderGrid (full frame)
iOS->>iOS: cache terminalOverviewPreviewLinesByID
note over iOS: User taps close on a card
iOS->>Mac: mobile.terminal.close
Mac->>WS: canClosePanelWithoutPrompt()
alt close allowed
WS-->>Mac: true
Mac->>WS: mobileCloseSurfaceRecordingHistoryIfAllowed()
WS-->>Mac: panel closed
Mac->>Mac: clearMobileViewportReports()
Mac-->>iOS: MobileSyncWorkspaceListResponse
iOS->>iOS: applyRemoteWorkspaceList()
else close protected
WS-->>Mac: false
Mac-->>iOS: err protected
iOS->>iOS: refreshWorkspaces()
end
Reviews (29): Last reviewed commit: "fix: use catalog plural for mobile tab c..." | Re-trigger Greptile |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Greptile P2 follow-up: I left the explicit workspace_id guard in v2MobileTerminalClose. The shared mobileWorkspaceIDValidationError helper rejects malformed non-null IDs; this guard handles missing/null workspace_id so close returns invalid_params instead of falling through to a not_found terminal response. |
…erview # Conflicts: # .github/swift-file-length-budget.tsv
Summary
Screenshot
Local path:
cmux-assets/issue-6347-ios-tab-overview/ios-simulator/2026-06-17Tfinal/tab-overview-grid.pngValidation
swift test --package-path Packages/iOS/CmuxMobileShell --filter MobileShellCompositePreviewTests(17 tests passed)CMUX_SKIP_ZIG_BUILD=1 ./ios/scripts/reload.sh --tag issue-6347-ios-tab-overviewjq empty ios/cmux/Resources/Localizable.xcstrings Resources/Localizable.xcstringsgit diff --checkLocalization Audit
ios/cmux/Resources/Localizable.xcstringsfor English and Japanese mobile UI strings.Resources/Localizable.xcstringsfor the close-protected host message across existing locales.Implements #6347.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Adds an iOS Safari‑style All Tabs overview with grid previews, quick selection, + New Terminal, Done, and per‑tab close. Keeps close controls accurate from the Mac, updates the nav‑title cap for the new overview button, and ships a DEBUG‑only preview shell for screenshots. Implements #6347.
New Features
mobile.terminal.replay, selection, tab count, Done, and + New Terminal.mobile.terminal.close; gated byterminal.close.v1and per‑terminalcan_closefrom the workspace list (hidden for last tab, pinned/confirm‑required/remote‑tmux, or when the Mac hides tab close).CMUX_UITEST_TERMINAL_OVERVIEW_PREVIEWmounts a connected preview shell and opens the overview for simulator screenshots (DEBUG‑only sources).Bug Fixes
can_closecurrent: observe pin changes, close‑policy (UserDefaults), and shell‑activity via async streams; iOS refreshes before opening the overview.nonisolated.Written for commit 5f7e36d. Summary will update on new commits.
Summary by CodeRabbit