Let the player choose the promotion piece
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- accessibility, frontend
Línea de trabajo
Read js/game.js:221-228 and js/promotion.js:153-185 to trace how moves and the existing dialog work; check index.html:65-71 and js/config.js:14 for loading and configuration. Run npm test and npm run lint to establish the baseline. Done when players can choose all four pieces, keyboard users can operate the dialog, notation records the choice, and undo restores the pawn.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
A pawn reaching the last rank always becomes a queen with no prompt, so underpromotion is impossible. A promotion dialog already exists in js/promotion.js but is never loaded or called.
Where
js/game.js:221-228(auto-queen,// TODO: Implement choice?)js/promotion.js:153-185(showPromotionModalreturns a Promise),js/promotion.js:57-64(options are click-onlydivs)index.html:65-71(script not loaded),js/config.js:14(PROMOTION_UI: false)
Proposal
Load promotion.js. When a pawn reaches the last rank, hold the move, show the dialog, then finish the move (notation, check detection, save) with the chosen piece. Block board input while the dialog is open. Make the options real <button> elements with labels so keyboard users can promote.
Open question: makeMove is synchronous and tests call it directly. An optional promotionType parameter, defaulting to queen, keeps tests and a future AI simple. See #31.
Who benefits
Every player whose game reaches promotion; knight promotions and rook or bishop promotions that avoid stalemate become possible.
Acceptance criteria
- The player can choose queen, rook, bishop or knight
- Notation shows the chosen piece (
e8=N) - The dialog is usable by keyboard
- Undo after a promotion restores the pawn
Getting started
- Relevant files:
js/game.js,js/promotion.js,index.html,js/config.js - How to run tests:
npm install, thennpm testandnpm run lint - Related docs:
docs/ARCHITECTURE.md,.github/CONTRIBUTING.md
Filed by repo-audit/full-audit at 8a2c86c. Severity: high. Effort: M. audit-key: enhancement|js/game.js|makeMove.promotion
- Lenguaje dominante
- JavaScript
- Estrellas
- 4
- Forks
- 2
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TMHSDigital/Static_Chess
-
enhancement good first issue severity: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TMHSDigital/Static_Chess#53 ·
-
documentation good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
TMHSDigital/Static_Chess#49 ·
-
documentation good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
TMHSDigital/Static_Chess#48 ·
-
documentation severity: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TMHSDigital/Static_Chess#47 ·
-
documentation good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
TMHSDigital/Static_Chess#46 ·
Todos los issues de TMHSDigital/Static_Chess
Issues similares
-
good first issue tests
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Download a leaderboard as CSVAbiertoenhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
growilabs/growi#12246 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
TMHSDigital/Free-Game-Dev-Assets#301 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100