Skip to content

refactor(ui): isolate extension dialog lifecycle - #651

Merged
benvinegar merged 1 commit into
mainfrom
refactor/extension-dialog-controller
Jul 31, 2026
Merged

benvinegar merged 1 commit into
mainfrom
refactor/extension-dialog-controller

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

  • extract extension dialog state and lifecycle management from App into useExtensionDialogController
  • keep the dialog queue private while exposing the narrow createDialogs capability used by extension commands
  • add focused coverage for request promotion, soft-reload cancellation, and unmount shutdown

Testing

  • bun run typecheck
  • bun run format:check
  • bun run lint
  • bun run test (1,748 passed, 9 skipped)

This PR description was generated by Pi using GPT-5.4

@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 3:39pm

Request Review

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR isolates extension-dialog state and lifecycle management in a dedicated controller hook.

  • Moves queue ownership, answer state, request promotion, reload cancellation, and unmount shutdown out of App.
  • Exposes only the dialog-capability factory and UI-facing controller actions.
  • Adds focused tests for request handling, soft reloads, and teardown.

Confidence Score: 5/5

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

The extracted controller preserves the prior queue ownership, callback behavior, request-state resets, reload cancellation, and unmount cleanup, with focused tests covering the lifecycle boundaries.

Important Files Changed

Filename Overview
src/ui/App.tsx Replaces inline extension-dialog lifecycle management with the controller hook while preserving command, keyboard, and rendering integration.
src/ui/hooks/useExtensionDialogController.ts Encapsulates the stable queue, per-request answer state, soft-reload cancellation, and unmount shutdown without changing existing behavior.
src/ui/hooks/useExtensionDialogController.test.tsx Adds focused coverage for FIFO request promotion, answer-state reset, reload cancellation, post-reload reuse, and unmount settlement.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Command[Extension command] --> Create[createDialogs]
  Create --> Queue[Private dialog queue]
  Queue --> Request[Visible request]
  Request --> UI[Extension dialog UI]
  UI --> Accept[Accept or cancel]
  Accept --> Queue
  Reload[Review generation changes] --> CancelAll[cancelAll]
  CancelAll --> Queue
  Unmount[App unmounts] --> Shutdown[shutdown]
  Shutdown --> Queue
Loading

Reviews (1): Last reviewed commit: "refactor(ui): isolate extension dialog l..." | Re-trigger Greptile

@benvinegar
benvinegar merged commit 7d8ae9e into main Jul 31, 2026
13 checks passed
@benvinegar
benvinegar deleted the refactor/extension-dialog-controller branch July 31, 2026 15:46

This branch was successfully deployed

1 active deployment
Preview — 4bdbad5a Deployed Jul 31, 2026 by vercel[bot]
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