Skip to content

Add in-window companion pane for Files and Git#58

Merged
vaayne merged 8 commits intomainfrom
feat/tool-companion-pane
Apr 13, 2026
Merged

Add in-window companion pane for Files and Git#58
vaayne merged 8 commits intomainfrom
feat/tool-companion-pane

Conversation

@vaayne
Copy link
Copy Markdown
Owner

@vaayne vaayne commented Apr 13, 2026

Summary

  • replace separate Yazi/Lazygit tmux-window flows with a shared in-window companion pane on the right side
  • add toolbar buttons for Files, Git, Split Right, and Split Down
  • route Files/Git actions through the companion pane instead of opening separate tmux tool windows
  • simplify companion pane state handling by centralizing open/close transitions and removing the unused focused presentation mode
  • fix companion divider drag behavior, allow closing an open pane even after launch context disappears, and remove the artificial drag cap so the pane can expand to the available width

Testing

  • swift build

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +185 to +186
let availableRight = view.bounds.width - sidebarVisibleWidth - sidebarDividerVisibleWidth
let rawWidth = availableRight - x
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Sources/Mori/App/AppDelegate.swift Outdated
Comment on lines +1270 to +1273
guard let manager = workspaceManager,
let context = manager.companionToolLaunchContext() else {
NSSound.beep()
return
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vaayne vaayne changed the title Add companion tool pane for Files and Git Add in-window companion pane for Files and Git Apr 13, 2026
@vaayne vaayne merged commit 531c508 into main Apr 13, 2026
1 check passed
@vaayne vaayne deleted the feat/tool-companion-pane branch April 13, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant