Skip to content

refactor(ui): extract code row layout - #869

Merged
benvinegar merged 1 commit into
refactor/render-row-span-layoutfrom
refactor/render-row-code-layout
Aug 27, 2026
Merged

benvinegar merged 1 commit into
refactor/render-row-span-layoutfrom
refactor/render-row-code-layout

Conversation

@benvinegar

@benvinegar benvinegar commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

  • extract canonical code-row width and height planning into renderer-free codeRowLayout.ts
  • share add-note badge text and terminal width between geometry and painting
  • make section geometry and clipboard selection import focused layout APIs instead of renderRows.tsx

Stack

Validation

  • 184 focused layout, copy-selection, and UI tests
  • 132 PTY integration tests, with one platform skip
  • bun run typecheck
  • bun run lint
  • bun run deps:check
  • relevant rendering benchmarks
  • independent review: PASS

The full unit wrapper reached 1,558 passing tests before the unchanged local hostRuntimeModules.test.ts resolver issue described in the repository notes.

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:33am

Request Review

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR extracts code-row geometry and height planning from the renderer into a dedicated module while centralizing the add-note badge constants.

  • Migrates geometry, copy-selection, rendering, and test consumers to the extracted layout API.
  • Keeps rendering-specific text generation and components in renderRows.tsx.
  • Adds focused coverage for the centralized badge width.

Confidence Score: 5/5

The PR appears safe to merge with no actionable regressions identified.

The extracted implementation preserves the existing planner and measurement behavior, all identified consumers were migrated, and the new dependency boundary does not introduce a runtime cycle.

Important Files Changed

Filename Overview
src/ui/diff/codeRowLayout.ts Extracts the existing code-row planning and measurement implementation without changing its geometry behavior or introducing a dependency cycle.
src/ui/diff/renderRows.tsx Replaces locally defined layout helpers and badge literals with imports while retaining rendering-specific behavior.
src/ui/diff/codeRowAffordance.ts Centralizes the fixed ASCII add-note badge text and its three-column width.
src/ui/components/panes/copySelection.ts Updates copy-selection layout planning to import the extracted API with unchanged options.
src/ui/diff/diffSectionGeometry.ts Migrates row-height measurement to the extracted module without changing geometry inputs.

Reviews (1): Last reviewed commit: "refactor(ui): extract code row layout" | Re-trigger Greptile

@benvinegar
benvinegar merged commit 141163e into main Aug 27, 2026
13 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