Proposal: give a tab a git identity — one tab per worktree #41
oliviermattei
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Opening this as a discussion rather than an issue, because it changes what a tab
means, and that call is yours.
Terminology below: tab is the sidebar row that owns a pane tree, pane is
one terminal inside it.
Why I am asking for this
How I actually work: I open a workspace by opening a folder, because I am opening
a project to work in it. So the workspace is a repo, and the tab it starts with
sits on that repo's default branch. From there I open several panes — usually
four or five — because on one branch I want several agents running at once plus a
dev server. That part works well today.
What does not work is what happens when a second worktree enters the picture.
A checkout has exactly one active branch at a time, but nothing in the UI ties a
pane to the worktree it was opened in. Two panes on two different worktrees sit
side by side in the same tab, visually identical. I have already run a command
in the wrong worktree because of this. It is not a cosmetic problem — it is a
class of mistake the app currently makes easy.
My ideal shape is therefore: one tab per worktree, several panes inside it.
Switching worktree becomes switching tab, which is a deliberate gesture with a
visible target, instead of guessing which of five identical panes belongs where.
What I am proposing, in substance
Bind a tab to a git worktree of its workspace.
worktree/branch name, and the diffstat becomes meaningful again — it is per-tab,
not a workspace-wide constant. Every pane inside that tab is understood to live
in that worktree.
means wanting another tab, not another pane in this one.
goes with it, so the two never drift apart.
mandatory concept.
Something we discussed before that fits here: being able to split the window and
put two tabs side by side. With tabs carrying a worktree identity, that split
becomes the supported way to work on two branches at once — with a visual
separation that says which is which — instead of the accidental, unmarked mix I
get today inside a single tab.
Where this collides with the current code
Since
4f8c982(the tab level between the workspace and the layout), a tab ispurely a layout container: a title plus a pane tree. Nothing says what it is
working on. The same commit dropped the git branch and the diffstat from the rail,
with this rationale (
src-app/src/app/sidebar/mod.rs,render_workspace_meta_row):That reasoning holds for a workspace row: one workspace, one checkout, one
branch — the line is nearly constant, so it is mostly noise. It stops holding the
moment a tab has its own worktree, because then the branch is exactly what tells
two tabs apart, and the diffstat is exactly what tells me which one has work in
it.
Open questions
point at one that already exists? Owning it means removal semantics, and a
removed worktree with uncommitted work is destructive.
paneflow.json? Session schema v2 alreadypersists tabs, so a
worktreefield on the tab is the obvious spot, but thatis a schema change with a migration.
reopen the density question in general? (Related: an Appearance setting for
sidebar density, compact vs detailed, previewed the way theme presets already
are.)
being reviewed.
No code written for this — purely a design question, and it needs your call before
anything is built.
All reactions