Skip to content

refactor(ui): isolate extension trust controller - #876

Open
benvinegar wants to merge 3 commits into
mainfrom
refactor/extension-trust-controller
Open

refactor(ui): isolate extension trust controller#876
benvinegar wants to merge 3 commits into
mainfrom
refactor/extension-trust-controller

Conversation

@benvinegar

@benvinegar benvinegar commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

  • move repository-extension permission prompts and decisions into useExtensionTrustController
  • preserve the behavior of trusting, denying, or dismissing permission to load and execute repo-local extensions
  • prevent stale repository decisions across soft reloads, pager transitions, and StrictMode replay

Testing

  • focused extension permission controller and App trust tests
  • AppHost extension integration tests
  • bun run typecheck
  • bun run deps:check
  • bun run lint
  • bun run format:check
  • diff checks

Stack

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 12:13pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extracts repository-extension trust prompt state and decision handling from App into a dedicated, tested controller hook.

  • Moves trust prompt reconciliation, persistence, notices, and extension reload behavior into useExtensionTrustController.
  • Keeps dialog rendering and keyboard routing in App.
  • Adds focused coverage for pager mode, repository changes, StrictMode replay, persistence failures, and reload behavior.

Confidence Score: 5/5

The PR appears safe to merge with no concrete changed-code failure identified.

The extracted controller preserves the existing trust persistence and reload flow while explicitly preventing stale repository prompts from remaining actionable, with focused tests covering the relevant state transitions and failure paths.

Important Files Changed

Filename Overview
src/ui/App.tsx Replaces inline extension-trust state and callbacks with the dedicated controller while retaining dialog presentation.
src/ui/hooks/useExtensionTrustController.ts Encapsulates prompt eligibility, per-session offering state, trust persistence, denial, notices, and optional extension reloads.
src/ui/hooks/useExtensionTrustController.test.tsx Adds comprehensive controller tests covering prompt transitions, decisions, reloads, failures, and StrictMode behavior.

Reviews (1): Last reviewed commit: "refactor(ui): isolate extension trust co..." | 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