Repository navigation
Add a plugin studio and a managers-only examples shelf - #2870
Draft
hahn-kev-bot wants to merge 10 commits into
Draft
hahn-kev-bot wants to merge 10 commits into
hahn-kev-bot wants to merge 10 commits into
Conversation
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>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
…ugin-studio Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AM78WE5VuKLFN71xiMNo6Z
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
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AM78WE5VuKLFN71xiMNo6Z
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"]Preview mode (API, additive)
PluginSandboxis extracted fromPluginRunView(iframe, host wiring, write dialog, navigation teardown). The run view keeps consent, trust and its toolbar.PluginApiAdaptertakeswriteMode: '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 newpreviewerror code.saveFilerejects, and plugin storage stays in memory.previewlike a decline. The SDK and AI prompt document the new code.Studio (
/plugins/new,/plugins/examples/:key,/plugins/:id/edit, behindfeatures.pluginsand the manager role)leave-guard.ts, because svelte-routing has no navigation guards.Ask AI loop
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
PluginEditorDialogandPluginAiPromptDialogare deleted.setProjectRolePlaywright knob.demo-project-view.test.tsgets 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.task verify🤖 Generated with Claude Code