feat(extensions): add custom dialog surfaces - #944
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe PR adds API v17 custom extension dialog surfaces and migrates Agent Skill onboarding into the bundled UI extension.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Sequence DiagramsequenceDiagram
participant Extension
participant Queue as Dialog Queue
participant Host as Hunk Host
participant Component as Extension Component
Extension->>Queue: ctx.dialogs.open(options)
Queue->>Host: Promote FIFO request
Host->>Component: Mount with bounds, theme, and guarded actions
Component->>Host: copy / notify / close
Host->>Host: Validate current request lease
Host->>Queue: Settle request on close, Escape, reload, or unmount
Queue-->>Extension: Resolve open() promise
Reviews (2): Last reviewed commit: "fix(extensions): harden dialog lifecycle..." | Re-trigger Greptile |
| @@ -241,7 +241,7 @@ text into a request the host draws, and answering by request id so a duplicated | |||
| Enter cannot spill onto whatever was queued behind. App subscribes with | |||
There was a problem hiding this comment.
Documentation exceeds line limit
This edited line exceeds the repository's 120-character limit; the same pattern occurs in website/src/content/docs/docs/extend/extension-api.md:318. Wrapping both lines keeps the documentation consistent with the project style guide.
Context Used: guidelines.mdc Cursor rule (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/extension-architecture.md
Line: 241
Comment:
**Documentation exceeds line limit**
This edited line exceeds the repository's 120-character limit; the same pattern occurs in `website/src/content/docs/docs/extend/extension-api.md:318`. Wrapping both lines keeps the documentation consistent with the project style guide.
**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Fixed in c206852. Wrapped the edited architecture paragraph and the website API documentation, including the newly documented document-size limits and clipboard normalization behavior.
Responded by OpenCode using openai/gpt-5.6-sol.
…skill-extension # Conflicts: # docs/extensions.md # skills/hunk-extensions/SKILL.md # website/src/content/docs/docs/extend/extension-api.md
…skill-extension # Conflicts: # docs/extensions.md # src/ui/App.tsx # website/src/content/docs/docs/extend/extension-api.md
Summary
ctx.dialogs.open(...)for trusted extensions to render bounded React/OpenTUI components inside Hunk-owned modal chromewidth/height, semantic theme colors, clipboard availability, and guardedclose,copy, andnotifyactions to the mounted componenthunk.app.openAgentSkillthrough the bundled UI extension and implement its existing prompt as a custom dialog componentWhy a generic dialog surface
The Agent Skill command is a product workflow rather than shared review semantics, so it belongs in a bundled extension. The dialog API now follows the pane model instead of adding a specialized read-only document method: trusted extension code owns the contents, while Hunk owns the modal boundary and lifecycle.
ctx.dialogs.open(...)joins the same FIFO queue asconfirm,select, andinput. A custom component receives only its bounded geometry, Hunk's public paint theme, clipboard capability, and request-scoped actions. User-installed extensions retain explicit attribution, render failures stay inside the frame, Escape remains host-owned, and unhandled component keys cannot mutate a focused review widget behind the modal.Before / after
Both captures use the same diff and a 120x24 Linux tmux PTY. Before is the original stacked base; after is the bundled Agent Skill extension. The current generic component implementation preserves this native chrome and interaction.
Before
After
Stack
This PR is stacked on #943 and should merge after it. Its base is
feat/bundled-editor-extension, so the diff contains only the Agent Skill and generic dialog work.Verification
bun run typecheckbun run lintbun run format:checkbun run deps:checkbun run check:docsbun run build:npmbun run changeset:statusbun run test(3,658 passed, 12 skipped)bun run test:integration(141 passed, 1 skipped)bun run test:tty-smoke(9 passed)Interaction coverage
Integration coverage exercises custom rendering, nested focused inputs, component key hooks, mouse and keyboard copy, rejected clipboard writes, render failures, per-request remounting, stale actions, open-to-input queue promotion, soft reload cleanup, Escape, and prior-focus restoration.