houserules/packages/chess/src/ui
Joey Yakimowich-Payne cc0b7b0446
feat(ui): lobby profile picker integration
Adds a modifier profile picker next to the layout picker in the Lobby, and a header badge in GameView that surfaces the active profile's name.

Lobby:

- New <select data-testid="profile-picker"> loads entries from loadLibrary() on mount and refreshes when the ModifierProfileEditor closes (auto-selecting the most recently updated entry).

- Selecting a saved profile sets the active ModifierProfile; selecting 'Custom…' opens the existing editor modal.

- URL param ?modifierProfile=<b64> decodes + pre-selects even when the profile isn't in the local library, via a synthetic '<name> (from link)' option so the <select> can reflect the choice without collapsing it.

- handleCreate now sends payload.profile when a profile is selected and stashes modifier-profile-name in sessionStorage.

- handleJoin reads profile from the server's room.joined echo so late joiners see the badge on first paint.

GameView:

- New ModifierProfileBadge component mirrors LayoutBadge but reads modifier-profile-name from sessionStorage and uses fuchsia tones so it's visually distinct when both badges are present.

lobby-request.ts:

- OneShotRoomResult exposes the optional profile field the server now echoes (T19).

E2E:

- 2 new Playwright tests: 'create room with profile — badge shows in game' seeds the library via localStorage, selects the profile, creates the room, and asserts the badge text. 'URL pre-select loads profile in picker' base64-encodes a profile into ?modifierProfile= and verifies the picker shows the correct value + 'from link' synthetic label.

All 8 modifier-profiles e2e tests pass; bun run check green (1213/1213 unit tests).
2026-04-18 23:11:11 -06:00
..
Board.tsx feat(chess): preset-flexibility architecture — decouple HP, damage, piece-types, state, effects 2026-04-18 16:26:17 -06:00
GameView.tsx feat(ui): lobby profile picker integration 2026-04-18 23:11:11 -06:00
ImportExport.tsx feat(chess): polish UI with SVG pieces, motion animations, sound, and confetti 2026-04-17 12:04:56 -06:00
LayoutEditor.tsx feat(ui): per-instance modifier panel 2026-04-18 22:56:31 -06:00
LayoutPicker.tsx fix(chess): global Esc handler + stable test selectors for layouts e2e 2026-04-18 20:23:07 -06:00
Lobby.tsx feat(ui): lobby profile picker integration 2026-04-18 23:11:11 -06:00
ModifierProfileEditor.tsx feat(ui): per-instance modifier panel 2026-04-18 22:56:31 -06:00
PerInstancePanel.tsx feat(ui): per-instance modifier panel 2026-04-18 22:56:31 -06:00
PerTypePanel.tsx feat(ui): per-type modifier panel 2026-04-18 22:57:41 -06:00
Piece.tsx feat(chess): preset-flexibility architecture — decouple HP, damage, piece-types, state, effects 2026-04-18 16:26:17 -06:00
preset-overlays.tsx feat(chess): flesh out all six remaining stub presets 2026-04-17 16:16:11 -06:00
RulesDrawer.tsx feat(ui): modifier profile editor shell + rules drawer entry 2026-04-18 22:35:06 -06:00
RulesView.tsx feat(chess): piece-hp mechanic + extensible preset-hook infrastructure 2026-04-17 15:54:33 -06:00
SavePanel.tsx feat(chess): polish UI with SVG pieces, motion animations, sound, and confetti 2026-04-17 12:04:56 -06:00
VisualEffectLayer.tsx feat(chess): preset-flexibility architecture — decouple HP, damage, piece-types, state, effects 2026-04-18 16:26:17 -06:00