Add in-window companion pane for Files and Git#58
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a079038775
ℹ️ 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 availableRight = view.bounds.width - sidebarVisibleWidth - sidebarDividerVisibleWidth | ||
| let rawWidth = availableRight - x |
There was a problem hiding this comment.
Compute companion drag width in root coordinates
Here x is measured in the root view’s coordinate space, but rawWidth is computed from availableRight, which has already subtracted the sidebar offsets. When the sidebar is visible (the default), this double-subtraction makes the companion width jump smaller than the cursor position and typically clamp to the minimum width, so the divider does not resize smoothly or accurately.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 9422b70. The companion drag width is now computed in root-view coordinates with rawWidth = view.bounds.width - x, while maxAllowed still uses the available width after the sidebar. That removes the double-subtraction when the sidebar is visible and makes the divider track the cursor correctly.
| guard let manager = workspaceManager, | ||
| let context = manager.companionToolLaunchContext() else { | ||
| NSSound.beep() | ||
| return |
There was a problem hiding this comment.
Allow toggles to close pane without launch context
This early guard returns before checking whether the currently visible tool should be closed. If the selected worktree is cleared while a companion pane is open (for example after removing the last worktree/project), Files/Git toolbar actions and shortcuts only beep and cannot close the already-open pane. The close-path check should run before requiring a launch context.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 9422b70. toggleCompanionTool(_:) now checks the close path before asking WorkspaceManager for a launch context, so an already-open focused companion pane can still be closed even after the selected worktree/context disappears.
Summary
Testing