show recent sessions in the session switcher - #59
Conversation
Deploying remux with
|
| Latest commit: |
b548239
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2d606596.remux-agx.pages.dev |
| Branch Preview URL: | https://feature-recent-sessions-bott.remux-agx.pages.dev |
📝 WalkthroughWalkthroughThe session switcher now displays active sessions and recent workspaces. Users can resume recent sessions asynchronously. Workspace ordering is deterministic, and tests cover projection behavior, UI interactions, accessibility, and live SSH session transitions. ChangesSession Switcher
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
actor User
participant SessionSwitcherView
participant RootView
participant ConnectionLibrarySnapshot
User->>SessionSwitcherView: Open session switcher
SessionSwitcherView->>ConnectionLibrarySnapshot: Request recentWorkspaces(excluding:)
ConnectionLibrarySnapshot-->>SessionSwitcherView: Return sorted recent workspaces
User->>SessionSwitcherView: Select recent session
SessionSwitcherView->>RootView: Invoke resume callback
RootView->>RootView: Trace and connect asynchronously
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
Deploying getremux with
|
| Latest commit: |
b548239
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3317f921.getremux.pages.dev |
| Branch Preview URL: | https://feature-recent-sessions-bott.getremux.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Remux.xcodeproj/project.pbxproj (1)
11-33: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winRegenerate and commit the Xcode project.
CI reports that
xcodegen generatemodifiesRemux.xcodeproj. Update the XcodeGen source configuration for these renamed files, regenerate the project, and commit the complete generated diff.🤖 Prompt for 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. In `@Remux.xcodeproj/project.pbxproj` around lines 11 - 33, Update the XcodeGen source configuration entries for the renamed files represented by the PBXBuildFile references, then run xcodegen generate to refresh Remux.xcodeproj. Include and commit the complete regenerated project diff, ensuring the generated file and reference mappings match the source configuration.Source: Pipeline failures
🤖 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 `@RemuxAppUITests/RemuxAppUITests.swift`:
- Around line 680-683: Update the multi-session test around
generatedLiveLatencySessionName so its eight session names remain unique when
REMUX_LIVE_SESSION_NAME_OVERRIDE is configured. Bypass the override for this
test's generated names, or skip the test when the override is present; ensure
row queries and disconnectActiveSessionFromSwitcher continue targeting distinct
sessions.
---
Outside diff comments:
In `@Remux.xcodeproj/project.pbxproj`:
- Around line 11-33: Update the XcodeGen source configuration entries for the
renamed files represented by the PBXBuildFile references, then run xcodegen
generate to refresh Remux.xcodeproj. Include and commit the complete regenerated
project diff, ensuring the generated file and reference mappings match the
source configuration.
🪄 Autofix
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 0cd3e645-e6f4-42b1-9d27-268ab29cb923
📒 Files selected for processing (9)
Remux.xcodeproj/project.pbxprojRemuxApp/Sources/App/RootView.swiftRemuxApp/Sources/App/SessionSwitcherView.swiftRemuxApp/Sources/Ghostty/GhosttyKeyboardChrome.swiftRemuxApp/Sources/Ghostty/TerminalSelectionSheetStyle.swiftRemuxApp/Sources/Persistence/ConnectionProfileRepository.swiftRemuxAppTests/ActiveSessionSwitcherProjectionTests.swiftRemuxAppTests/SessionSwitcherProjectionTests.swiftRemuxAppUITests/RemuxAppUITests.swift
💤 Files with no reviewable changes (1)
- RemuxAppTests/ActiveSessionSwitcherProjectionTests.swift
| let primarySessionName = try generatedLiveLatencySessionName("switcher-primary") | ||
| let laterSessionNames = try (1...7).map { index in | ||
| try generatedLiveLatencySessionName("switcher-\(index)") | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Generate unique session names when an override is configured.
Lines 680-683 call generatedLiveLatencySessionName eight times. That helper returns the same REMUX_LIVE_SESSION_NAME_OVERRIDE value for every call. The row queries then match duplicate labels, and disconnectActiveSessionFromSwitcher can disconnect a different session.
Generate unique names for this test without applying the override, or skip this multi-session test when the override is set.
🤖 Prompt for 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.
In `@RemuxAppUITests/RemuxAppUITests.swift` around lines 680 - 683, Update the
multi-session test around generatedLiveLatencySessionName so its eight session
names remain unique when REMUX_LIVE_SESSION_NAME_OVERRIDE is configured. Bypass
the override for this test's generated names, or skip the test when the override
is present; ensure row queries and disconnectActiveSessionFromSwitcher continue
targeting distinct sessions.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b548239914
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let laterSessionNames = try (1...7).map { index in | ||
| try generatedLiveLatencySessionName("switcher-\(index)") | ||
| } |
There was a problem hiding this comment.
Generate distinct session names when an override is active
When REMUX_LIVE_SESSION_NAME_OVERRIDE (or its fallback file) is configured, every call to generatedLiveLatencySessionName returns that same override, so primarySessionName and all seven entries created here are identical. The test then repeatedly opens the same tmux session and uses non-unique labels to select and disconnect rows, meaning it can fail or validate the wrong session in supported live-harness runs that provide an override; derive unique suffixes for this multi-session test or bypass the single-session override.
Useful? React with 👍 / 👎.
Summary
Design
The implementation keeps ownership boundaries explicit:
activeSessionsremains the source of truth for live runtime sessions.ConnectionLibrarySnapshotremains the source of truth for saved sessions.SessionSwitcherProjectionis a value-only presentation projection.ConnectionLibrarySnapshotand reused by the library and switcher.RemuxRootModel.connect(to:)path.The sheet’s existing material, palette, tint, and terminal chrome presentation are unchanged. Presentation changes are limited to detents, the drag indicator, and resize-first interaction.
Validation
RemuxUIOnlybuild-for-testing passed.Summary by CodeRabbit
New Features
Bug Fixes