Skip to content

Add color-to-play dot indicator on the board#733

Draft
Copilot wants to merge 6 commits into
masterfrom
copilot/dot-on-the-board-display
Draft

Add color-to-play dot indicator on the board#733
Copilot wants to merge 6 commits into
masterfrom
copilot/dot-on-the-board-display

Conversation

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor

Displays a small colored dot in the board's padding area to indicate whose turn it is — red dot on red's side, black dot on black's side. Hidden when the game is finished or when browsing move history. Correctly repositions on board flip.

BoardGui (board-gui.js + board.css)

  • New .color-to-play-dot CSS class: absolutely positioned circle, 3% width, white box-shadow for contrast against the brown board background
  • New private fields #colorToPlayDot (DOM ref) and #currentColorToPlay (persisted state)
  • Dot element created at the end of #drawBoard() (non-mini boards only), ensuring it survives flip() and updateMoveFormat() redraws
  • set colorToPlay(color) — public setter; null hides the dot
  • get colorToPlayOnBoard() — returns this.#board.getColorToPlay() without a full board copy
  • Positioning logic: (color === Color.RED) === this.#flippedRed determines bottom vs. top

PvP (player-vs-player-page.js)

  • #updateBoardTurnToPlay() now also sets colorToPlay to colorToPlayOnBoard when in progress, null otherwise
  • #handleNavigationEvent() explicitly sets colorToPlay = null when browsing history

PvB (player-vs-bot-page.js)

  • New #updateColorToPlayDot() helper using isStatusInProgress()
  • Called after FEN load, after player move (shows bot's turn dot while server responds), and inside registerOpponentMove's animation callback (so board state is current)
  • Explicitly set to null on resign, cancel, and game-end callbacks

Copilot AI linked an issue May 28, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add dot indicator for current player to board Add color-to-play dot indicator on the board May 28, 2026
Copilot AI requested a review from benckx May 28, 2026 08:10
Copilot finished work on behalf of benckx May 28, 2026 08:10
@benckx

benckx commented Jun 2, 2026

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

…board-display

# Conflicts:
#	webapp/src/main/resources/public/css/board.css
#	webapp/src/main/resources/public/js/widgets/board-gui.js
#	webapp/src/main/resources/templates/about/changelog.html

Copilot AI commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 62606a9. The three conflicting files were:

  • board.css — kept both .color-to-play-dot and the new .touch-drag-ghost classes
  • board-gui.js — kept both sets of new private fields (#colorToPlayDot/#currentColorToPlay and the touch-drag fields from master)
  • changelog.html — kept both changelog entries as separate <li> items

Copilot finished work on behalf of benckx June 2, 2026 15:08
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.

dot on the board to show who has to play?

2 participants