Repository navigation
fix(ui): keep copy-selection rows lazy during navigation - #1202
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryKeeps copy-selection rows lazy during keyboard navigation.
No actionable issues found. Review conclusions come from code inspection; no tests were run during this review. Reviews (1) · Last reviewed commit: "fix(ui): keep copy-selection rows lazy d..." · Reviewed by Greptile |
|
Code review found one cache-invalidation issue: measured Fixed in 46e145f by including both dependencies in the existing key, with split/unified regression coverage for replacement IDs and saved↔draft transitions. The cache design and bounded slots remain unchanged. The new tests reproduced stale targets before the fix and pass afterward. No further actionable findings from reviewing the diff, lazy-copy consumers, note-stop ordering, and alternate file-view path. Final local verification passed: 97 focused tests; 5,146 full-suite tests (13 skipped); 266 PTY tests (1 skipped); 118 review-conformance tests; 11 real-TTY smoke tests; typecheck; dependency checks; and targeted lint/format checks. Waiting for the final revision's remaining CI checks before merging. This comment was generated by Pi using gpt-6.1-sol |
|
Independent post-merge check: the eager copy-row materialization reproduces on base, and this change removes it and reduces retained JS heap in a real CLI/navigation workload. Tested exact head Real CLI/PTY measurements: generated disposable Git repositories with 120-line TypeScript files, changing lines 37–84 in each file. Ran source
Execution order alternated for the three main pairs; processes ran serially. RSS was noisy, so it's not the success criterion. Captured initial/post-navigation terminal frames also matched between base/head. This is a different fixture from the PR's 50,000-line giant-file workload, not a reproduction of its exact benchmark numbers or proof of universally faster interactions. Independent projection/copy check: across 24 cases (split/unified × wrapped/unwrapped × widths 80/160/240 × notes/no notes), used two Unicode-containing files with semantic roots/replies, drafts, and decoration-only cards. A forwarding getter counted access to each geometry's Corroboration: copied the head navigation test file only into the isolated base archive; identical note-free getter-trap regressions give 2 failures on base / 2 passes on head. Head focused navigation/geometry/copy tests 97 pass, real-PTY notes tests 32 pass (including the resized saved-note case), review conformance 118 pass, and typecheck passes. No actionable regression found within these checks. Full repository/PTY suites, macOS/Windows, the exact giant-file measurements, and first-copy timing were not independently tested. Deferred copy work is still a tradeoff, not eliminated work. No claim of an unbounded leak or its resolution here. This comment was generated by Pi using GPT-6.1 Sol |
Problem
Building keyboard navigation stops reads
geometry.plannedRowsfor every reviewed file. That eagerly materializes and retains the full row-content plans intended to stay lazy until copy selection needs them, even when a file has no notes.Change
This is a standalone follow-up to merged #1200, based on main
4b159469. The geometry cache design, source fingerprinting, theme/content ownership, and bounded cache slots are unchanged. The existing key now also includes semantic note ID and draft/source classification because bounds retain selectable note targets. It does not include the broader experimental cache redesign. This belongs in the terminal navigation projection, not shared review semantics or an extension.Independent benchmark results
Compared pristine main with only the navigation benchmark instrumentation against this extraction, on the same Linux x64 host using Bun 1.3.14 and the same dependencies. Five fresh-process samples per version; execution order alternated, with no concurrent benchmark/test workloads. Mounted moderate fixture: 180 files × 120 lines. Huge fixture: 1,001 files including one 50,000-line file. Values below are medians; heap is decimal MB of JavaScript heap, not process RSS.
These measurements support the memory reduction, not a claim of universally faster interactions. Some timing medians increased; the huge navigation benchmark measures only four presses per process. No interaction/cold-geometry metric crossed the existing combined 15% and 5 ms regression criterion in these runs.
The intended tradeoff is deferred copy work: in the geometry diagnostic, explicitly materializing all 180 copy-row plans after navigation takes 9.29 ms rather than 0.07 ms, because navigation no longer prebuilds them. This is an all-files diagnostic, not a measured single-file copy latency. Copy still retains row plans once requested. These synthetic results do not explain the original private incident's retention owner.
Benchmark command, run once per version per round:
Verification
bun test packages/hunk/src/ui/lib/reviewVerticalStops.test.ts packages/hunk/src/ui/diff/diffSectionGeometry.test.ts packages/hunk/src/ui/components/panes/copySelection.test.ts— 97 passed.bun run test— 5,146 passed, 13 skipped, 0 failed across both shards.bun run test:integration— 266 passed, 1 skipped, 0 failed.bun test ./test/review-conformance— 118 passed.bun run test:tty-smoke— 11 passed.bun run typecheck,bun run deps:check, targetedoxfmt/oxlint, andgit diff --check— passed.bun run packages/hunk/src/main.tsx diff --helpandbun run install:bin— passed.No intended visual or interaction change and no media attached. The real-PTY regression uses an actual file-pair diff in unified mode, 30 rows, 80/100/120 columns, and verifies saved-note selection/navigation/deletion without hover after resizing; TTY smoke also executed. Tested on Linux only; macOS and Windows were not run.
This PR description was generated by Pi using gpt-6.1-sol