Stabilize TUI refresh, scrolling, and responsive layout - #863
Stabilize TUI refresh, scrolling, and responsive layout#863ihearttokyo wants to merge 2 commits into
Conversation
Keep background refreshes from blanking or replacing the active Optimize view, and enforce a one-minute minimum refresh interval.\n\nRework the dashboard into a stable 3/2/1-column flow with left-aligned bars, justified metric columns, readable project headings, and a ten-row Daily Activity viewport.\n\nSynchronize resize state before Ink paints so breakpoint transitions do not leave stale frames, preserve content beyond 256 terminal columns, and cap the dashboard at the current data's renderable width. Add focused regression coverage and a submission statement documenting live Ghostty validation.
Submission noteCommit The practical result is stable navigation and predictable rendering: Optimize remains open during background work; enabled refreshes occur no more than once per minute; panels flow through 3/2/1 columns in source order; metric headings stay readable beside long project paths; and very wide terminals preserve a populated dashboard within the data-derived 256-column ceiling. Validation covered real CodeBurn data in Ghostty, including first-frame captures across the 135→134 and 90→89 breakpoints and populated frames through 342 columns. The focused 36-test dashboard suite, TypeScript compilation, CLI production bundle, Semgrep, co-author guard, Firstlook, and Windows package build are all green. |
Pin the interactive dashboard to a terminal-sized viewport and add line, page, home, and end navigation without sacrificing the alternate-screen resize protections. Preserve the viewport offset across background refreshes and ordinary rerenders while resetting cleanly for a new view or period. Give daily-history paging its own Space binding, render full model costs whenever the panel can hold them, and spell out the project session heading. Extend the responsive dashboard regressions across one-, two-, and three-column viewports and update the submission evidence.
|
Added the viewport follow-up in The alternate screen solved stale resize frames, but it also removed terminal scrollback. CodeBurn was still rendering the entire dashboard as one taller-than-terminal tree, which left the lower panels unreachable. The new root viewport clips the application to the live terminal height and owns a persistent vertical offset: arrows scroll by line, Page Up/Page Down by screen, and Home/End jump to the bounds. Refresh and resize rerenders retain that offset; actual navigation begins at the top. This follow-up also incorporates the visual corrections from the latest captures. The project heading now says Validation now covers scrolling at 80, 100, and 160 columns, position preservation across rerenders, a live 160-column PTY Page Down/Page Up path, 39 focused dashboard tests, TypeScript, the complete CLI and browser build, and patch hygiene. The PR description has been updated with the root cause, controls, evidence, and the remaining unrelated repository-suite failures. |
Summary
This change makes CodeBurn's interactive terminal dashboard stable during refreshes, scrollable at every supported layout, and predictable at every terminal width.
--refresh 0for fully static sessions.Why this was happening
Three terminal behaviors were interacting. A background reload could finish after the user entered Optimize and replace state belonging to the active view. Ink's resize hook could paint once with the previous column count before React received the new width. Finally, the alternate screen intentionally has no terminal scrollback, while the dashboard rendered a tree taller than the terminal without supplying its own viewport.
The result was a view that could disappear during refresh, briefly render the wrong column arrangement during resize, or expose no way to reach panels below the visible terminal rows.
What changed
Refresh and viewport stability
j/kline navigation and uses Shift+Space/Space for its own paging, avoiding a key conflict with application scrolling.Responsive rendering
cost,avg/s,session, andoverheadheadings.Resize correctness
User impact
Users can leave Optimize open while CodeBurn runs, scroll every dashboard panel in one-, two-, or three-column layouts, and keep their place through refreshes. Resizing produces an immediate ordered reflow. Wide windows retain a populated dashboard, long paths no longer consume metric headings, and costs remain legible when the available width can hold them.
Testing
npx tsc --noEmitnpm run build(CLI and browser dashboard)git diff --checkThe repository-wide run completed with 2,495 passing tests. It retains two unrelated Copilot parser failures, one unrelated durable-total parity failure, and 26 missing-
jsdomenvironment errors.