Skip to content

Add Time control button + sub-panel to PvB modal#655

Draft
benckx with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-pvb-time-control
Draft

Add Time control button + sub-panel to PvB modal#655
benckx with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-pvb-time-control

Conversation

Copilot AI commented May 17, 2026

Copy link
Copy Markdown
Contributor

Adds a "Time control" entry to the player-vs-bot create-game modal so users can pick a time control before starting a PvB game. Backend wiring is partial: the API DTO accepts the new fields, but DB persistence and clock enforcement are not yet implemented.

Changes Made

  • Merged master into the branch (it had been updated recently).
  • PvB modal (webapp/src/main/resources/modals/play-bot.html): added a "Time control" row whose button toggles the modal body to a sub-panel listing time controls — No time control (default) / 1m / 2m+1s / 3m / 5m / 10m / 30m. A "back" button in the modal footer returns to the main panel.
  • Modal handler (webapp/src/main/resources/public/js/modal-handlers/play-bot-modal-handler.js): added the bot-tc-option-button-div exclusion group, click handlers for show/hide of the sub-panel, selection-to-label sync, and inclusion of timeControlBase / timeControlIncrement in the /api/botgame/create request body.
  • CreateBotGameRequest: added nullable timeControlBase and timeControlIncrement fields.
  • PlayerVsBotGameService.create: basic validation rejecting non-positive base, negative increment, or increment without a base.

Design notes

Confirmed in PR thread: the bot will also have a time limit (even though responses are near-instant). Per the request, the time-control selection lives behind a button on the modal rather than inline.

Not yet in this PR (intended follow-ups)

  • Persist time control on bot_game (Liquibase migration + DAO).
  • Server-side per-move clock computation and TIME_LOSS outcome (for both human and bot clocks).
  • Clock UI on the PvB game page (decrement loop, display).
  • TimeControl PGN tag in buildPgnMetadata.
  • Tests mirroring the PvP time-control suite.

Selecting a time control therefore currently has no in-game effect — it is plumbed only as far as the create request.

Copilot AI linked an issue May 17, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix pvb with time control issue Clarification needed: scope of "pvb with time control" May 17, 2026
Copilot AI requested a review from benckx May 17, 2026 08:26
Copilot finished work on behalf of benckx May 17, 2026 08:26
@benckx

benckx commented Jun 2, 2026

Copy link
Copy Markdown
Owner

@copilot The bot will have time limit too (even though its response time is more or less instantaneous). On the PvB modal (merge master into the branch cause it's been updated recently), add a "Time control" button which leads to a separate bit of the of the modal with a list of Time control.

Copilot AI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot The bot will have time limit too (even though its response time is more or less instantaneous). On the PvB modal (merge master into the branch cause it's been updated recently), add a "Time c...

Merged master into the branch and added a "Time control" row to the PvB modal that toggles a sub-panel listing time controls (None / 1m, 2m+1s / 3m, 5m / 10m, 30m). Selecting one updates the label on the main panel; "back" returns without changing the selection. The chosen TC is sent in the create-game request body, and the backend DTO accepts it with basic validation — but DB persistence, per-move clock enforcement (incl. the bot's clock), and the on-page clock UI are not in this commit yet, so picking a time control currently has no in-game effect. Want me to continue with those next?

Copilot AI changed the title Clarification needed: scope of "pvb with time control" Add Time control button + sub-panel to PvB modal Jun 2, 2026
Copilot finished work on behalf of benckx June 2, 2026 06:53
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.

pvb with time control

2 participants