Skip to content

fix(simulate): make the run viewer page-scrollable so long content fits short terminals#899

Merged
u9g merged 2 commits into
mainfrom
jason/simulate-tui-page-scroll
Jul 9, 2026
Merged

fix(simulate): make the run viewer page-scrollable so long content fits short terminals#899
u9g merged 2 commits into
mainfrom
jason/simulate-tui-page-scroll

Conversation

@u9g

@u9g u9g commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Problem

lk agent simulate / --view <run> rendered the run summary below the job list with no height budget. On short terminals (e.g. 31 rows) the view exceeded the screen and the header plus the top of the job list scrolled off — a 10-job run showed only jobs 7–10 at all times.

Replaces #898, which clamped just the summary; this makes the whole viewer scrollable instead.

Fix

Compose the full page (header, description, counts, full job list, summary, logs) and window it to the terminal height with ↑/↓ N more lines markers, keeping the toast and hint bar pinned at the bottom.

  • Mouse wheel and PgUp/PgDn scroll the page when no pane (detail, description, logs) has focus.
  • Arrow keys still move the job cursor, and the page auto-scrolls to keep the cursor row visible.
  • The job list's internal two-thirds-height window is gone — the full list renders and the page scrolls instead.
  • The hint bar advertises PgUp/PgDn scroll only when the page actually overflows.

Testing

New simulate_tui_layout_test.go reproduces the report: a 31×156 terminal with 10 jobs and a long summary fits in 31 rows anchored to the top (header + Scenario 1 visible, overflow advertised); scrolling reaches the bottom of the summary with the hint pinned; cursor movement pulls the cursor row into view; content that fits renders unwindowed. Full go test ./cmd/lk/ passes.

…ts short terminals

The list view rendered the run summary (and job list chrome) with no height
budget, so on short terminals (e.g. 31 rows) the view exceeded the screen and
the header plus the top of the job list scrolled off - a 10-job run showed
only jobs 7-10. Instead of clamping individual sections, compose the whole
page (header, description, counts, full job list, summary, logs) and window
it to the terminal height with overflow markers, keeping the toast and hint
bar pinned at the bottom.

- mouse wheel and PgUp/PgDn scroll the page when no pane (detail,
  description, logs) has focus
- arrow keys still move the job cursor; the page auto-scrolls to keep the
  cursor row visible
- the job list's internal two-thirds-height window is gone - the full list
  renders and the page scrolls instead
- the hint bar advertises PgUp/PgDn only when the page actually overflows
Comment thread cmd/lk/simulate_tui_layout_test.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this file, idk if it's useful for UI stuff

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@u9g u9g force-pushed the jason/simulate-tui-page-scroll branch from 8643775 to da510b4 Compare July 9, 2026 19:00
@u9g u9g merged commit 4c12dcd into main Jul 9, 2026
22 checks passed
@u9g u9g deleted the jason/simulate-tui-page-scroll branch July 9, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants