[PR #5305] [CLOSED] feat(chat): render the Beholder paper doll and open it from the toolbar #6720

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5305
Author: @GetBeholder
Created: 8/20/2026
Status: ❌ Closed

Base: staging ← Head: feat/beholder-paperdoll


📝 Commits (5)

  • 27c554a feat(chat): lay the Beholder panel out anatomically
  • 5be9f57 feat(chat): render the Beholder paper doll
  • c79b1d3 Merge branch 'staging' into feat/beholder-paperdoll
  • 46a0a46 Merge branch 'staging' into feat/beholder-paperdoll
  • ee3e7fc feat(chat): open the Beholder doll from the chat toolbar

📊 Changes

12 files changed (+3130 additions, -95 deletions)

View changed files

📝 packages/client/src/components/chat/BeholderChatSettingsPanel.tsx (+46 -95)
📝 packages/client/src/components/chat/ConversationView.tsx (+7 -0)
➕ packages/client/src/components/chat/beholder/BeholderDock.tsx (+156 -0)
➕ packages/client/src/components/chat/beholder/BeholderDoll.tsx (+104 -0)
➕ packages/client/src/components/chat/beholder/BeholderToolbarButton.tsx (+34 -0)
➕ packages/client/src/components/chat/beholder/colors.ts (+63 -0)
➕ packages/client/src/components/chat/beholder/dock.css (+70 -0)
➕ packages/client/src/components/chat/beholder/garment-data.ts (+19 -0)
➕ packages/client/src/components/chat/beholder/paperdoll.css (+1004 -0)
➕ packages/client/src/components/chat/beholder/paperdoll.ts (+1575 -0)
➕ packages/client/src/components/chat/beholder/state.ts (+44 -0)
📝 packages/client/src/localization/locales/en.json (+8 -0)

📄 Description

Linked issue

No separate issue — continues the Beholder work behind #5251, #5280, #5281 and #5284.

Why this change

The panel rendered tracked state as a text list. The reference extractor draws a body: a silhouette with a region per slot, tinted so an outline means the armour there is damaged and a fill means the body itself is hurt, the slot cards arranged around the figure, and a front/back flip for wounds on the back. Reading a character was meant to be looking at a figure, not parsing a list — and the distinction that matters in play (which side, how bad, covered or not) is exactly what a list flattens away.

My first attempt at this replaced that with a flat grid of my own design. That was the wrong call: there is no technical reason the original cannot be used, and it is a better design than what I substituted.

What changed

  • paperdoll.ts — the reference renderer, ported. It is the source file with type annotations added and nothing else changed, except: two functions dead in the original (formatSlotList, rowSide) dropped so it compiles under noUnusedLocals, one unused parameter renamed, and escapeHtml rewritten as an equivalent lookup table. Species families, off-body slots, the missing-limb cascade, damage tiers, wound severity encoding and the digest all come across as they are.
  • paperdoll.css — its stylesheet, plus the design tokens it depends on, scoped to .beholder-panel so nothing outside the panel is affected.
  • colors.ts, garment-data.ts, state.ts — the small modules it imports.
  • BeholderDoll.tsx — a thin component that feeds it state and delegates the controls the markup already draws: front/back, character tabs, layout switch.
  • The panel now renders that instead of a list.

Keeping it as markup rather than rebuilding it in JSX is deliberate: it stays diffable against the implementation it came from, so the two cannot quietly drift.

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

Boxes left for a human, and for a UI change that matters: I have not seen this render. pnpm install fails in my environment at the onnxruntime-node postinstall (it rejects CUDA 13), so I cannot run the app. It needs eyes in both themes and at drawer width before it is trusted.

What I could verify without that:

  • The port is faithful, and I checked rather than assumed. Diffing the ported file against its source with type annotations stripped leaves only the changes listed above — no logic differs.
  • Formatting changed nothing. Prettier reformatted the ported file to satisfy format:check; rendering the same state across all six layout/view combinations before and after produced a byte-identical 100 KB of markup (same SHA-256).
  • It renders. A headless run produces the silhouette (<svg class="bh-silhouette">, viewBox), per-slot regions (data-slot="chest"), the missing hatch (bh-part-missing), and worn/wound/held content. A character name containing <script> comes out escaped.
  • The client builds. Vite bundles it; the doll and the dock are code-split with their own CSS chunks.
  • Client typecheck 0 errors; prettier clean; check-locales.mjs clean.

Note on appearance

The doll brings its own palette and spacing tokens rather than adopting the host theme, because the point was to render as designed. If it should instead follow Marinara's light/dark tokens, that is a straightforward change to the token block — but it is a design decision, not a port decision, so I have not made it unilaterally.

Opening it

The doll previously rendered inside the chat settings drawer, under the agent's row — findable only if you knew it was there, and impossible to keep open while playing, which is the only time it is useful.

It now opens from a button in the chat toolbar, beside the other panel controls, into a dock on the right — which is where the reference extractor puts it in this host. It docks rather than floats because Marinara already knows how to make room for a right-side panel: opening it sets the same variable the tracker panel uses, so the chat shifts instead of being covered. The dock measures the app bar for its top offset and whatever already occupies the right edge for its horizontal offset, so it never parks on top of another panel. A narrow viewport gets the compact list layout and the dock becomes a bottom sheet.

The button appears only when Beholder is tracking the chat — the state it shows comes from that agent, so otherwise it would open empty while taking a toolbar slot from everyone who does not use it.

Not here yet

Per-slot manual editing and locks, and the directive bar.

Summary by CodeRabbit

  • New Features

    • Added a Beholder paper-doll display for equipment, body parts, wounds, damage, missing limbs, and held items.
    • Added access through the conversation toolbar, with responsive desktop and mobile dock views.
    • Added front/back views, character selection, and paired, column, and list layouts.
    • Layout preferences now persist between sessions.
    • Added responsive rendering and clearer indicators for missing or damaged areas.
  • Bug Fixes

    • Improved handling of alternate garment names and color descriptions.
    • Added clearer loading, error, empty, and unavailable-character states.
    • Added derived status for dependent missing body parts.

🔄 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/5305 **Author:** [@GetBeholder](https://github.com/GetBeholder) **Created:** 8/20/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `feat/beholder-paperdoll` --- ### 📝 Commits (5) - [`27c554a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/27c554a3ce2b0c6d46f1ee4dd45a9e1fd9cbdfef) feat(chat): lay the Beholder panel out anatomically - [`5be9f57`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5be9f57f1cb8d3863c6e66466af6fb0cf4547893) feat(chat): render the Beholder paper doll - [`c79b1d3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c79b1d3f7ed9f209e4fe04137523860f75b312c1) Merge branch 'staging' into feat/beholder-paperdoll - [`46a0a46`](https://github.com/Pasta-Devs/Marinara-Engine/commit/46a0a46eb6b534261b2a286c6740249480ccac6b) Merge branch 'staging' into feat/beholder-paperdoll - [`ee3e7fc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ee3e7fcb7223d863c279a717bda164a3abb799e4) feat(chat): open the Beholder doll from the chat toolbar ### 📊 Changes **12 files changed** (+3130 additions, -95 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/BeholderChatSettingsPanel.tsx` (+46 -95) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+7 -0) ➕ `packages/client/src/components/chat/beholder/BeholderDock.tsx` (+156 -0) ➕ `packages/client/src/components/chat/beholder/BeholderDoll.tsx` (+104 -0) ➕ `packages/client/src/components/chat/beholder/BeholderToolbarButton.tsx` (+34 -0) ➕ `packages/client/src/components/chat/beholder/colors.ts` (+63 -0) ➕ `packages/client/src/components/chat/beholder/dock.css` (+70 -0) ➕ `packages/client/src/components/chat/beholder/garment-data.ts` (+19 -0) ➕ `packages/client/src/components/chat/beholder/paperdoll.css` (+1004 -0) ➕ `packages/client/src/components/chat/beholder/paperdoll.ts` (+1575 -0) ➕ `packages/client/src/components/chat/beholder/state.ts` (+44 -0) 📝 `packages/client/src/localization/locales/en.json` (+8 -0) </details> ### 📄 Description ## Linked issue No separate issue — continues the Beholder work behind #5251, #5280, #5281 and #5284. ## Why this change The panel rendered tracked state as a text list. The reference extractor draws a **body**: a silhouette with a region per slot, tinted so an **outline** means the armour there is damaged and a **fill** means the body itself is hurt, the slot cards arranged around the figure, and a front/back flip for wounds on the back. Reading a character was meant to be looking at a figure, not parsing a list — and the distinction that matters in play (which side, how bad, covered or not) is exactly what a list flattens away. My first attempt at this replaced that with a flat grid of my own design. That was the wrong call: there is no technical reason the original cannot be used, and it is a better design than what I substituted. ## What changed - **`paperdoll.ts`** — the reference renderer, ported. It is the source file with type annotations added and **nothing else changed**, except: two functions dead in the original (`formatSlotList`, `rowSide`) dropped so it compiles under `noUnusedLocals`, one unused parameter renamed, and `escapeHtml` rewritten as an equivalent lookup table. Species families, off-body slots, the missing-limb cascade, damage tiers, wound severity encoding and the digest all come across as they are. - **`paperdoll.css`** — its stylesheet, plus the design tokens it depends on, scoped to `.beholder-panel` so nothing outside the panel is affected. - **`colors.ts`, `garment-data.ts`, `state.ts`** — the small modules it imports. - **`BeholderDoll.tsx`** — a thin component that feeds it state and delegates the controls the markup already draws: front/back, character tabs, layout switch. - The panel now renders that instead of a list. Keeping it as markup rather than rebuilding it in JSX is deliberate: it stays diffable against the implementation it came from, so the two cannot quietly drift. ## 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 Boxes left for a human, and for a UI change that matters: **I have not seen this render.** `pnpm install` fails in my environment at the `onnxruntime-node` postinstall (it rejects CUDA 13), so I cannot run the app. It needs eyes in both themes and at drawer width before it is trusted. What I could verify without that: - **The port is faithful, and I checked rather than assumed.** Diffing the ported file against its source with type annotations stripped leaves only the changes listed above — no logic differs. - **Formatting changed nothing.** Prettier reformatted the ported file to satisfy `format:check`; rendering the same state across all six layout/view combinations before and after produced a **byte-identical 100 KB of markup** (same SHA-256). - **It renders.** A headless run produces the silhouette (`<svg class="bh-silhouette">`, `viewBox`), per-slot regions (`data-slot="chest"`), the missing hatch (`bh-part-missing`), and worn/wound/held content. A character name containing `<script>` comes out escaped. - **The client builds.** Vite bundles it; the doll and the dock are code-split with their own CSS chunks. - Client typecheck **0 errors**; prettier clean; `check-locales.mjs` clean. ### Note on appearance The doll brings its own palette and spacing tokens rather than adopting the host theme, because the point was to render as designed. If it should instead follow Marinara's light/dark tokens, that is a straightforward change to the token block — but it is a design decision, not a port decision, so I have not made it unilaterally. ## Opening it The doll previously rendered inside the chat settings drawer, under the agent's row — findable only if you knew it was there, and impossible to keep open while playing, which is the only time it is useful. It now opens from a **button in the chat toolbar**, beside the other panel controls, into a **dock on the right** — which is where the reference extractor puts it in this host. It docks rather than floats because Marinara already knows how to make room for a right-side panel: opening it sets the same variable the tracker panel uses, so the chat shifts instead of being covered. The dock measures the app bar for its top offset and whatever already occupies the right edge for its horizontal offset, so it never parks on top of another panel. A narrow viewport gets the compact list layout and the dock becomes a bottom sheet. The button appears only when Beholder is tracking the chat — the state it shows comes from that agent, so otherwise it would open empty while taking a toolbar slot from everyone who does not use it. ### Not here yet Per-slot manual editing and locks, and the directive bar. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a Beholder paper-doll display for equipment, body parts, wounds, damage, missing limbs, and held items. - Added access through the conversation toolbar, with responsive desktop and mobile dock views. - Added front/back views, character selection, and paired, column, and list layouts. - Layout preferences now persist between sessions. - Added responsive rendering and clearer indicators for missing or damaged areas. - **Bug Fixes** - Improved handling of alternate garment names and color descriptions. - Added clearer loading, error, empty, and unavailable-character states. - Added derived status for dependent missing body parts. <!-- 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:13: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#6720
No description provided.