fix(ui): fill the review stream on first paint (0.20.x) - #926
Open
benvinegar wants to merge 3 commits into
Open
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.\n\n(cherry picked from commit d570d2f)
(cherry picked from commit 408a1a3)
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThis backport estimates the initial review viewport, pre-renders edge-jump destinations, stabilizes viewport and cursor identities, and adds regression coverage.
Confidence Score: 3/5The PR should not merge until viewport measurement uses the actual OpenTUI event contract and edge jumps supersede pending selection-reveal retries. The initial geometry callback can be missed because it subscribes to an undocumented event name, and a recently scheduled hunk-reveal retry can override an explicit top or bottom jump. Files Needing Attention: src/ui/components/panes/DiffPane.tsx Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User
participant A as App
participant D as DiffPane
participant O as OpenTUI viewport
U->>A: G or gg
A->>D: scrollEdgeRequest
D->>D: Render destination rows
D->>O: scrollTo(edge)
O-->>D: Viewport geometry event
D->>D: Refresh windowed rows
Prompt To Fix All With AI### Issue 1
src/ui/components/panes/DiffPane.tsx:831
**Viewport resize event is misnamed**
When the scrollbox publishes its measured geometry, this listener waits for `resize` instead of OpenTUI's documented `resized` event, leaving `scrollViewport.height` at zero or stale and causing windowing to leave blank review rows until another scroll triggers a read.
```suggestion
scrollBox.viewport.on("resized", handleViewportResize);
```
### Issue 2
src/ui/components/panes/DiffPane.tsx:972-995
**Pending reveal overrides edge jumps**
When G or gg is pressed during the 120 ms selected-hunk settling period, this effect moves to the requested edge without cancelling the pending reveal; the later reveal observes the pinned-header change and scrolls back to the selected hunk, so the command lands at the wrong position.
---
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): stabilize viewport startup timi..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backports #922 onto the
0.20.xmaintenance branch.The runtime changes applied cleanly apart from
App.tsx, where the backport retains the 0.20.x transient-notice implementation. PTY conflicts were resolved against the maintenance branch test layout without bringing unrelated main-only coverage.Verification
bun run typecheckbun run lintbun run format:checkbun run deps:checkbun run test: both shards passed (1,547 + 1,510 tests)bun run test:integration: 130 passedbun run test:tty-smoke: 9 passedorigin/0.20.x, including first paint andGbun run changeset:status -- --since=origin/0.20.x: patch bump forhunkdiff