Skip to content

Add delay clock modes and unify local clock setup UI#3122

Open
Matrix9494 wants to merge 8 commits into
lichess-org:mainfrom
Matrix9494:UI
Open

Add delay clock modes and unify local clock setup UI#3122
Matrix9494 wants to merge 8 commits into
lichess-org:mainfrom
Matrix9494:UI

Conversation

@Matrix9494
Copy link
Copy Markdown
Contributor

@Matrix9494 Matrix9494 commented May 6, 2026

Summary

Adds simple delay and Bronstein delay support to the standalone Clock tool, while keeping increment as the default mode.

The changes are scoped to local/offline clock setup and do not affect server-backed online time controls.

Main areas changed:

  • lib/src/model/clock/clock_tool_controller.dart

    • Adds clock mode handling for increment, simple delay, and Bronstein delay.
    • Preserves pause/resume behavior and zero-start clock handling.
  • lib/src/view/clock/clock_tool_settings_modal.dart

    • Adds a dedicated standalone Clock settings panel for clock type, initial time, and increment/delay.
  • lib/src/view/clock/clock_settings.dart

    • Uses the new Clock settings panel instead of the generic time control modal.
  • lib/src/view/clock/clock_tool_screen.dart

    • Displays increment and delay values in the Clock tool UI.
  • lib/src/view/clock/custom_clock_settings.dart

    • Updates per-side custom clock setup to match the selected clock mode.
  • lib/src/model/over_the_board/over_the_board_preferences.dart

    • Renames local OTB time control from realTime to clock, with migration for existing preferences.
  • lib/src/view/over_the_board/configure_over_the_board_game.dart

    • Updates local OTB setup to show Clock and Unlimited.
    • Keeps clock type hidden because OTB currently supports only increment.
  • lib/src/view/offline_computer/offline_computer_game_screen.dart

    • Reorders local setup options to better match the offline setup flow.

AI assistance

This PR was developed with assistance from ChatGPT/Codex. I reviewed and tested the changes manually, and I understand the submitted code.

Demo

Screen_recording_20260506_134420.webm

@ijm8710
Copy link
Copy Markdown

ijm8710 commented May 6, 2026

Hey I like that there is less going on the clock toolbar and I'm in favor of some of your unifying

Few questions and feedbacks if you don't mind:

- Per-player standalone clock settings now use the same slider style and apply changes directly without a separate submit button.
- OTB setup now separates Time control from clock behavior:
  - Clock
  - Unlimited
- OTB and standalone Clock share a local clock slider UI helper.

Having a little trouble envisioning what you mean without a submit button. Can you share a screenshot for these bullets or better yet perhaps add a video for the otb changes as well?
Would help with the second bullet here as well which I wasn't sure what that meant
And for the third, was curious when you said shared. Does this mean they retain previous time control used in-sync with one another (otb and clock?)

I like the unified order for the clock settings for all the tools. One other slight reorder I considered is rated before side since rated influences if the side option even exists. Such as on 'challenge a friend' and 'correspondence' screens from the play menu. But my personal rebuttal to myself is that for the correspondence play screen, the side option animates in above when the toggle is toggled. If they were in reverse order, I assume it wouldn't be as pretty because then the rated toggle would be included in the bump-up. Not sure if anything made any sense or if you had any personal opinions on this one.

One other idea, as you heard I was in favor of decluttering the clock toolbar. What are your thoughts to bringing sound and/or the rotation button into the gear settings? I can go either way but figured it was worth a shout of consideration.

Lastly, I can create a separate pr later but is it somewhat easy to eventually bring in the other clock options that I mentioned in the previous ticket?

@Matrix9494
Copy link
Copy Markdown
Contributor Author

Yeah, I attached a comparison showing the changes to the submit button and slider UI. The changes are mainly in the descriptive text. The left image shows the original version, and the right image shows the modified version. I was mainly trying to make the styles consistent.

image image

I am fine with either order. For now, I mainly want to align all local components, including OTB, clock, and offline computer, with the online game type.

A sound also sounds good to me.

For additional variants, I would prefer to add them later, after others have had a chance to comment on the current two options. My current plan is to make OTB and clock share the same time-control logic, but I have hidden the time-control selection for OTB for now.

@ijm8710
Copy link
Copy Markdown

ijm8710 commented May 6, 2026

Yeah, I attached a comparison showing the changes to the submit button and slider UI. The changes are mainly in the descriptive text. The left image shows the original version, and the right image shows the modified version. I was mainly trying to make the styles consistent.

<td><img width="208" height="311" alt="image" src="https://github.com/user-attachments/assets/d2e2a84f-1d9e-4185-b49a-7fad7d123b7c" /></td>

<td><img width="215" height="304" alt="image" src="https://github.com/user-attachments/assets/dfec1515-5b96-430b-bf01-e4f8b36a7056" /></td>

I am fine with either order. For now, I mainly want to align all local components, including OTB, clock, and offline computer, with the online game type.

A sound also sounds good to me.

For additional variants, I would prefer to add them later, after others have had a chance to comment on the current two options. My current plan is to make OTB and clock share the same time-control logic, but I have hidden the time-control selection for OTB for now.

I like the unified design changes and text.

I am not so sure I love losing the submit button. Just because I adjust the toggle doesn't mean I want that new time control applied .

@ijm8710
Copy link
Copy Markdown

ijm8710 commented May 7, 2026

Also, I'm presuming this will fix #1905

@Matrix9494
Copy link
Copy Markdown
Contributor Author

@ijm8710 You are right. I missed the fact that nearly all time-control setup UIs are followed by a Play or Submit button. Keeping the button seems better. #1905 seems resolved now.

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