Skip to content

refactor(ui): isolate user note composition - #871

Merged
benvinegar merged 1 commit into
mainfrom
refactor/user-note-composer
Aug 27, 2026
Merged

refactor(ui): isolate user note composition#871
benvinegar merged 1 commit into
mainfrom
refactor/user-note-composer

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

  • extract terminal user-note targeting and draft focus coordination into useUserNoteComposer
  • inject note lifecycle event publishing while keeping semantic note state in useTerminalReview
  • add focused coverage for targeting, focus, payloads, failures, and soft-reload rerenders

Testing

  • bun test src/ui/hooks/useUserNoteComposer.test.tsx
  • bun run typecheck
  • bun run lint
  • bun run format:check
  • bun run deps:check
  • bun test test/pty/notes.test.ts test/pty/key-routing.test.ts
  • bun test test/pty/extensions-integration.test.ts

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 Aug 27, 2026 1:33am

Request Review

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extracts terminal user-note targeting, focus coordination, and extension event projection from App into a dedicated hook while retaining semantic note state in useTerminalReview.

  • Adds useUserNoteComposer for note targeting and lifecycle coordination.
  • Rewires App to inject semantic actions, focus transitions, and extension event publishing.
  • Adds focused hook tests covering target precedence, focus, event payloads, failures, and rerenders.

Confidence Score: 5/5

The PR appears safe to merge with no actionable regression identified in the changed note-composition paths.

The extraction preserves the reachable production targeting, focus, save, update, cancel, and extension event behavior, with focused tests covering the new hook boundary.

Important Files Changed

Filename Overview
src/ui/App.tsx Replaces inline note-composition callbacks and hover state with injected seams to useUserNoteComposer without a confirmed behavioral regression.
src/ui/hooks/useUserNoteComposer.ts Encapsulates note target selection, focus transitions, semantic action delegation, and extension event projection.
src/ui/hooks/useUserNoteComposer.test.tsx Adds colocated coverage for targeting precedence, failed starts, focus transitions, event payloads, and committed rerenders.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  UI[Diff and keyboard actions] --> Composer[useUserNoteComposer]
  Composer --> Review[useTerminalReview semantic actions]
  Composer --> Focus[App focus ownership]
  Composer --> Events[Extension note events]
Loading

Reviews (1): Last reviewed commit: "refactor(ui): isolate user note composit..." | Re-trigger Greptile

@benvinegar
benvinegar merged commit 0795ef5 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