core-agent-ide/codex-rs/tui2
Josh McKinney f074e5706b
refactor(tui2): make transcript line metadata explicit (#8089)
This is a pure refactor only change.

Replace the flattened transcript line metadata from `Option<(usize,
usize)>` to an explicit
`TranscriptLineMeta::{CellLine { cell_index, line_in_cell }, Spacer}`
enum.

This makes spacer rows unambiguous, removes “tuple semantics” from call
sites, and keeps the
scroll anchoring model clearer and aligned with the viewport/history
design notes.

Changes:
- Introduce `TranscriptLineMeta` and update `TranscriptScroll` helpers
to consume it.
- Update `App::build_transcript_lines` and downstream consumers
(scrolling, row classification, ANSI rendering).
- Refresh scrolling module docs to describe anchors + spacer semantics
in context.
- Add tests and docs about the behavior

Tests:
- just fmt
- cargo test -p codex-tui2 tui::scrolling

Manual testing:
- Scroll the inline transcript with mouse wheel + PgUp/PgDn/Home/End,
then resize the terminal while staying scrolled up; verify the same
anchored content stays in view and you don’t jump to bottom
unexpectedly.
- Create a gap case (multiple non-continuation cells) and scroll so a
blank spacer row is at/near the top; verify scrolling doesn’t get stuck
on spacers and still anchors to nearby real lines.
- Start a selection while the assistant is streaming; verify the view
stops auto-following, the selection stays on the intended content, and
subsequent scrolling still behaves normally.
- Exit the TUI and confirm scrollback rendering still styles user rows
as blocks (background padding) and non-user rows as expected.
2025-12-16 05:27:47 +00:00
..
docs WIP: Rework TUI viewport, history printing, and selection/copy (#7601) 2025-12-15 17:20:53 -08:00
frames feat(tui2): copy tui crate and normalize snapshots (#7833) 2025-12-10 22:53:46 +00:00
src refactor(tui2): make transcript line metadata explicit (#8089) 2025-12-16 05:27:47 +00:00
tests Sync tui2 with tui and keep dual-run glue (#7965) 2025-12-12 20:46:18 -08:00
Cargo.toml WIP: Rework TUI viewport, history printing, and selection/copy (#7601) 2025-12-15 17:20:53 -08:00
prompt_for_init_command.md feat(tui2): copy tui crate and normalize snapshots (#7833) 2025-12-10 22:53:46 +00:00
styles.md Sync tui2 with tui and keep dual-run glue (#7965) 2025-12-12 20:46:18 -08:00
tooltips.txt chore: fix tooltip typos and align tone (#8047) 2025-12-14 20:02:41 -08:00