P14d: guest display names for players

- Players set a display name in the session panel ("Your name"); it persists
  (sessionStore.guestName) and is sent via a new `setName` message on join + edit.
- Server stores the name per connection and uses it in the roster + chat; the roster
  entry now also carries the player's character, so the GM sees "Alice · Lia".
- Realtime e2e: a player names themselves and the GM's roster/share update to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 17:28:32 +02:00
parent 4e13a5bdf4
commit d6eda054bf
8 changed files with 60 additions and 9 deletions
+5
View File
@@ -58,6 +58,11 @@ test('GM hosts a session; a player on another device sees live combat', async ({
await player.getByRole('button', { name: 'Open session panel' }).click();
await expect(player.getByText(/Who's here \(2\)/)).toBeVisible(); // host + player visible to everyone
// Guest name: the player names themselves; the GM's roster updates (share button is per-name).
await player.getByLabel('Your display name').fill('Alice');
await player.getByLabel('Your display name').blur();
await expect(gm.getByRole('button', { name: 'Share with Alice' })).toBeVisible({ timeout: 8000 });
// Chat: a GM table message reaches the player; the player's reply reaches the GM.
await gm.getByLabel('Chat message').fill('Welcome adventurers');
await gm.getByRole('button', { name: 'Send' }).click();