perf(ui): keep wrapped large diffs responsive - #607
Conversation
|
@mplibunao is attempting to deploy a commit to the Modem Team on Vercel. A member of the Team first needs to authorize it. |
|
PR author is not in the allowed authors list. |
There was a problem hiding this comment.
Thanks for tackling this — the performance improvement looks promising, and the focused tests pass. I found two test gaps that I think should be addressed before merging:
-
The navigation test can hide navigation bugs.
pressUntilVisiblerepeatedly sends]or[until the last or first file appears. That means the test can still pass if a keypress is dropped, a navigation step is duplicated, or one press skips multiple hunks.After rebasing, could you use the
ensureKeyboardIsLivehelper now onmain, then send the expected seven forward and seven backward keypresses explicitly? That would verify each navigation step rather than only checking that the test eventually reaches an edge. -
The highlight delay needs timer-focused coverage.
The new behavior highlights visible files immediately and waits 300 ms before starting speculative highlighting. The current test only checks that an offscreen file is eventually highlighted, which the previous eager implementation would also pass.
Could you add controlled-timer tests showing that:
- selected and visible files start highlighting immediately;
- speculative files wait for the idle threshold; and
- scrolling or navigating cancels and restarts pending speculative work?
This branch also conflicts with current main in DiffPane.tsx, PierreDiffView.tsx, and the PTY harness. When resolving those conflicts, please preserve the newer custom file-view and current-line behavior, along with ensureKeyboardIsLive.
For validation, I ran the PR head separately: all 96 focused unit/component tests and all 15 navigation/scroll PTY tests passed. Typechecking stopped on the existing unrelated deep-instantiation error in src/core/customThemes.ts.
This comment was generated by Pi using gpt-5.6-sol
Fixes #600
Summary
Why
Wrapping previously bypassed file-level windowing. On a large review this mounted the entire file stream and eagerly queued syntax highlighting on the main thread, producing a blank startup and high memory use. Exact precomputed section geometry now lets wrapped reviews mount only nearby files without changing scroll or hunk-navigation coordinates.
Validation
bun run lintbun run format:checkbun run typecheckbun run check:docsbun run changeset:statusThe broader macOS
bun run testattempt reached 1,474 passing and 17 skipped tests; three pre-existing session E2E cases remained host-dependent because the harness assumes Linuxscriptbehavior and has daemon timing sensitivity. The changed surface and PTY integration suites pass, and upstream Linux CI remains authoritative for those session cases.