Skip to content

refactor(ui): extract planned row text projection - #874

Merged
benvinegar merged 1 commit into
mainfrom
refactor/render-row-text-projection
Aug 27, 2026
Merged

refactor(ui): extract planned row text projection#874
benvinegar merged 1 commit into
mainfrom
refactor/render-row-text-projection

Conversation

@benvinegar

@benvinegar benvinegar commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

  • extract decorated and code-only planned-row text projection into plannedRowText.ts
  • keep clipboard output driven by canonical code-row layout and styled-span wrapping
  • move inline-note title formatting into a non-component annotation presentation helper
  • update clipboard, conformance, and OpenTUI consumers to focused imports

Stack

Validation

  • 202 focused layout, wrapping, clipboard, annotation, and conformance tests
  • PTY coverage
  • bun run typecheck
  • bun run lint
  • bun run deps:check
  • bun run build:npm
  • independent review: PASS

The unchanged local runtime-module resolver assertion remains the only 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 1:51am

Request Review

@benvinegar
benvinegar force-pushed the refactor/render-row-text-projection branch from 759f5bc to 726ffbc Compare August 27, 2026 01:51
@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR separates canonical diff-row geometry, styled-span wrapping, and plain-text projection from the React renderer while preserving focused imports for clipboard, OpenTUI, annotations, geometry, and conformance consumers.

  • Extracts code-row layout into codeRowLayout.ts.
  • Extracts decorated and code-only row projection into plannedRowText.ts.
  • Extracts shared span slicing and wrapping into styledSpanLayout.ts.
  • Moves inline-note title formatting into the annotation presentation helper.
  • Updates consumers and focused tests to use the new module boundaries.

Confidence Score: 5/5

The PR appears safe to merge because the extraction preserves the existing rendering, geometry, clipboard, and annotation behavior without an identified actionable regression.

The new layout, projection, and span modules retain the prior algorithms, form an acyclic dependency graph, and keep measurement, React painting, and clipboard projection connected through shared geometry and wrapping helpers.

Important Files Changed

Filename Overview
src/ui/diff/plannedRowText.ts Extracts sanitized decorated and code-only row text projection from the renderer without an identified behavioral regression.
src/ui/diff/codeRowLayout.ts Centralizes canonical split/stack width reservation and row-height measurement while preserving the former planning logic.
src/ui/diff/styledSpanLayout.ts Moves grapheme-aware styled-span slicing, wrapping, and measurement into a shared acyclic utility.
src/ui/diff/renderRows.tsx Narrows the React renderer to painting and interaction while consuming the extracted canonical layout and span helpers.
src/ui/components/panes/copySelection.ts Updates clipboard and word-selection consumers to focused layout and projection imports and removes the unused theme dependency.
src/ui/lib/agentAnnotations.ts Hosts the unchanged inline-note title formatter so component and plain-text presentation share one implementation.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Plan[Planned review row] --> Geometry[codeRowLayout]
  Spans[Styled code spans] --> Wrapping[styledSpanLayout]
  Wrapping --> Geometry
  Geometry --> Renderer[renderRows React paint]
  Geometry --> Projection[plannedRowText]
  Wrapping --> Renderer
  Wrapping --> Projection
  Projection --> Clipboard[Copy selection]
  Projection --> OpenTUI[OpenTUI labels and empty-diff messages]
  Projection --> Conformance[Conformance consumer]
  Annotations[agentAnnotations title helper] --> Renderer
  Annotations --> Projection
Loading

Reviews (1): Last reviewed commit: 759f5bc | Re-trigger Greptile

@benvinegar
benvinegar merged commit d559932 into main Aug 27, 2026
12 checks passed
@benvinegar benvinegar changed the title refactor/render row text projection refactor(ui): extract planned row text projection Aug 27, 2026
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