Skip to content

fix(inventory): render genre-declared currency noun instead of "gold"#160

Merged
slabgorb merged 1 commit intodevelopfrom
fix/inventory-currency-label-genre-aware
Apr 24, 2026
Merged

fix(inventory): render genre-declared currency noun instead of "gold"#160
slabgorb merged 1 commit intodevelopfrom
fix/inventory-currency-label-genre-aware

Conversation

@slabgorb
Copy link
Copy Markdown
Owner

Summary

  • InventoryPanel now renders {gold} {currency_name ?? "coin"} instead of the hardcoded {gold} gold.
  • Paired with sidequest-server develop 007fc08 which adds currency_name to InventoryPayload (read from active pack's inventory.yaml::currency.name).

Why

Pingpong entry: "Inventory currency reads 500 gold in Space Opera — genre-agnostic fantasy leak". Same bug affects every non-fantasy pack — MW reads "Salvage", space_opera reads "credits", spaghetti_western reads "Dollars" in their content, but the UI was throwing all that data away.

Fallback

When the server doesn't send currency_name (legacy pre-fix server), the UI renders the genre-agnostic literal "coin" — NOT "gold". No silent fantasy fallback.

Test plan

  • InventoryPanel.test.tsx — 2 new tests: populated currency_name renders "500 credits" + asserts absence of "gold"; missing field falls back to "5 coin".
  • Playtest: load Space Opera with the updated server, open Inventory tab, confirm header reads "500 credits" not "500 gold".
  • Same for Mutant Wasteland → "42 Salvage".

🤖 Generated with Claude Code

Pingpong 2026-04-24: Space Opera inventory reads "500 gold" — a fantasy
leak into a genre whose lore uses "debt / collateral / bought my way
out" (i.e. credits). Same bug applies to every non-fantasy pack (MW
"Salvage", neon_dystopia, etc).

Server side already landed (sidequest-server develop 007fc08): the
InventoryPayload now carries ``currency_name`` populated from the
active pack's ``inventory.yaml::currency.name``. This change wires
the UI to read and render it.

- InventoryData gains optional ``currency_name?: string | null``.
- InventoryPanel renders ``{gold} {currency_name ?? "coin"}`` —
  "coin" is deliberately genre-agnostic so a legacy pre-fix server
  (no currency_name field) never leaks "gold" into a cyberpunk or
  post-apocalyptic UI. No silent fallback to a fantasy default.

Wiring tests added to InventoryPanel.test.tsx:
- Renders "500 credits" when payload carries currency_name="credits"
  and asserts "gold" is NOT in the rendered output.
- Falls back to "5 coin" when currency_name is absent (legacy-server
  payload).

Requires sidequest-server develop at 007fc08 or later. Older servers
send no currency_name → UI shows "coin" fallback until server updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@slabgorb slabgorb merged commit af9f1d8 into develop Apr 24, 2026
1 check failed
@slabgorb slabgorb deleted the fix/inventory-currency-label-genre-aware branch April 24, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant