[PR #7343] [MERGED] fix(trackers): show package dock buttons in the Tracker Panel top bar #7690

Closed
opened 2026-10-24 04:06:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7343
Author: @SpicyMarinara
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/7280-tracker-dock-buttons


📝 Commits (7)

  • 14765a3 fix(trackers): show package dock buttons in the Tracker Panel top bar
  • a73ec07 Merge origin/staging into fix/7280-tracker-dock-buttons
  • a3fa5e2 fix(trackers): keep package buttons reachable in a narrow Tracker Panel
  • 73fc443 Merge origin/fix/7280-tracker-dock-buttons (staging sync) into fix/7280-tracker-dock-buttons
  • cba25c9 Merge origin/staging into fix/7280-tracker-dock-buttons
  • d6b5567 Merge origin/staging into fix/7280-tracker-dock-buttons
  • a0957ee Move the CHANGELOG entry away from other open PRs

📊 Changes

5 files changed (+208 additions, -8 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
➕ e2e/tracker-panel-package-buttons.e2e.ts (+160 -0)
📝 packages/client/src/components/chat/RoleplayHUD.tsx (+9 -4)
📝 packages/client/src/features/tracker-panel/components/TrackerDataSidebar.tsx (+19 -1)
📝 packages/client/src/features/tracker-panel/components/TrackerSidebarHeader.tsx (+19 -3)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Refs #7280

This PR fixes the Engine half of #7280 (the missing dock button). The X-Admin-Secret half is a Quartermaster package bug and belongs in Pasta-Devs/Marinara-Agents (assigned to @newfiesledneck); details below.

Why this change

  • Quartermaster's dock (portrait ring, settings, outfits, inventory management) only opens from the package's own toolbar button. Before 2.5.0 that button sat in the Roleplay HUD row above the Tracker Panel. The chat window redesign (ff04bb6c1) moved tracker controls into the Trackers window and, with the Tracker Panel chosen, showed "trackers only in the panel". The panel mounts each package's tracker view but never its roleplay-tracker toolbar view, so with the Tracker Panel on there was no way to open the dock, on computers or phones. The 2.5.0 What's New and docs/agents/built-in-agents.md both still say the dock opens "from a button above the Tracker Panel".
  • This affects every package that puts a launcher in the roleplay-tracker slot, not only Quartermaster.

What changed

  • The Tracker Panel's top bar now shows the toolbar view of each active, chat-enabled package with the roleplay-tracker slot, between the dice and the settings button. It uses the same package set the phone tracker strip shows (selectRoleplayTrackerPackages + partitionTrackerCapabilityPackages(...).other): Beholder keeps its own control window and Memory Nag its Tracker Panel section. The same TrackerDataSidebar renders the docked desktop panel, the phone panel and the popped-out panel, so all three get the buttons.
  • The buttons get a header-sized toolbarButtonClass matching the header's own icon buttons (theme variables only; aria-pressed shows them lit while a dock is open). RoleplayTrackerCapability takes an optional buttonClassName for this; every other host keeps the chat toolbar class.
  • In a panel narrower than 160px (the docked minimum is 96px, e.g. a 1024px window) the package buttons get their own row under the top bar, and too many scroll sideways, so the panel's own dice, settings and help buttons keep their place (#7188). Package loading/failure tiles take the header's button size. Without package buttons the top bar is unchanged.
  • New e2e e2e/tracker-panel-package-buttons.e2e.ts mounts a fixture package (toolbar button + tracker section) with the Tracker Panel on and checks the button is in the top bar, sized like the header buttons, and works, on desktop and phone projects; a second desktop test checks the minimum-width panel puts it on its own row inside the panel.
  • CHANGELOG entry under [Unreleased].

X-Admin-Secret (package-owned, not changed here)

  • Package client code calls fetch itself; the Engine gives packages no fetch helper. Every /api/<package>/* route goes through the Engine's privileged gate (registerCapabilityPrivilegedRoutes → requirePrivilegedAccess, packages/server/src/services/capability-packages/capability-route-registration.service.ts:174, packages/server/src/middleware/privileged-gate.ts:71), so a non-loopback client needs X-Admin-Secret. The Engine's global fetch shim (packages/client/src/lib/csrf-fetch.ts) adds only the CSRF header.
  • Quartermaster's qmRequest in packages/quartermaster/src/00-api.js (Marinara-Agents staging, lines 7-19) builds its headers from scratch and never sends X-Admin-Secret. Fix there the same way Memory Nag 1.1.1 (src/.../memory-nag/api.ts lines 4-20) and Relationship Tracker 0.6.2 did: read localStorage["marinara_admin_secret"] and send it as X-Admin-Secret. The dock's <img src> URLs (QM.itemImageUrl, QM.slotIconUrl, QM.outfitPortraitUrl, lines ~193-229) hit the same gated routes and cannot carry a header, so remote clients will also need those images fetched with the header (blob URLs).

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

Manual verification notes

  • Manually verify on a computer: with Quartermaster installed and added to a Roleplay chat, and the Tracker Panel turned on in Chat Settings, the backpack button shows in the Tracker Panel's top bar and opens and closes the dock.
  • Manually verify on a phone: open the Tracker Panel from its bubble; the same button shows in its top bar and opens the dock above the panel.
  • Manually verify with the Tracker Panel popped out into its own window: the button shows there; the dock opens in the main window.
  • Manually verify with the Tracker Panel off: the Trackers window still shows the package button in its drawer, and phones still show it in the tracker strip, once.
  • Manually verify a very narrow docked panel still keeps its dice, settings and help buttons usable.
  • Manually verify in light and dark themes that the button matches the header's other buttons.

Agent-run checks: pnpm check passed; pnpm localization:check passed (no new strings); node scripts/regressions/tracker-gallery-ui.regression.mjs passed; Playwright on desktop-chromium and mobile-chromium: e2e/tracker-panel-package-buttons.e2e.ts, e2e/docked-tracker-panel.e2e.ts and e2e/tracker-window-routing.e2e.ts all passed (13 passed, 11 skipped by their own project guards). With the TrackerDataSidebar change reverted, the new e2e fails on desktop (button not found in the top bar). mobile-webkit was not run locally. Local CodeRabbit: one finding (launchers clipped in a narrow panel), fixed in a3fa5e28b; the rerun after that fix hit the CodeRabbit rate limit, so it has not been reviewed locally again.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

CHANGELOG updated. No docs change: docs/agents/built-in-agents.md already says the dock opens from the launcher above the Tracker Panel, which is true again.

UI evidence (if applicable)

The e2e saves tracker-panel-package-button.png per project in its test output: the fixture button sits between the dice and the settings button, lit while its dock is open, on desktop and on a phone.

Summary by CodeRabbit

  • New Features
    • Tracker agent buttons, including Quartermaster’s dock button, are available in the Tracker Panel header on desktop and mobile.
    • The header adapts to narrow panels by moving launcher buttons to a separate row, keeping them within the panel and accessible alongside the panel controls.

🔄 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/7343 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/7280-tracker-dock-buttons` --- ### 📝 Commits (7) - [`14765a3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/14765a39fa25b2dc1f2bdb0b65c3975dc52842aa) fix(trackers): show package dock buttons in the Tracker Panel top bar - [`a73ec07`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a73ec07c10d8e027fdca8e00423d1efc0f28c5ec) Merge origin/staging into fix/7280-tracker-dock-buttons - [`a3fa5e2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a3fa5e28bce05f80bf31cd7f88a7a850b3668184) fix(trackers): keep package buttons reachable in a narrow Tracker Panel - [`73fc443`](https://github.com/Pasta-Devs/Marinara-Engine/commit/73fc4438e5c00a0db855b7afcb0607fe84b541a6) Merge origin/fix/7280-tracker-dock-buttons (staging sync) into fix/7280-tracker-dock-buttons - [`cba25c9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cba25c941226d758f9398adbe891d45a48d3e0aa) Merge origin/staging into fix/7280-tracker-dock-buttons - [`d6b5567`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d6b556774df34073d46f656ecd11f520347971d2) Merge origin/staging into fix/7280-tracker-dock-buttons - [`a0957ee`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a0957ee19bf1edc67b95daf941f376415bf4b924) Move the CHANGELOG entry away from other open PRs ### 📊 Changes **5 files changed** (+208 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) ➕ `e2e/tracker-panel-package-buttons.e2e.ts` (+160 -0) 📝 `packages/client/src/components/chat/RoleplayHUD.tsx` (+9 -4) 📝 `packages/client/src/features/tracker-panel/components/TrackerDataSidebar.tsx` (+19 -1) 📝 `packages/client/src/features/tracker-panel/components/TrackerSidebarHeader.tsx` (+19 -3) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Refs #7280 This PR fixes the Engine half of #7280 (the missing dock button). The X-Admin-Secret half is a Quartermaster package bug and belongs in Pasta-Devs/Marinara-Agents (assigned to @newfiesledneck); details below. ## Why this change - Quartermaster's dock (portrait ring, settings, outfits, inventory management) only opens from the package's own toolbar button. Before 2.5.0 that button sat in the Roleplay HUD row above the Tracker Panel. The chat window redesign (ff04bb6c1) moved tracker controls into the Trackers window and, with the Tracker Panel chosen, showed "trackers only in the panel". The panel mounts each package's `tracker` view but never its `roleplay-tracker` `toolbar` view, so with the Tracker Panel on there was no way to open the dock, on computers or phones. The 2.5.0 What's New and `docs/agents/built-in-agents.md` both still say the dock opens "from a button above the Tracker Panel". - This affects every package that puts a launcher in the `roleplay-tracker` slot, not only Quartermaster. ## What changed - The Tracker Panel's top bar now shows the `toolbar` view of each active, chat-enabled package with the `roleplay-tracker` slot, between the dice and the settings button. It uses the same package set the phone tracker strip shows (`selectRoleplayTrackerPackages` + `partitionTrackerCapabilityPackages(...).other`): Beholder keeps its own control window and Memory Nag its Tracker Panel section. The same `TrackerDataSidebar` renders the docked desktop panel, the phone panel and the popped-out panel, so all three get the buttons. - The buttons get a header-sized `toolbarButtonClass` matching the header's own icon buttons (theme variables only; `aria-pressed` shows them lit while a dock is open). `RoleplayTrackerCapability` takes an optional `buttonClassName` for this; every other host keeps the chat toolbar class. - In a panel narrower than 160px (the docked minimum is 96px, e.g. a 1024px window) the package buttons get their own row under the top bar, and too many scroll sideways, so the panel's own dice, settings and help buttons keep their place (#7188). Package loading/failure tiles take the header's button size. Without package buttons the top bar is unchanged. - New e2e `e2e/tracker-panel-package-buttons.e2e.ts` mounts a fixture package (toolbar button + tracker section) with the Tracker Panel on and checks the button is in the top bar, sized like the header buttons, and works, on desktop and phone projects; a second desktop test checks the minimum-width panel puts it on its own row inside the panel. - CHANGELOG entry under [Unreleased]. ### X-Admin-Secret (package-owned, not changed here) - Package client code calls `fetch` itself; the Engine gives packages no fetch helper. Every `/api/<package>/*` route goes through the Engine's privileged gate (`registerCapabilityPrivilegedRoutes` → `requirePrivilegedAccess`, `packages/server/src/services/capability-packages/capability-route-registration.service.ts:174`, `packages/server/src/middleware/privileged-gate.ts:71`), so a non-loopback client needs `X-Admin-Secret`. The Engine's global fetch shim (`packages/client/src/lib/csrf-fetch.ts`) adds only the CSRF header. - Quartermaster's `qmRequest` in `packages/quartermaster/src/00-api.js` (Marinara-Agents `staging`, lines 7-19) builds its headers from scratch and never sends `X-Admin-Secret`. Fix there the same way Memory Nag 1.1.1 (`src/.../memory-nag/api.ts` lines 4-20) and Relationship Tracker 0.6.2 did: read `localStorage["marinara_admin_secret"]` and send it as `X-Admin-Secret`. The dock's `<img src>` URLs (`QM.itemImageUrl`, `QM.slotIconUrl`, `QM.outfitPortraitUrl`, lines ~193-229) hit the same gated routes and cannot carry a header, so remote clients will also need those images fetched with the header (blob URLs). ## 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` ### Manual verification notes - Manually verify on a computer: with Quartermaster installed and added to a Roleplay chat, and the Tracker Panel turned on in Chat Settings, the backpack button shows in the Tracker Panel's top bar and opens and closes the dock. - Manually verify on a phone: open the Tracker Panel from its bubble; the same button shows in its top bar and opens the dock above the panel. - Manually verify with the Tracker Panel popped out into its own window: the button shows there; the dock opens in the main window. - Manually verify with the Tracker Panel off: the Trackers window still shows the package button in its drawer, and phones still show it in the tracker strip, once. - Manually verify a very narrow docked panel still keeps its dice, settings and help buttons usable. - Manually verify in light and dark themes that the button matches the header's other buttons. Agent-run checks: `pnpm check` passed; `pnpm localization:check` passed (no new strings); `node scripts/regressions/tracker-gallery-ui.regression.mjs` passed; Playwright on desktop-chromium and mobile-chromium: `e2e/tracker-panel-package-buttons.e2e.ts`, `e2e/docked-tracker-panel.e2e.ts` and `e2e/tracker-window-routing.e2e.ts` all passed (13 passed, 11 skipped by their own project guards). With the TrackerDataSidebar change reverted, the new e2e fails on desktop (button not found in the top bar). mobile-webkit was not run locally. Local CodeRabbit: one finding (launchers clipped in a narrow panel), fixed in a3fa5e28b; the rerun after that fix hit the CodeRabbit rate limit, so it has not been reviewed locally again. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) CHANGELOG updated. No docs change: `docs/agents/built-in-agents.md` already says the dock opens from the launcher above the Tracker Panel, which is true again. ## UI evidence (if applicable) The e2e saves `tracker-panel-package-button.png` per project in its test output: the fixture button sits between the dice and the settings button, lit while its dock is open, on desktop and on a phone. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Tracker agent buttons, including Quartermaster’s dock button, are available in the Tracker Panel header on desktop and mobile. * The header adapts to narrow panels by moving launcher buttons to a separate row, keeping them within the panel and accessible alongside the panel controls. <!-- 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-24 04:06:34 +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#7690
No description provided.