Set timestamps in a chapter of a study#19728
Closed
nstillman-te wants to merge 1 commit intolichess-org:masterfrom
Closed
Set timestamps in a chapter of a study#19728nstillman-te wants to merge 1 commit intolichess-org:masterfrom
nstillman-te wants to merge 1 commit intolichess-org:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Please allow edits from maintainers on your pull request. See how to enable them here
Collaborator
We'll need that. This is a lot of code and it will need a lot of change if it's going to make it to production. |
ornicar
reviewed
Mar 5, 2026
Collaborator
ornicar
left a comment
There was a problem hiding this comment.
I'll continue the review when I'm able to make changes myself
| applyWho(api.deleteComment(studyId, position.ref, Comment.Id(id))) | ||
|
|
||
| case "setClock" => | ||
| logger.info(s"setClock received studyId=$studyId o=$o") |
| border: 1px solid $c-border; | ||
| border-radius: 3px; | ||
| background: $c-bg-box; | ||
| box-sizing: border-box; |
| } | ||
|
|
||
| .analyse__clock-input--error { | ||
| border-color: var(--c-bad, #c23) !important; |
| ).map(c => (defined(c) && c < 0 ? undefined : c)); | ||
| import { parseTimeToCentis, formatClockFromCentis } from './clockParse'; | ||
|
|
||
| const isClearClockValue = (s: string): boolean => s.trim() === '-' || s.trim() === '--'; |
Collaborator
There was a problem hiding this comment.
I think it should be empty string instead. That's what people will try to do.
Author
|
Closing in favor of #19743 (personal fork — allow maintainer edits). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15009
Implements the feature requested in Feature request: Set timestamps in a chapter of a study: contributors can add and edit clock times at mainline positions in study chapters via the UI, without editing PGN by hand.
What
-or--to clear the clock at that move. Changes are saved only when the chapter is in REC (recording) mode; an alert explains this if they try to save without REC.How
setClockinStudySocketandStudyApi(Contribute, no relay). Accepts either a clock value or clear (Option[Clock]:Some(clock)to set,Noneto clear). Writes to the node (or$unsetwhen clearing) and updates denorm viaChapterRepo.setClockAndDenorm.--:--placeholder) at the current position to open an inline field. Accepted formats:H:MM:SS,MM:SS,M:SS,SS, orSS.t. Parse/format inui/analyse/src/view/clockParse.ts. Invalid input shows an error state; value is sent on Enter or blur when valid. Clear on Enter or blur when the input is-or--. Tooltip on the whole editable clock and on the input when editing.translation/source/study.xml:addOrEditClockTime,clockTimeFormat,clockTimePlaceholder,turnOnRecToSaveClockTimes.ui/analyse/tests/clocks.test.tsforparseTimeToCentisandformatClockFromCentis.Related
AI-assisted contribution: This PR was developed with Cursor (agent mode). The GitHub issue above was used as context for the requested behavior. Implementation was refined through manual iteration and edge-case testing. The changes have been manually tested (set/edit/clear clock, REC on/off, mainline-only).
Note on "Allow edits from maintainers": This PR is from a fork created under an organization (TechEmpower). GitHub does not allow the "Allow edits from maintainers" option for such forks, so we can't enable it here. If this is a blocker for review or merge, please let us know and we can reopen the same changes from a personal fork where the option can be turned on.