[PR #4012] [MERGED] Add safe extension UI contribution slots #6201

Closed
opened 2026-10-23 04:08:07 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4012
Author: @SpicyMarinara
Created: 7/23/2026
Status: ✅ Merged
Merged: 7/23/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feature/extension-ui-contributions


📝 Commits (4)

  • 041daaa Add safe extension UI contribution slots
  • 9359a03 Merge branch 'staging' into feature/extension-ui-contributions
  • 155f09a Fix contribution UI type narrowing
  • bf36798 fix(extensions): address contribution review

📊 Changes

16 files changed (+1596 additions, -69 deletions)

View changed files

📝 CHANGELOG.md (+1 -1)
📝 docs/development/personal-extensions.md (+22 -3)
📝 docs/extending/personal-extensions.md (+64 -12)
➕ packages/client/src/components/extensions/PersonalExtensionContributionIcon.tsx (+50 -0)
➕ packages/client/src/components/layout/PersonalExtensionContributionsMenu.tsx (+231 -0)
📝 packages/client/src/components/layout/PersonalExtensionInjector.tsx (+37 -2)
📝 packages/client/src/components/layout/RightPanel.tsx (+19 -2)
📝 packages/client/src/components/layout/TopBar.tsx (+7 -0)
➕ packages/client/src/components/panels/PersonalExtensionPanel.tsx (+232 -0)
➕ packages/client/src/lib/personal-extension-contributions.ts (+381 -0)
📝 packages/client/src/localization/locales/en.json (+9 -0)
📝 packages/client/src/stores/ui.store.ts (+2 -1)
📝 packages/server/src/routes/personal-extensions.routes.ts (+325 -23)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+7 -16)
📝 packages/shared/src/types/personal-extension.ts (+94 -0)
📝 scripts/regressions/extension-security.regression.ts (+115 -9)

📄 Description

Closes #4009

Why

Personal Extensions need first-class entry points in Marinara's menus without restoring arbitrary host DOM, React-internal, network, or direct API access. This gives Professor Mari-authored and explicitly enabled External Extensions a useful, themed UI surface while keeping rendering and navigation under Marinara's control.

What changed

  • Added marinara.ui.registerContribution(...) for button, menu-item, and panel contributions.
  • Added trusted top-bar actions, an Extensions menu, and a right-side Extensions panel.
  • Added host-rendered headings, text, preformatted output, buttons, text inputs, selects, toggles, sliders, color controls, and spacers.
  • Validated contribution kinds, icons, IDs, options, text, element counts, total payload size, and per-extension quotas in both the worker API and host client.
  • Bound registration, events, updates, and cleanup to the enabled extension's exact approved content hash.
  • Updated Professor Mari's authoring guidance, extension documentation, changelog, localization, and the extension security regression.

Security boundary

Extensions provide declarative data only. They cannot contribute HTML, CSS, URLs, React components, or callbacks to the host tree. Activation and form events return to the isolated Worker associated with the same extension ID and approved content hash. This PR does not add app-data or visual-effects authority; extensions that need those capabilities require separate narrow, permissioned brokers. Legacy packages that inject host DOM or call same-origin APIs therefore need a safe port rather than running unchanged.

Automated validation run

  • pnpm check passed on the exact PR head after the latest staging merge.
  • pnpm regression:extensions-security passed, including the live macOS Seatbelt runtime proof.
  • pnpm smoke:ui completed with 94 passed, 53 viewport-specific skips, and one unrelated Tracker reload timing failure; the exact failed Tracker test passed immediately when rerun alone.
  • git diff --check passed.

Manual test plan

  • Manually verify approved contribution buttons and the Extensions menu on desktop.
  • Manually verify the Extensions menu and right-side panel on a mobile viewport.
  • Manually verify every host-rendered panel control and event payload.
  • Manually verify extension disable, hash change, and worker failure remove all contributions.
  • Manually verify unapproved or policy-hidden External Extensions never register contributions.

Coordination

No pre-existing issue-linked branch or pull request was found before implementation. Issue #4009 records the scope and ownership.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4012 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/23/2026 **Status:** ✅ Merged **Merged:** 7/23/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feature/extension-ui-contributions` --- ### 📝 Commits (4) - [`041daaa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/041daaaaa2b0c3795bf584acc630206a5ae53293) Add safe extension UI contribution slots - [`9359a03`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9359a03d1c962e502b276f982363ecf8dbf07361) Merge branch 'staging' into feature/extension-ui-contributions - [`155f09a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/155f09a981cccc782aca669988e8d6c2c0f48283) Fix contribution UI type narrowing - [`bf36798`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bf36798afdff77eb6ad2c802edbe1c78edb7da67) fix(extensions): address contribution review ### 📊 Changes **16 files changed** (+1596 additions, -69 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -1) 📝 `docs/development/personal-extensions.md` (+22 -3) 📝 `docs/extending/personal-extensions.md` (+64 -12) ➕ `packages/client/src/components/extensions/PersonalExtensionContributionIcon.tsx` (+50 -0) ➕ `packages/client/src/components/layout/PersonalExtensionContributionsMenu.tsx` (+231 -0) 📝 `packages/client/src/components/layout/PersonalExtensionInjector.tsx` (+37 -2) 📝 `packages/client/src/components/layout/RightPanel.tsx` (+19 -2) 📝 `packages/client/src/components/layout/TopBar.tsx` (+7 -0) ➕ `packages/client/src/components/panels/PersonalExtensionPanel.tsx` (+232 -0) ➕ `packages/client/src/lib/personal-extension-contributions.ts` (+381 -0) 📝 `packages/client/src/localization/locales/en.json` (+9 -0) 📝 `packages/client/src/stores/ui.store.ts` (+2 -1) 📝 `packages/server/src/routes/personal-extensions.routes.ts` (+325 -23) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+7 -16) 📝 `packages/shared/src/types/personal-extension.ts` (+94 -0) 📝 `scripts/regressions/extension-security.regression.ts` (+115 -9) </details> ### 📄 Description Closes #4009 ## Why Personal Extensions need first-class entry points in Marinara's menus without restoring arbitrary host DOM, React-internal, network, or direct API access. This gives Professor Mari-authored and explicitly enabled External Extensions a useful, themed UI surface while keeping rendering and navigation under Marinara's control. ## What changed - Added `marinara.ui.registerContribution(...)` for `button`, `menu-item`, and `panel` contributions. - Added trusted top-bar actions, an Extensions menu, and a right-side Extensions panel. - Added host-rendered headings, text, preformatted output, buttons, text inputs, selects, toggles, sliders, color controls, and spacers. - Validated contribution kinds, icons, IDs, options, text, element counts, total payload size, and per-extension quotas in both the worker API and host client. - Bound registration, events, updates, and cleanup to the enabled extension's exact approved content hash. - Updated Professor Mari's authoring guidance, extension documentation, changelog, localization, and the extension security regression. ## Security boundary Extensions provide declarative data only. They cannot contribute HTML, CSS, URLs, React components, or callbacks to the host tree. Activation and form events return to the isolated Worker associated with the same extension ID and approved content hash. This PR does not add app-data or visual-effects authority; extensions that need those capabilities require separate narrow, permissioned brokers. Legacy packages that inject host DOM or call same-origin APIs therefore need a safe port rather than running unchanged. ## Automated validation run - `pnpm check` passed on the exact PR head after the latest `staging` merge. - `pnpm regression:extensions-security` passed, including the live macOS Seatbelt runtime proof. - `pnpm smoke:ui` completed with 94 passed, 53 viewport-specific skips, and one unrelated Tracker reload timing failure; the exact failed Tracker test passed immediately when rerun alone. - `git diff --check` passed. ## Manual test plan - [ ] Manually verify approved contribution buttons and the Extensions menu on desktop. - [ ] Manually verify the Extensions menu and right-side panel on a mobile viewport. - [ ] Manually verify every host-rendered panel control and event payload. - [ ] Manually verify extension disable, hash change, and worker failure remove all contributions. - [ ] Manually verify unapproved or policy-hidden External Extensions never register contributions. ## Coordination No pre-existing issue-linked branch or pull request was found before implementation. Issue #4009 records the scope and ownership. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:08:07 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6201
No description provided.