[PR #4007] [MERGED] Extension UI polish: accent theming and floating-panel windows #6196

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

📋 Pull Request Information

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

Base: staging ← Head: fix/extension-ui-accent-panel


📝 Commits (2)

  • d68861c Address review: accent theming and floating-panel extension windows
  • 42d9577 Align floating-panel maxHeight with the 70vh JS cap

📊 Changes

5 files changed (+126 additions, -52 deletions)

View changed files

📝 docs/extending/personal-extensions.md (+4 -0)
📝 packages/client/src/components/layout/PersonalExtensionInjector.tsx (+68 -25)
📝 packages/client/src/components/panels/settings/PersonalExtensionsSettings.tsx (+4 -5)
📝 packages/server/src/routes/personal-extensions.routes.ts (+44 -22)
📝 scripts/regressions/extension-security.regression.ts (+6 -0)

📄 Description

Linked issue

Follow-up to #4006 (merged), addressing maintainer UI feedback after testing the browser-extension window capability with Professor Mari.

Why this change

Testing surfaced four issues:

  1. The enabled "Running approved code" status used a hardcoded green instead of the accent color.
  2. The browser/server sandbox warning used a hardcoded amber (yellow) instead of the accent color.
  3. The run-approval confirmation button used the destructive (red) tone instead of the standard accent button styling.
  4. The extension window opened as a full-screen grey backdrop takeover rather than over Marinara's page. That grey takeover was a presentation choice in the trusted renderer, not a security requirement.

What changed

Settings UI

  • Enabled status and the sandbox warning now use var(--primary) accent tokens instead of emerald/amber.
  • The approval dialog drops tone: "destructive", so the confirm button uses the standard accent styling. The confirmation step and full risk copy are unchanged.

Extension window presentation

  • Replaced the full-viewport backdrop with a floating panel docked bottom-right, sized to its content (capped to 70vh). Marinara's page stays fully visible and interactive — the window is no longer modal.
  • The host forwards Marinara's resolved accent/surface/border colors into the sandbox; the bootstrap applies them as CSS variables so the window (and its buttons) match the current theme.
  • The bootstrap reports content size (ui-resize) so the host fits the panel; it no longer paints any page-covering backdrop.

Third-party parity (requested)

  • These capabilities and styling are served by the shared sandbox document, so imported External Extensions get the identical window API and accent styling once they clear the same gates (ENABLE_EXTERNAL_EXTENSIONS + Danger Zone opt-in + exact-hash approval). A third-party extension can add or change UI only through this same sandboxed window — it still cannot reach Marinara's own DOM. Docs updated to state this explicitly.

Security posture (unchanged)

Making the window a smaller floating panel instead of a full-viewport overlay is strictly less surface. The iframe is still opaque-origin, allow-scripts only, connect-src 'none'; the extension still has no DOM/network/host access and only describes a window the trusted host renders as text.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated: pnpm check and pnpm regression:extensions-security (including the real macOS Seatbelt server-sandbox proof) pass. The regression now also asserts the window is a floating panel — it reports ui-resize and never paints a full-screen backdrop.

Manual verification notes

  • Approve a Mari-authored ASCII-bunny browser extension and confirm the window opens as a bottom-right floating panel over the app (page still usable), styled with the accent, and closes via ✕.
  • Confirm the Settings enabled-status pill, sandbox warning, and approval dialog button all use the accent in light and dark themes.
  • Import a third-party browser extension that opens a window and confirm it gets the same panel + accent styling after the gates + approval.

Docs and release impact

  • Updated docs (CHANGELOG covered by #4006; docs/extending/personal-extensions.md updated here)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence

Floating panel renders inside the sandbox iframe; screenshots to be added during manual verification.

Summary by CodeRabbit

  • New Features

    • Personal extension interfaces now open in compact, corner-docked floating panels instead of full-screen overlays.
    • Panels automatically resize to fit their content and match the app’s current accent theme.
    • Closing an extension panel returns the app to its normal state.
  • Bug Fixes

    • Updated extension settings alerts and status indicators to use consistent theme colors.
    • Improved sandbox security checks to prevent full-screen backdrop behavior.

🔄 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/4007 **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:** `fix/extension-ui-accent-panel` --- ### 📝 Commits (2) - [`d68861c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d68861cd578c04ea672163aa986fd296c9853431) Address review: accent theming and floating-panel extension windows - [`42d9577`](https://github.com/Pasta-Devs/Marinara-Engine/commit/42d9577820ea747a598f04a69cc462ac5cb43116) Align floating-panel maxHeight with the 70vh JS cap ### 📊 Changes **5 files changed** (+126 additions, -52 deletions) <details> <summary>View changed files</summary> 📝 `docs/extending/personal-extensions.md` (+4 -0) 📝 `packages/client/src/components/layout/PersonalExtensionInjector.tsx` (+68 -25) 📝 `packages/client/src/components/panels/settings/PersonalExtensionsSettings.tsx` (+4 -5) 📝 `packages/server/src/routes/personal-extensions.routes.ts` (+44 -22) 📝 `scripts/regressions/extension-security.regression.ts` (+6 -0) </details> ### 📄 Description ## Linked issue Follow-up to #4006 (merged), addressing maintainer UI feedback after testing the browser-extension window capability with Professor Mari. ## Why this change Testing surfaced four issues: 1. The enabled "Running approved code" status used a hardcoded green instead of the accent color. 2. The browser/server sandbox warning used a hardcoded amber (yellow) instead of the accent color. 3. The run-approval confirmation button used the destructive (red) tone instead of the standard accent button styling. 4. The extension window opened as a **full-screen grey backdrop takeover** rather than over Marinara's page. That grey takeover was a presentation choice in the trusted renderer, not a security requirement. ## What changed **Settings UI** - Enabled status and the sandbox warning now use `var(--primary)` accent tokens instead of emerald/amber. - The approval dialog drops `tone: "destructive"`, so the confirm button uses the standard accent styling. The confirmation step and full risk copy are unchanged. **Extension window presentation** - Replaced the full-viewport backdrop with a **floating panel** docked bottom-right, sized to its content (capped to 70vh). Marinara's page stays fully visible and interactive — the window is no longer modal. - The host forwards Marinara's resolved accent/surface/border colors into the sandbox; the bootstrap applies them as CSS variables so the window (and its buttons) match the current theme. - The bootstrap reports content size (`ui-resize`) so the host fits the panel; it no longer paints any page-covering backdrop. **Third-party parity (requested)** - These capabilities and styling are served by the shared sandbox document, so imported External Extensions get the identical window API and accent styling once they clear the same gates (`ENABLE_EXTERNAL_EXTENSIONS` + Danger Zone opt-in + exact-hash approval). A third-party extension can add or change UI only through this same sandboxed window — it still cannot reach Marinara's own DOM. Docs updated to state this explicitly. ### Security posture (unchanged) Making the window a smaller floating panel instead of a full-viewport overlay is strictly less surface. The iframe is still opaque-origin, `allow-scripts` only, `connect-src 'none'`; the extension still has no DOM/network/host access and only *describes* a window the trusted host renders as text. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Automated: `pnpm check` and `pnpm regression:extensions-security` (including the real macOS Seatbelt server-sandbox proof) pass. The regression now also asserts the window is a floating panel — it reports `ui-resize` and never paints a full-screen backdrop. ### Manual verification notes - Approve a Mari-authored ASCII-bunny browser extension and confirm the window opens as a bottom-right floating panel over the app (page still usable), styled with the accent, and closes via ✕. - Confirm the Settings enabled-status pill, sandbox warning, and approval dialog button all use the accent in light and dark themes. - Import a third-party browser extension that opens a window and confirm it gets the same panel + accent styling after the gates + approval. ## Docs and release impact - [x] Updated docs (CHANGELOG covered by #4006; `docs/extending/personal-extensions.md` updated here) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence Floating panel renders inside the sandbox iframe; screenshots to be added during manual verification. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Personal extension interfaces now open in compact, corner-docked floating panels instead of full-screen overlays. - Panels automatically resize to fit their content and match the app’s current accent theme. - Closing an extension panel returns the app to its normal state. - **Bug Fixes** - Updated extension settings alerts and status indicators to use consistent theme colors. - Improved sandbox security checks to prevent full-screen backdrop behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <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:03 +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#6196
No description provided.