Reclaim the tmux viewport during active Remux use - #62
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change adds active tmux viewport claim and reclaim operations. Claims propagate through viewport sizing, input, navigation, mutation, and selection commands. Lifecycle and selection events reclaim or claim the viewport. Tests cover ordering, deduplication, stale replies, resizing, and cleanup. ChangesActive viewport ownership
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant RemuxRootModel
participant GhosttySurfaceScreen
participant TmuxTerminalScreenAdapter
participant TmuxSessionController
participant tmux
RemuxRootModel->>TmuxTerminalScreenAdapter: reclaimActiveTmuxViewport()
GhosttySurfaceScreen->>TmuxTerminalScreenAdapter: prepareInitialViewport(..., claimActiveViewport)
TmuxTerminalScreenAdapter->>TmuxSessionController: setClientSize(..., claimActiveViewport)
TmuxSessionController->>tmux: refresh-client and select-window
tmux-->>TmuxSessionController: topology update
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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: |
eb39225
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a0360869.getremux.pages.dev |
| Branch Preview URL: | https://fix-client-viewport-claim.getremux.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3edd1220af
ℹ️ 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".
| _ size: TmuxSessionController.ClientSize, | ||
| claimActiveViewport: Bool = false | ||
| ) -> Bool { | ||
| guard !stopped, let controller = session?.controller else { return false } | ||
| guard size != lastSubmittedClientSize else { return false } |
There was a problem hiding this comment.
Honor same-size viewport claims
When an active viewport observation resolves to the previously submitted grid, this guard drops claimActiveViewport before it reaches the controller. For example, if another tmux client has enlarged the active window and a Remux geometry update does not cross a cell boundary, prepareInitialViewport(..., claimActiveViewport: true) returns here and the window remains at the other client's size until some later input or topology action triggers a claim. Forward the request when claimActiveViewport is true even if no refresh-client size change is required; setClientSize now explicitly supports that same-size claim path.
Useful? React with 👍 / 👎.
Deploying remux with
|
| Latest commit: |
eb39225
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://512583af.remux-agx.pages.dev |
| Branch Preview URL: | https://fix-client-viewport-claim.remux-agx.pages.dev |
Summary
Testing
Summary by CodeRabbit
Bug Fixes
Tests