Custom time controls

Ouverte
#159 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
56/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
javascript
Domaine
frontend, game-dev

Piste de recherche

Start with js/config.js and index.html to see how the existing presets populate #clock-select, then follow the selection handling in js/main.js and clock startup in js/clock.js. Read tests/unit/clock.test.js and run npm ci && npm test to understand current validation. Done when custom controls persist across reloads, invalid values cannot start the clock, and the tests cover the new behavior; bounds and PGN formatting still need decisions.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement help wanted severity: low

Summary

The clock offers only five fixed presets (1+0, 3+2, 5+0, 10+0, 15+10). Common controls such as 3+0, 5+3 or 30+0, and odds games, cannot be chosen.

Where

  • js/config.js:18-25 (TIME_CONTROLS)
  • index.html:166 (#clock-select)

Proposal

Add a "Custom..." option to #clock-select that shows two number inputs (minutes, increment seconds), validated and stored as custom:M+I in the time-control setting. Optionally, a per-side minutes field for odds games.

Who benefits

Players who want a longer game, or an odds game against a stronger friend.

Open questions

  • Bounds (e.g. 1 to 180 minutes, 0 to 60 seconds increment).
  • How a custom control is written to the PGN TimeControl tag.

Acceptance criteria

  • A custom control is kept across reloads and validated by validateSavedGame
  • Invalid input cannot start a clock
  • Tests in tests/unit/clock.test.js

Getting started

  • Relevant files: js/config.js, js/main.js, js/clock.js, index.html
  • How to run tests: npm ci && npm test

Filed by repo-audit/full-audit at 73cd279. Severity: low. Effort: M. audit-key: enhancement|js/config.js|TIME_CONTROLS

Langage dominant
JavaScript
Étoiles
4
Forks
2
Merge moyen
22 h 16 min
PR mergées (30 j)
9

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/Static_Chess

Toutes les issues de TMHSDigital/Static_Chess

Issues similaires

Plus d'issues JavaScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.