tui: reserve the session row's disclosure and lineage gutter - #1158
Merged
Conversation
The hierarchy pass appended the children disclosure and the fork lineage mark as extra cells, so a project member that had a subagent or a fork rendered its title one column right of its childless siblings. Reserve both cells on every session row instead — a childless, unforked session paints spaces there — so nesting state changes the glyphs, not the geometry, and a child's status glyph again lands under its parent's title.
The gutter already guarantees a blank column between the tree rails and the status glyph on every row, so the glyph's own leading space was a third consecutive blank on a childless, unforked session. Drop it: each row reclaims a column, and a fork's mark now sits directly against its status dot.
With lineage in its own cell it sat beside the disclosure column and read as a second disclosure — a fork row and an archived-children row differed only by which small glyph followed the rails. Close the fork's branch corner with its mark instead of the plain connector: lineage becomes structure on the rail, the cell after the rails is unambiguously the disclosure, and the row spends no column on either.
Lineage rode the branch corner, which kept forks off the column the archived-children rows use and left a fork's mark two cells from its status glyph. Put the disclosure, the lineage mark, and the archived disclosure in the same reserved cell one step past identical rails: a fork reads '|-Y * Title' exactly as an archive reads '|-> N archived'. The disclosure wins the cell where a row could claim it twice, since it is the affordance the operator can act on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The hierarchy pass (#1156) appends the children disclosure (
▼/▶) and thefork lineage mark (
⑂) as extra cells after the tree rails. So twosessions at the same depth no longer share a left edge: the moment a session
grows a subagent or a fork, its own title jumps one column right of its
childless siblings'.
Before #1156 the indent helper subtracted a cell whenever the disclosure was
present, which is why a project's members lined up whether or not they had
nested sessions. That compensation was dropped when the indent became tree
rails.
Fix
Give every row hanging off the tree one shared marker column, one step
past identical rails, reserved whether or not it is used:
▼/▶disclosure⑂lineage mark▸/▾disclosureSo nesting state changes the glyph, never the geometry; a child's status
glyph lands under its parent's title again; and a fork row and an archived
row differ by their glyph rather than by their offset.
Where a session could claim the cell twice, the disclosure wins — it's the
affordance the operator can act on. No row is both today: the list gives forks
no disclosure, always rendering their descendants expanded. If that changes,
lineage needs a new home rather than a second reserved column, which the spec
and a code comment both now say.
Net width is unchanged from
main. The disclosure's click column stillfollows the rails, so hit-testing needed no update.
Screenshots
Top row is
main, bottom is this branch — same fleet, same terminal size.In the "before" half
Prepare Patch Release's status dot sits one column leftof
Session Statuses'; in the "after" half they align.Full frames
before:
after:
The demo uses forks at depth 0/1/2 because groups can't be created from the
CLI, but a project's members hit the identical shift — they're depth-1 rows
whose only difference is the reserved cell.
Tests
has-children/expanded combinations, glyphs and precedence included.
same parent carry the same rails and the same marker width — i.e. they share
the column rather than each choosing an offset.
cargo test --workspacegreen.Relevant binary:
construct(this PR only touchescrates/cli).