Skip to content

Add a plugin studio and a managers-only examples shelf - #2870

Draft
hahn-kev-bot wants to merge 10 commits into
claude/plugins-mvp-review-y9lx01from
claude/plugin-studio
Draft

hahn-kev-bot wants to merge 10 commits into
claude/plugins-mvp-review-y9lx01from
claude/plugin-studio

Conversation

@hahn-kev-bot

Copy link
Copy Markdown
Collaborator

AI summary

Stacked on #2432. Replaces the New plugin and AI prompt dialogs with one full-page plugin studio, and moves the bundled examples onto a managers-only shelf on the Plugins page. Trying an example now takes one click from the Plugins page (it used to take 7), and adding it takes one more.

flowchart LR
  subgraph Page["Plugins page"]
    P[Project plugins] --> R[Run]
    P --> E[Edit]
    S["Examples shelf (managers)"] --> T[Try it]
    N[New plugin]
  end
  T --> ST
  N --> ST
  E --> ST
  ST["PluginStudioView: example / new / edit"] -->|preview| SB
  R --> RV[PluginRunView] -->|live| SB
  SB[PluginSandbox] --> AD["PluginApiAdapter writeMode: live / preview"]
Loading

Preview mode (API, additive)

  • PluginSandbox is extracted from PluginRunView (iframe, host wiring, write dialog, navigation teardown). The run view keeps consent, trust and its toolbar.
  • PluginApiAdapter takes writeMode: 'live' | 'preview'. In preview a write is validated, compare-and-swap checked and diffed exactly as live, shown in a "would change" dialog, and rejected with a new preview error code. saveFile rejects, and plugin storage stays in memory.
  • The 9 writing examples now treat preview like a decline. The SDK and AI prompt document the new code.

Studio (/plugins/new, /plugins/examples/:key, /plugins/:id/edit, behind features.plugins and the manager role)

  • The live preview is on the left, with tabs on the right: About / Ask AI / Source for an example, Ask AI / Paste or upload / Details for a new plugin, and Ask AI / Source / Details when editing.
  • An example changed before adding is saved as "… (custom)".
  • Entry-menu plugins preview against a picked entry (the first entry by default). Phones get a Preview / Edit tab pair.
  • Leaving with unsaved work asks first: the studio's own buttons, browser back, closing the window, and the sidebar. The sidebar check goes through a small leave-guard.ts, because svelte-routing has no navigation guards.

Ask AI loop

  • The change prompt is the usual setup body plus the plugin's current HTML and the requested change.
  • A pasted reply has the HTML pulled out of the chat prose, then its manifest is compared with the saved plugin or the example. New permissions get a warning and an "Ask the AI to remove it" follow-up prompt.
  • Edit mode has a Current / New version toggle, and each pasted version can be undone.

Behaviour change: saving new HTML now turns off "Always allow" on this device. Before, the service carried it over to the new code. The studio says so before saving.

Other

  • PluginEditorDialog and PluginAiPromptDialog are deleted.
  • The demo gains a setProjectRole Playwright knob.
  • demo-project-view.test.ts gets a 120s timeout. It already took ~59s of its 60s budget on the base commit, and the studio pushed it over.

Test plan

  • task test:ui-standalone -- plugins.test.ts --project=chromium: 39 passed. Covers the shelf (one-click Try it, hidden for non-managers), a plugin built from a pasted AI reply, a preview write that shows the diff and leaves the entry count unchanged, live write approval and trust, a customized example saved as "(custom)", an edit that adds the internet permission, the leave guard, and all 27 examples run in the studio preview.
  • Vitest for preview-mode adapter behaviour, the change prompt, manifest comparison, draft state and reply extraction.
  • task verify
  • WebKit run (CI)

🤖 Generated with Claude Code

hahn-kev and others added 6 commits October 30, 2026 15:20
PluginSandbox owns the iframe, host wiring, write dialog and navigation
teardown so the run view and the coming plugin studio share them. In
preview mode the adapter builds and shows the same write diff, saves
nothing and rejects with a new 'preview' error code; saveFile rejects and
plugin storage stays in memory. Examples treat 'preview' like a decline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PluginStudioView runs the draft in a preview sandbox on the left, with
tabs on the right, in three modes: an example (/plugins/examples/:key),
a new plugin (/plugins/new) and an existing one (/plugins/:id/edit). It
is for managers only. An example changed before adding is saved as
'... (custom)'. Leaving with unsaved work asks first: the studio's own
buttons, browser back, closing the window and the sidebar (through a
small leave guard). Entry-menu plugins preview against a picked entry,
and phones get a Preview / Edit tab pair.

The demo-project mount test now gets 120s: it already took ~59s of its
60s on a busy machine before this page was added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every action now opens the studio: New plugin, Edit, and Try it on an
example. Non-managers see only the project's plugins and Run. The New
plugin and AI prompt dialogs are replaced by the studio and removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Ask AI tab copies a change prompt: the usual setup body (API guide,
project context) plus the plugin's current HTML and the requested change.
A pasted reply is compared with the saved plugin or the example (or, for a
new plugin, the version before it). Added permissions get a warning with
a one-click follow-up prompt asking the AI to remove them; other manifest
changes and the size change are listed. Edit mode can switch the preview
between the current and new version, and each pasted version can be
undone. Saving new HTML now turns off 'Always allow' on this device, since
the trust was given to the old code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Playwright suite now covers the examples shelf (one-click Try it,
hidden from non-managers), building a plugin from a pasted AI reply,
preview writes that show a diff and save nothing, a customized example
saved as '(custom)', an edit that adds a permission, and the leave guard.
The example sweep runs every example in the studio preview without adding
it. The demo gains a setProjectRole knob for the non-manager case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Oct 30, 2026
…ugin-studio

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AM78WE5VuKLFN71xiMNo6Z
saveFile has no approval dialog, so a runaway plugin with the edit
permission could fill LinkedFiles unattended. Each run now gets a budget
of 500 files or 200MB, after which saveFile rejects with storage-full.

Also tests that declined updateEntry and applyChanges calls apply nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AM78WE5VuKLFN71xiMNo6Z

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants