Skip to content

Add configurable time control sliders to PlaySetupModal#197

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-194
Closed

Add configurable time control sliders to PlaySetupModal#197
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-194

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 5, 2025

This PR adds Lichess-style configurable time control sliders to the PlaySetupModal, allowing players to set custom time and increment values instead of being limited to preset options.

Changes Made

New Components:

  • Slider.tsx - A reusable slider component with proper styling and accessibility
  • timeControlUtils.ts - Utility functions for converting between custom values and preset formats

Enhanced UI:

  • Added toggle between "Preset" and "Custom" time control modes
  • Custom mode provides two sliders: "Time per side" (1-180 minutes) and "Increment per move" (0-60 seconds)
  • Live preview shows the formatted time control (e.g., "91+30") as users adjust sliders
  • Maintains existing preset button interface when in preset mode

Key Features:

  • Smooth, responsive sliders with real-time value updates
  • Backwards compatibility with existing TimeControl string format
  • Clean UI that matches the existing design system
  • Proper accessibility with labels and ARIA attributes
  • Seamless conversion logic between custom values and game logic

The implementation provides users with complete flexibility to create any time control combination while maintaining full compatibility with the existing codebase and game logic.

Custom Time Control Sliders

Fixes #194.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dock2.csslab.ca
    • Triggering command: next-server (v15.4.3) (dns block)
  • fonts.googleapis.com
    • Triggering command: node /home/REDACTED/work/maia-platform-frontend/maia-platform-frontend/node_modules/.bin/next build (dns block)
    • Triggering command: next-server (v15.4.3) (dns block)
  • us.posthog.com
    • Triggering command: next-server (v15.4.3) (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
maia-platform-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2025 2:18pm

Co-authored-by: kevinjosethomas <46242684+kevinjosethomas@users.noreply.github.com>
Copilot AI changed the title [WIP] Add more time control options Add configurable time control sliders to PlaySetupModal Aug 5, 2025
Copilot AI requested a review from kevinjosethomas August 5, 2025 14:17
@kevinjosethomas
Copy link
Copy Markdown
Collaborator

I don't want there to be a separate slider for preset/custom. I want there to be a "Time Control: " with the preset options in smaller buttons/text on the right. Below that there should be the sliders. Clicking on any preset option should change the sliders to be whatever values are in that configured preset.

@kevinjosethomas kevinjosethomas deleted the copilot/fix-194 branch August 6, 2025 05:09
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.

Add more time control options

2 participants