fix(ui): fill the review stream on first paint - #922
Conversation
File windowing treated an unmeasured scrollbox height as 0, so only the leading file plus one overscan neighbor mounted until the user scrolled. Use the estimated viewport height for that first paint and re-read once after layout.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR fills the initial nowrap review stream by using an estimated viewport height until OpenTUI publishes measured geometry.
Confidence Score: 4/5The implementation appears safe to merge, with the non-blocking requirement that the new UI behavior be covered through the repository’s prescribed Storybook and Chromatic workflow. The viewport fallback is limited to unmeasured startup geometry and is replaced by the measured height, while the only accepted concern is that one new UI test bypasses the required visual regression path. Files Needing Attention: src/ui/components/ui-components.test.tsx Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[DiffPane first render] --> B{Measured viewport height available?}
B -->|Yes| C[Use measured height]
B -->|No| D[Estimate renderer height minus screen top]
C --> E[Build file render window]
D --> E
D --> F[Read viewport again after one frame]
F --> C
Prompt To Fix All With AI### Issue 1
src/ui/components/ui-components.test.tsx:1361
**Traditional UI test bypasses Chromatic**
This adds DiffPane coverage through the traditional component-test harness instead of the required Storybook play test and Chromatic snapshot, leaving the visual first-paint behavior outside the repository's prescribed UI regression workflow.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(ui): fill the review stream on first..." | Re-trigger Greptile |
Problem
On startup, a nowrap review could leave the lower part of the diff pane blank until the user scrolled. File windowing treated an unmeasured OpenTUI scrollbox height as
0, so only the leading file plus one overscan neighbor mounted. Short files then failed to fill a tall first frame.Approach
0.resized/layout-changed.Non-goals: changing overscan, wrap-line windowing, or scroll/selection behavior after the viewport is measured.
Tests
bun run typecheckbun run lintbun test src/ui/lib/viewportTiming.test.ts src/ui/lib/fileRenderWindow.test.ts src/ui/components/panes/DiffPane.test.tsx src/ui/components/ui-components.test.tsxbun test test/pty/layout.test.ts -t "the first nowrap frame fills a tall viewport"Manual: reproduced on Linux in a Herdr pane (
hunk diff, ~80 rows, nowrap split). Installed 0.20.1 showed two files then blank; source with this change filled the stream.Platforms
Linux only for the manual check. PTY coverage is Unix-only.