Skip to content

feat: post-ready map vote#504

Draft
garrappachc wants to merge 23 commits intomasterfrom
feat/post-ready-map-vote
Draft

feat: post-ready map vote#504
garrappachc wants to merge 23 commits intomasterfrom
feat/post-ready-map-vote

Conversation

@garrappachc
Copy link
Member

Summary

  • Adds an optional post-ready map vote mode where players vote for a map after all players have readied up, rather than during the queue wait
  • New QueueState.map_vote state sits between ready and launching; players see a timed dialog with map options and live vote percentages
  • Toggled via admin panel (Scramble Maps page) with a configurable timeout (default 10s); existing pre-ready behaviour is unchanged and remains the default

Changes

  • src/shared/types/map-vote-timing.ts — new MapVoteTiming enum (preReady / postReady)
  • src/database/models/configuration-entry.model.tsqueue.map_vote_timing and queue.map_vote_timeout config keys
  • src/database/models/queue-state.model.tsmap_vote queue state
  • src/tasks/tasks.tsqueue:mapVoteTimeout task
  • src/queue/views/html/map-vote-dialog.tsx — new dialog component (shell + .show() + .close())
  • src/html/layout.tsxMapVoteDialog rendered in global layout
  • src/queue/plugins/auto-update-queue-state.ts — state transitions and timeout task handler
  • src/queue/plugins/sync-clients.ts — broadcasts dialog on map_vote, closes on launching, shows on late page load
  • src/queue/views/html/queue.page.tsx — map vote widget hidden in post-ready mode
  • src/admin/scramble-maps/views/html/scramble-maps.page.tsx — settings UI
  • src/routes/admin/scramble-maps/index.tsx — POST handler for new settings
  • tests/10-queue/12-post-ready-map-vote.spec.ts — E2E test scaffold

Test plan

  • Enable post-ready mode in admin panel (Scramble Maps), set timeout to 5s
  • Verify map vote buttons are not visible on the queue page
  • Fill the queue and have all players ready up
  • Verify the map vote dialog appears for all players with a countdown
  • Vote for a map; verify live percentages update for all players
  • After timeout, verify the game launches with the winning map
  • Navigate to queue page mid-vote as a new browser tab — verify dialog appears immediately (functional for queue members, read-only for spectators)
  • Disable post-ready mode — verify the original pre-ready behaviour is fully restored
  • pnpm buildpnpm lintpnpm test

🤖 Generated with Claude Code

garrappachc and others added 21 commits March 5, 2026 14:57
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dy mode

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

Playwright test results

failed  2 failed
passed  146 passed
flaky  1 flaky

Details

stats  149 tests across 28 suites
duration  15 minutes, 4 seconds
commit  b5451f1

Failed tests

chromium › 10-queue/12-post-ready-map-vote.spec.ts › post-ready map vote @6v6 › map vote buttons are hidden from queue page in post-ready mode
chromium › 10-queue/12-post-ready-map-vote.spec.ts › post-ready map vote @6v6 › map vote dialog appears after all players ready up

Flaky tests

chromium › 10-queue/09-tracks-online-players.spec.ts › tracks online players @6v6 @9v9

garrappachc and others added 2 commits March 5, 2026 16:28
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d of Post-ready

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

Development

Successfully merging this pull request may close these issues.

1 participant