Skip to content

fix(simulate): keep the job list visible when the summary overflows short terminals#898

Closed
u9g wants to merge 1 commit into
mainfrom
jason/simulate-tui-summary-clamp
Closed

fix(simulate): keep the job list visible when the summary overflows short terminals#898
u9g wants to merge 1 commit into
mainfrom
jason/simulate-tui-summary-clamp

Conversation

@u9g

@u9g u9g commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Problem

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

Fix

  • Clamp the summary in the list view to the height remaining under the job list (accounting for the logs pane, toast, and hint bar), ending with a dim ↓ N more summary lines · press S to expand marker. The view now always fits the terminal, so the whole job list stays visible.
  • S toggles an expanded summary rendered in place of the job list, windowed and scrollable (arrows/PgUp/PgDn/mouse wheel), collapsed with S/esc/q — the same pattern as the job-detail and description views. Capital S avoids the existing s (save scenarios) binding.
  • The S binding and its hint-bar entry appear only when the summary was actually clamped (it stays available to collapse an expanded view).

Testing

New simulate_tui_layout_test.go reproduces the report: a 31×156 terminal with 10 jobs and a long summary must fit in 31 rows with the first and last scenarios visible; expanded mode fits, scrolls, and clamps scroll offsets; short summaries render unclamped with no S hint. Full go test ./cmd/lk/ passes.

…hort terminals

The list view appended the full run summary below the job list with no height
budget, so on short terminals (e.g. 31 rows) the rendered 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. Clamp the summary to the height remaining under the
list with a "press S to expand" marker, and add an expanded state (S to
toggle, arrows/PgUp/PgDn to scroll, esc/q to collapse) that shows the full
summary in place of the list, mirroring the detail/description patterns.
@u9g u9g force-pushed the jason/simulate-tui-summary-clamp branch from 5d24248 to c3f3ea9 Compare July 9, 2026 17:03
@u9g

u9g commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded — reworking this as whole-view scrolling instead of clamping the summary.

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.

1 participant