[GH-ISSUE #4081] [Issue]: Hierarchical Maps agent (Game mode) — map background mismatches narrative box, and settings menu is visually inconsistent with other agents #2207

Closed
opened 2026-10-21 05:46:16 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Jul 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4081

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Two visual-consistency problems with the Hierarchical Maps agent in Game mode. Both stem from the same architectural fact: the maps agent is a vendored capability bundle (agent id "hierarchical-maps") rendered through <CapabilityElement> as the custom element marinara-capability-hierarchical-maps (CapabilityElement.tsx:271, :352-359) — its entire UI (settings and map surface) is drawn by the bundle's client.js, not by app JSX.

1. Map background doesn't match the narrative box

The map panel forces a different CSS-variable family than the narrative box:

  • Map surface: GameMapPanel's shell (GAME_MAP_PANEL_CLASS, GameMap.tsx:43-46) uses bg-[var(--marinara-chat-chrome-panel-bg)] and applies NEUTRAL_SURFACE_VARIABLES (neutral-surface-styles.ts:1-2), which remaps --background, --card, --secondary, --muted to the chat-chrome panel palette for everything mounted inside. The vendored bundle paints itself with var(--background)/var(--card)/etc., so inside the panel those resolve to --marinara-chat-chrome-panel-* rather than the app's real tokens.
  • Narrative box: GameNarration.tsx:4698 uses bg-[var(--muted)]/20 (real tokens), and its widget/log cards use bg-[var(--card)] (:4298, :4429).

So the map ends up on the chat-chrome panel palette while the narrative box is on the app's --card/--muted palette — two different families, hence the mismatch. Fix direction: align the map panel surface with the narrative box palette (either stop remapping --background/--card for the map panel, or drive the map surface from the same tokens the narrative box uses). Map render sites: desktop GameMap.tsx:776-786, mobile :1096-1110; mounted in GameSurface.tsx:11210-11230.

2. Maps settings menu looks completely different from other agent menus

Every other agent renders through the shared AgentSettingsCard / AgentSettingsToggle shell (ChatSettingsDrawer.tsx:10070-10121 — rounded-xl border bg-[var(--secondary)]/70 p-3, icon + title/description header, toggle rows). The Hierarchical Maps agent instead drops a raw <CapabilityElement view="settings"> into a bare wrapper:

Because the header, toggles, spacing, and typography are all drawn by the vendored client.js, it doesn't inherit the standard card look and reads as visually inconsistent. Fix direction: wrap the maps settings CapabilityElement in the standard AgentSettingsCard shell (icon + title/description header, matching border/background/padding) so it lines up with the Illustrator and other agent cards.

  • #4074 — makes Hierarchical Maps opt-in in the setup wizard (adjacent, but that's feature-gating, not the visual bugs above).

Manual verification (for the implementer — leave unchecked)

  • In Game mode, the map panel background visually matches the narrative box background (both light and dark themes)
  • The Hierarchical Maps settings menu uses the same card shell (border/background/header) as other agent menus
  • No regression to the Roleplay-mode maps settings or to the map's own interactive UI
Originally created by @SpicyMarinara on GitHub (Jul 25, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4081 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Two visual-consistency problems with the **Hierarchical Maps** agent in Game mode. Both stem from the same architectural fact: the maps agent is a **vendored capability bundle** (`agent id "hierarchical-maps"`) rendered through `<CapabilityElement>` as the custom element `marinara-capability-hierarchical-maps` ([CapabilityElement.tsx:271](packages/client/src/components/capabilities/CapabilityElement.tsx#L271), [:352-359](packages/client/src/components/capabilities/CapabilityElement.tsx#L352-L359)) — its entire UI (settings and map surface) is drawn by the bundle's `client.js`, not by app JSX. ## 1. Map background doesn't match the narrative box The map panel forces a **different CSS-variable family** than the narrative box: - **Map surface:** `GameMapPanel`'s shell (`GAME_MAP_PANEL_CLASS`, [GameMap.tsx:43-46](packages/client/src/components/game/GameMap.tsx#L43-L46)) uses `bg-[var(--marinara-chat-chrome-panel-bg)]` **and** applies `NEUTRAL_SURFACE_VARIABLES` ([neutral-surface-styles.ts:1-2](packages/client/src/components/ui/neutral-surface-styles.ts#L1-L2)), which **remaps** `--background`, `--card`, `--secondary`, `--muted` to the chat-chrome panel palette for everything mounted inside. The vendored bundle paints itself with `var(--background)`/`var(--card)`/etc., so inside the panel those resolve to `--marinara-chat-chrome-panel-*` rather than the app's real tokens. - **Narrative box:** [GameNarration.tsx:4698](packages/client/src/components/game/GameNarration.tsx#L4698) uses `bg-[var(--muted)]/20` (real tokens), and its widget/log cards use `bg-[var(--card)]` ([:4298](packages/client/src/components/game/GameNarration.tsx#L4298), [:4429](packages/client/src/components/game/GameNarration.tsx#L4429)). So the map ends up on the chat-chrome panel palette while the narrative box is on the app's `--card`/`--muted` palette — two different families, hence the mismatch. **Fix direction:** align the map panel surface with the narrative box palette (either stop remapping `--background`/`--card` for the map panel, or drive the map surface from the same tokens the narrative box uses). Map render sites: desktop [GameMap.tsx:776-786](packages/client/src/components/game/GameMap.tsx#L776-L786), mobile [:1096-1110](packages/client/src/components/game/GameMap.tsx#L1096-L1110); mounted in [GameSurface.tsx:11210-11230](packages/client/src/components/game/GameSurface.tsx#L11210-L11230). ## 2. Maps settings menu looks completely different from other agent menus Every other agent renders through the shared `AgentSettingsCard` / `AgentSettingsToggle` shell ([ChatSettingsDrawer.tsx:10070-10121](packages/client/src/components/chat/ChatSettingsDrawer.tsx#L10070-L10121) — `rounded-xl border bg-[var(--secondary)]/70 p-3`, icon + title/description header, toggle rows). The Hierarchical Maps agent instead drops a raw `<CapabilityElement view="settings">` into a bare wrapper: - Game branch: [ChatSettingsDrawer.tsx:8888-8913](packages/client/src/components/chat/ChatSettingsDrawer.tsx#L8888-L8913) (`bg-[var(--background)]/45`) - Roleplay branch: [:9041-9066](packages/client/src/components/chat/ChatSettingsDrawer.tsx#L9041-L9066) Because the header, toggles, spacing, and typography are all drawn by the vendored `client.js`, it doesn't inherit the standard card look and reads as visually inconsistent. **Fix direction:** wrap the maps settings `CapabilityElement` in the standard `AgentSettingsCard` shell (icon + title/description header, matching border/background/padding) so it lines up with the Illustrator and other agent cards. ## Related - #4074 — makes Hierarchical Maps opt-in in the setup wizard (adjacent, but that's feature-gating, not the visual bugs above). ## Manual verification (for the implementer — leave unchecked) - [ ] In Game mode, the map panel background visually matches the narrative box background (both light and dark themes) - [ ] The Hierarchical Maps settings menu uses the same card shell (border/background/header) as other agent menus - [ ] No regression to the Roleplay-mode maps settings or to the map's own interactive UI
bsakaguchi 2026-10-21 05:46:16 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jul 25, 2026):

I’m implementing this as part of the active open-issue sweep in #4077. No competing issue-linked branch or open PR was found before starting.

<!-- gh-comment-id:5077586775 --> @SpicyMarinara commented on GitHub (Jul 25, 2026): I’m implementing this as part of the active open-issue sweep in #4077. No competing issue-linked branch or open PR was found before starting.
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#2207
No description provided.