Registry Mirror
Skip to content

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

  • keep selection-only navigation from rebuilding review-stream files, geometry, and line cursors
  • seed the initially measured current-line cursor synchronously to avoid a duplicate first-frame repaint
  • retain the direct StyledText chunk path for wrapped gutter and full-row highlights instead of converting every visual line into React spans
  • add identity and wrapped-CJK cursor regression coverage

Benchmark evidence

Five-sample medians from the release benchmark fixtures:

  • navigation heap after six hunk moves: about 171 MB → 135.9 MB
  • pathological wrapped-CJK long-line mount: about 35–42 ms → 20.1 ms in the focused run (22.05 ms when run with the broader benchmark group)
  • wrapped content remained present on the initial, immediate-scroll, and settled frames

The broader 518-physical-line mount metric remains above the older stable baseline and is not claimed as fixed here. The pathological long-line regression and navigation retention regression that motivated this change are resolved.

Validation

  • bun run typecheck
  • bun run lint
  • bun run format:check
  • bun run check:pack
  • focused controller, current-line, row-style, and copy-selection tests
  • bun run test:integration — 97 passing
  • bun run test:tty-smoke — 9 passing
  • real-TTY wrapped-CJK diff smoke run
  • independent review: no blockers

This PR description was generated by Pi using OpenAI GPT-5.6-sol

@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hunk-web Ready Ready Preview Aug 8, 2026 1:09pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reduces current-line navigation and wrapped-row rendering costs while adding regression coverage for cursor identity and wrapped CJK content.

  • Separates selection-independent review-stream derivation from selected-file and selected-hunk lookup.
  • Seeds the rendered line cursor from the selected hunk while measured cursor state is adopted.
  • Keeps compatible wrapped highlights on the direct StyledText chunk path.
  • Adds navigation identity and wrapped-CJK cursor tests.

Confidence Score: 4/5

The PR appears safe to merge, with only a non-blocking string-style inconsistency in the new wrapped-CJK test.

The navigation-state split, initial cursor fallback, and wrapped-row chunk path retain their relevant behavioral contracts; the only accepted issue is inconsistent quote style in newly added test code.

Files Needing Attention: src/ui/AppHost.cursor-line.test.tsx

Important Files Changed

Filename Overview
src/ui/components/panes/DiffPane.tsx Adds a synchronous selected-hunk cursor fallback and consistently uses it to scope current-line highlighting.
src/ui/diff/renderRows.tsx Extends direct wrapped-row chunk rendering to gutter and full-row highlights while preserving span rendering for partial selections.
src/ui/hooks/useReviewController.ts Memoizes review-stream construction independently from selection-only navigation.
src/ui/lib/reviewState.ts Refactors review-state construction into selection-independent stream derivation and exported selected-file resolution.
src/ui/AppHost.cursor-line.test.tsx Adds wrapped-CJK cursor-highlight coverage but the new literals do not follow the repository's required quote convention.
src/ui/hooks/useReviewController.test.tsx Verifies that selection-only hunk navigation preserves visible-file identity.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Files, comments, filter] --> B[buildReviewStreamState]
  B --> C[Visible files and hunk cursors]
  C --> D[resolveSelectedFile]
  D --> E[Selected hunk]
  E --> F[firstLineCursorInHunk fallback]
  F --> G[Cursor highlight]
  G --> H[Wrapped StyledText chunk rendering]
Loading
Prompt To Fix All With AI
### Issue 1
src/ui/AppHost.cursor-line.test.tsx:111-113
**Use consistent string quotes**

The new fixture and assertions use double-quoted string literals instead of the repository-required single-quoted style, creating formatter and style inconsistency across this test.

---

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): bound current-line navigation c..." | Re-trigger Greptile

Comment on lines +111 to +113
const bootstrap = {
...createTestVcsAppBootstrap({
files: [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Use consistent string quotes

The new fixture and assertions use double-quoted string literals instead of the repository-required single-quoted style, creating formatter and style inconsistency across this test.

Context Used: guidelines.mdc Cursor rule (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/ui/AppHost.cursor-line.test.tsx
Line: 111-113

Comment:
**Use consistent string quotes**

The new fixture and assertions use double-quoted string literals instead of the repository-required single-quoted style, creating formatter and style inconsistency across this test.

**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@benvinegar
benvinegar enabled auto-merge (squash) August 8, 2026 13:14
@benvinegar
benvinegar merged commit 61a561a into main Aug 8, 2026
12 checks passed

This branch was successfully deployed

1 active deployment
Preview — 78b04022 Deployed Aug 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant