Skip to content

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
dev-vibecodedfrom
arena/cf91f1be-silvercode
Closed

agenteinstinct1-max wants to merge 3 commits into
dev-vibecodedfrom
arena/cf91f1be-silvercode

Conversation

@agenteinstinct1-max

@agenteinstinct1-max agenteinstinct1-max commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Issue for this PR

Fixes #797

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Activity blocks in the session transcript were spaced by whatever each renderer happened to draw. In one expanded run, Explored sat straight under the row above it, a one-line → Read src/app.py row touched the next Edited header, 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:

  • one blank terminal row between blocks;
  • one blank row before an expanded block's details;
  • one two-column inner indent shared by every detail line, with the tool panel keeping its left border on the header column and putting its content on the detail column.

The boundary is decided once, not twice. A block takes a marginTop only 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 #799 trailer that was written before this issue existed; the issue for this PR is #797.

How did you verify your code works?

At head d52084ed982993f0516e42349b1172faef42027d:

  • New route test 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 standalone Thought, 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.)
  • Full TUI suite at this head: 797 passed, 4 skipped, 0 failed (108 files, 3639 assertions); bun run typecheck clean; oxlint reports no errors on the changed files; prettier clean on the new test file. The four skips are pre-existing.
  • The existing activity, thinking, layout-state, inline-tool-wrap and review tests pass unmodified, so previously accepted behaviour on this screen is preserved.

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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Arena Agent and others added 2 commits November 1, 2026 23:59
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]>
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

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]>
@kilo-code-bot

kilo-code-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/tui/src/routes/session/index.tsx
  • packages/tui/test/cli/tui/activity-padding.test.tsx

Reviewed by free · Input: 59.2K · Output: 1.3K · Cached: 520.6K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant