Skip to content

refactor(ui): split mounted diff row views - #877

Merged
benvinegar merged 2 commits into
mainfrom
refactor/render-row-mounted-views
Aug 27, 2026
Merged

refactor(ui): split mounted diff row views#877
benvinegar merged 2 commits into
mainfrom
refactor/render-row-mounted-views

Conversation

@benvinegar

@benvinegar benvinegar commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

  • split mounted code rows into CodeRowView.tsx
  • split headers, collapsed gaps, and other metadata rows into DiffMetaRowView.tsx
  • isolate nested row mouse-action ownership while preserving the existing facade identity
  • keep layout planning and extension highlight application outside geometry caches

Stack

Validation

  • full mounted-row and UI component coverage
  • PTY integration and TTY smoke
  • installed-binary tmux visual check
  • bun run typecheck
  • bun run lint
  • bun run deps:check
  • rendering benchmarks
  • independent review: PASS

The unchanged local runtime-module resolver assertion remains the only environment-specific full-suite issue.

This PR description was generated by Pi using gpt-5.6-sol

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hunk-web Ignored Ignored Preview Aug 27, 2026 4:19am

Request Review

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR refactors mounted diff-row rendering into focused code-row and metadata-row components while preserving the existing rendering facade and nested mouse-action ownership.

  • Moves split and stacked code rendering into CodeRowView.
  • Moves collapsed gaps and hunk headers into DiffMetaRowView.
  • Centralizes nested row mouse-event tracking in rowMouseActions.
  • Updates extension architecture documentation and adds component coverage.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking need to move the new UI coverage into the repository’s required Storybook and Chromatic workflow.

The rendering extraction preserves row dispatch, geometry inputs, cursor and selection paint, note controls, and shared mouse-event ownership; the only accepted concern is the test mechanism used for the new UI component.

Files Needing Attention: src/ui/diff/CodeRowView.test.tsx

Important Files Changed

Filename Overview
src/ui/diff/renderRows.tsx Retains the memoized facade while dispatching all four diff-row variants to the extracted views.
src/ui/diff/CodeRowView.tsx Extracts split and stacked row layout, highlighting, wrapping, hover, and add-note rendering without an identified behavioral regression.
src/ui/diff/DiffMetaRowView.tsx Extracts collapsed-gap and hunk-header rendering while preserving their hit areas and nested controls.
src/ui/diff/rowMouseActions.ts Preserves a single module-level WeakSet shared by nested controls and DiffPane mouse handling.
src/ui/diff/CodeRowView.test.tsx Adds selection-precedence coverage using a traditional UI test rather than the repository-required Storybook and Chromatic workflow.
src/ui/components/panes/DiffPane.tsx Updates the nested mouse-action import to the dedicated module with shared module identity intact.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[DiffRowView facade] --> B{Diff row type}
    B -->|split-line or stack-line| C[CodeRowView]
    B -->|collapsed or hunk-header| D[DiffMetaRowView]
    C --> E[CodeCellView painting]
    C --> F[rowMouseActions]
    D --> F
    F --> G[DiffPane parent mouse handling]
Loading
Prompt To Fix All With AI
### Issue 1
src/ui/diff/CodeRowView.test.tsx:1
**Wrong UI test workflow**

This traditional Bun/OpenTUI component test bypasses the repository-required Storybook play test and Chromatic snapshot workflow, so the new component's visual coverage is not exercised through the standard visual-regression path.

---

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

Reviews (1): Last reviewed commit: "refactor(ui): split mounted diff row vie..." | Re-trigger Greptile

Comment thread src/ui/diff/CodeRowView.test.tsx
Base automatically changed from refactor/render-row-cell-painting to main August 27, 2026 04:19
@benvinegar
benvinegar force-pushed the refactor/render-row-mounted-views branch from 9150ac2 to 343d6b6 Compare August 27, 2026 04:19
@benvinegar
benvinegar merged commit fa793f1 into main Aug 27, 2026
12 checks passed
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