Skip to content

Add rules enforcement to offline matches with toggle setting#181

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-rules-enforcement-offline-matches
Draft

Add rules enforcement to offline matches with toggle setting#181
Copilot wants to merge 3 commits intomainfrom
copilot/add-rules-enforcement-offline-matches

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 8, 2026

  • Add rulesEnforced state to App component (default true, persisted in localStorage)
  • Add toggleRules callback for toggling enforcement
  • Modify move validation in src/index.tsx to enforce rules in offline mode when enabled
  • Update bar piece enabled logic to respect rulesEnforced in offline mode
  • Update board point enabled prop to respect rulesEnforced in offline mode
  • Pass rulesEnforced + toggleRules through Dialogues component chain
  • Add gavel icon toggle item to Login menu showing "Rules: On" / "Rules: Off"
  • Add gavel icon toggle item to Friends menu showing "Rules: On" / "Rules: Off"
  • Add rulesEnforced and rulesNotEnforced i18n translation strings (English)
  • When rulesEnforced, tapping dice in offline mode now sets/alternates game.color (White→Black→…), so nextMoves() returns legal moves
Original prompt

Offline games previously had no rules enforcement — pieces could be placed anywhere freely. add rules enforcement to offline matches by default, with a settings menu option to disable/re-enable it both in the login menu and friends menu when you're focusing on the offline match


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 8, 2026

PR Preview Action v1.8.1

🚀 View preview at
https://ProLoser.github.io/PeaceInTheMiddleEast/preview/pr-181/

Built to branch gh-pages at 2026-03-08 19:09 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

…ends menus

Co-authored-by: ProLoser <67395+ProLoser@users.noreply.github.com>
Copilot AI changed the title [WIP] Add rules enforcement for offline matches by default Add rules enforcement to offline matches with toggle setting Mar 8, 2026
@ProLoser
Copy link
Copy Markdown
Owner

ProLoser commented Mar 8, 2026

@copilot when the rules are on, tapping the dice should set the player color

Co-authored-by: ProLoser <67395+ProLoser@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 8, 2026

@copilot when the rules are on, tapping the dice should set the player color

Done in commit 4e3efa3. In the local rollDice branch, when rulesEnforced is true, the color now alternates with each dice tap: nullWhite (first roll), WhiteBlack, BlackWhite. This mirrors what the online branch already does, so nextMoves() has a valid color to work with and returns the correct legal moves.

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.

2 participants