Skip to content

refactor(ui): isolate file presentation state - #656

Open
benvinegar wants to merge 1 commit into
mainfrom
refactor/file-presentation-controller
Open

refactor(ui): isolate file presentation state#656
benvinegar wants to merge 1 commit into
mainfrom
refactor/file-presentation-controller

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

  • extract file-presentation selection, availability, bulk actions, menus, and extension controls into useFilePresentationController
  • extract layout preparation and bounded row-render warning handling into useFilePresentationRendering
  • keep shared row-failure metadata in the file-view feature layer and add focused controller/rendering coverage

Validation

  • bun run typecheck
  • bun run format:check
  • bun run lint
  • bun run test (1,757 pass, 9 skip)
  • bun run test:integration (85 pass, 1 skip)
  • bun run test:tty-smoke (9 pass)

This PR description was generated by Pi using OpenAI GPT-5.3 Codex

@vercel

vercel Bot commented Jul 31, 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 Jul 31, 2026 5:43pm

Request Review

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Refactors file-presentation behavior without changing its external contract.

  • Extracts presentation selection, availability, menus, bulk actions, and extension controls into useFilePresentationController.
  • Extracts custom-view layout preparation and bounded row-warning handling into useFilePresentationRendering.
  • Moves shared row-failure metadata into the file-view feature layer and adds focused controller and rendering tests.

Confidence Score: 5/5

The PR appears safe to merge, with the extracted hooks preserving the previous file-presentation behavior and adding focused coverage.

The controller and rendering logic remain behaviorally aligned with their former inline implementations, and the type relocation uses type-only imports without introducing runtime module dependencies.

Important Files Changed

Filename Overview
src/ui/App.tsx Replaces inline file-presentation orchestration with the two extracted hooks while preserving existing command, menu, extension, and rendering wiring.
src/ui/fileViews/useFilePresentationController.ts Encapsulates presentation selection, reconciliation, draft availability, bulk application, menus, and live extension controls with focused regression coverage.
src/ui/fileViews/useFilePresentationRendering.ts Encapsulates layout preparation and generation-aware, bounded row-warning deduplication without changing the prior behavior.
src/ui/fileViews/types.ts Moves shared row-failure metadata to a dependency-free type-only module, reducing pane-layer coupling.
src/ui/components/panes/FileView.tsx Updates the row-failure type import to the new feature-layer module with no runtime behavior change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  App[App] --> Controller[useFilePresentationController]
  App --> Rendering[useFilePresentationRendering]
  Controller --> Selection[Selection and availability state]
  Controller --> Controls[Menus, bulk actions, extension controls]
  Rendering --> Layouts[useFileViewLayouts]
  Rendering --> Warnings[Bounded row-failure warnings]
  Layouts --> DiffPane[DiffPane]
  Warnings --> DiffPane
  DiffPane --> DiffSection[DiffSection]
  DiffSection --> FileView[FileView]
Loading

Reviews (1): Last reviewed commit: "refactor(ui): isolate file presentation ..." | Re-trigger Greptile

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