Repository navigation
fix(tui): space activity blocks with one blank row and one inner indent (Refs #797) - #798
Closed
agenteinstinct1-max wants to merge 3 commits into
Closed
agenteinstinct1-max wants to merge 3 commits into
agenteinstinct1-max wants to merge 3 commits into
Conversation
Expanded activity blocks were spaced by whatever each tool renderer happened to draw: sibling blocks touched each other, a one-line read row glued itself to the next header, and detail rows drifted between 2 and 3 columns (inline rows and nested reasoning at +3, a tool panel's content at +3 with its border at +0). Now the block owns the spacing: one blank terminal row between blocks, one blank row before its details, and a single two-column inner indent shared by every detail line. Blocks take a margin only when the block above does not already end with its own padding row (a tool panel), so a panel never doubles. Refs #799 Co-authored-by: arena-agent <[email protected]>
The regression test mounts the real session route and measures the rendered character frame: one blank row between blocks, one before a block's details, a single two-column inner indent, and the read-then-edit boundary that used to touch. It fails on the base tree for eight of ten cases. ACTIVITY_CAPTURE_DIR also records the frame text and its OpenTUI spans, which produced the two committed, fixture-only pixel captures (normal and narrow). Co-authored-by: arena-agent <[email protected]>
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
A long read argument wraps to a second line inside its row; the wrapped row still keeps one blank row above it, its wrapped text stays on the row's own text column, and the block boundary after its last line keeps one blank row. The case fails on the base tree and passes with the block spacing. Co-authored-by: arena-agent <[email protected]>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by free · Input: 59.2K · Output: 1.3K · Cached: 520.6K |
3 of 6 tasks
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.
Issue for this PR
Fixes #797
Type of change
What does this PR do?
Activity blocks in the session transcript were spaced by whatever each renderer happened to draw. In one expanded run,
Exploredsat straight under the row above it, a one-line→ Read src/app.pyrow touched the nextEditedheader, and detail rows drifted between two indent conventions: native tool rows and nested reasoning were three columns past the header, while a tool panel's content was three columns past it with its border on the header's own column.The block now owns the spacing:
The boundary is decided once, not twice. A block takes a
marginToponly when the block above does not already end with its own padding row: a tool panel registers itself when it renders, and that registration is what the next block reads. So a panel's own top/bottom padding row is the blank row above and below it, and the shared row is never drawn twice. The same rule keeps the first detail row under a header from touching it (a panel draws that row itself with its top padding; a native tool row asks for it explicitly), and a wrapped or single-line row still separates the next block.Labels, copy, icons, colours, durations, grouping and the click-to-expand action are untouched, and a single operation's output stays as compact as it was. Tool rows outside activity blocks are unchanged: the two-column indent and the panel offsets only apply inside an expanded block.
One checkpoint commit on this branch carries a
Refs #799trailer that was written before this issue existed; the issue for this PR is #797.How did you verify your code works?
At head
d52084ed982993f0516e42349b1172faef42027d:packages/tui/test/cli/tui/activity-padding.test.tsx: mounts the real<Session />route (mocked HTTP boundary only) at 140×40 and 80×24 and measures the rendered character frame — collapsed blocks, expanded blocks, a multi-line command panel, a wrapped detail row, a standaloneThought, and the read→Edited boundary. Against the base tree 9 of 11 cases fail; with this change 11 of 11 pass. (The two standalone-Thought cases are guards that already hold on the base.)bun run typecheckclean; oxlint reports no errors on the changed files; prettier clean on the new test file. The four skips are pre-existing.Screenshots / recordings
Sanitized captures of actual harness frames: the test writes the frame text and the renderer's own spans (fg/bg/attribute per cell), and the PNGs are rasterized from those spans with a local monospace renderer. They contain fixture data only — no private session, no user content — and are not mockups.
Checklist