Skip to content

Add Hotseat functionality#231

Draft
lordscarlet wants to merge 16 commits into
YourDeveloperFriend:mainfrom
lordscarlet:feature/hotseat
Draft

Add Hotseat functionality#231
lordscarlet wants to merge 16 commits into
YourDeveloperFriend:mainfrom
lordscarlet:feature/hotseat

Conversation

@lordscarlet

Copy link
Copy Markdown
Contributor

Overview

Adds hotseat (local multiplayer) game mode to support multiple players on a single device, and quicker development

Key Changes

  • Database: Added hotseat and ownerId columns to the games table with migration supporting fresh database installs
  • API: Updated game endpoints to include the hotseat field in responses
  • Engine: Modified player ID handling to support both numeric user IDs and string player names
  • UI: Added visual hotseat badge on game cards and create game form with player name inputs

Screenshots

The following screenshots show the hotseat feature in action (captured at 1876×1200 resolution):

  1. image

    Shows the hotseat toggle and ability to add custom player names

  2. image Displays hotseat badge identifying the game mode
  3. image

    Shows the game board during active hotseat play

Testing Notes

⚠️ Important: The new e2e tests have been validated on a separate Docker container with a fresh database to ensure proper migration handling. The original e2e test suite is highly deterministic to the specific test database structure, making it difficult to create regression tests that work on both fresh and existing databases.

Recommendations for pre-merge testing:

  • Run these changes against a larger, more realistic game database to catch any potential regression errors
  • Verify hotseat games behave correctly with existing game types and rule variations
  • Consider load testing with multiple concurrent hotseat games

The fresh database e2e tests pass without errors, confirming the migration and basic hotseat functionality work correctly on clean installs.

Closes #2

Merge from YourDeveloperFriend
- Add hotseat column to Games table with migration
- Add ownerId column to track game creator
- Convert playerIds from INTEGER[] to TEXT[] to support both user IDs and string names
- Update game creation flow to support hotseat mode with custom player names
- Update username components to handle string player names without links
- Add hotseat badges to game cards, active game headers, and final overview
- Update undo permissions to allow hotseat game owner to undo actions
- Update game visibility filters to include owner-based filtering
- Hotseat games are automatically unlisted and prevent regular join/leave operations
- Simplified hotseat game test to avoid Selenium React state update issues
- Test now verifies game creation and startup with default player names
- Added longer wait times for buildTrack UI to appear (500ms)
- Enhanced event dispatching with pointer events for better React integration
- Hotseat test now passes successfully
- Fix .gitignore syntax error (missing newline)
- Fix active player comparison using String() for type safety
- Add null check for activePlayerId in kick endpoint
- Improve deleteGame ownership logic for hotseat games
- Remove redundant hotseat validation check
@lordscarlet

Copy link
Copy Markdown
Contributor Author

@YourDeveloperFriend I am really nervous about this one, for obvious reasons. I have it as a draft because it really could use someone pulling it down and testing with a better volume of data than I have (with a backup just in case, of course)

@lordscarlet lordscarlet changed the title Add Hosteat functionality Add Hotseat functionality May 2, 2026
lordscarlet and others added 2 commits May 2, 2026 09:37
Resolved conflicts:
- .gitignore: keep both screenshots dir and seed script entries
- .vscode/tasks.json: trivial whitespace conflict
- awaiting_player.tsx: adopt main's useAwaitingGameIds refactor (callers already updated)
- player_stats.tsx: keep main's expanded row UI, add typeof guard for hotseat string playerIds on LoginButton
- e2e/create_game_test.ts: include main's map selector steps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
player.playerId is number | string in hotseat games.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

[General] Create HotSeats

1 participant