Skip to content

feat(ui): let players pick a hero class and color per agent - #6

Open
link82 wants to merge 1 commit into
FulAppiOS:mainfrom
Crunchy-Bytes-Team:feat/hero-look-picker
Open

feat(ui): let players pick a hero class and color per agent#6
link82 wants to merge 1 commit into
FulAppiOS:mainfrom
Crunchy-Bytes-Team:feat/hero-look-picker

Conversation

@link82

@link82 link82 commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • Add a Hero section to the detail panel so you can pick class (Warrior / Archer / Pawn) and color per agent.
  • Store the choice in localStorage, keyed by source + cwd + name, so a new session in the same project keeps the look.
  • Respawn the village sprite when class or color changes.
  • Keep the panel open while using the picker: raise it above toasts, and ignore Phaser background clicks whose target is not the canvas.

Client-only; no server changes. TypeScript stays strict (no any). Identifiers and UI copy are English.

Test plan

  • cd client && bun test src/heroLooks.test.ts
  • Select an agent → Hero section is visible (Appearance, class buttons, color swatches).
  • Click Pawn (or another class): the village sprite updates and the panel stays open.
  • Click a color swatch: name color / sprite look updates; panel stays open.
  • Reload the app: the same agent (same project + name) still has the custom look.
  • Click Reset: default class/color returns.
  • With an in-app toast visible in the top-right, click a class/color control — the panel must not close.

Made with Cursor

Persist the choice in localStorage keyed by source + cwd + name so a new
session in the same project keeps the look. Overlay clicks no longer
deselect the detail panel (z-index above toasts + ignore Phaser hits
that did not land on the canvas).
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