Show the opening name during play and in PGN export

Aberta
#182 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
58/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
javascript
Domínio
full-stack

Direção de pesquisa

Start with js/notation.js for PGN export and js/game.js for the status display, then check index.html and sw.js for the UI and offline cache. Choose a licensed opening data source and match the played moves to its entries. Done when the longest match appears under the status line, persists after reload, is exported as ECO and Opening tags, and works offline.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

enhancement help wanted severity: low

Summary

Show the name of the opening being played, for example "Ruy Lopez", under the status line. Also write it into PGN exports as ECO and Opening tags.

Where

  • js/notation.js (PGN export; there is no opening data today)
  • index.html (status area)
  • sw.js (APP_FILES, the offline cache list)

Details

No opening data or label exists anywhere in the code. In js/, "opening" only appears in a comment in js/notation.js.

Impact

This is a cheap learning aid for casual players. It also gives context to the Past games list and to exported PGN.

Suggested fix

  • Bundle a small ECO table (a few hundred lines keyed by SAN move sequence or FEN) as a static file.
  • Add the file to APP_FILES in sw.js so it works offline.
  • Show the longest matching name under the status line.
  • Write ECO and Opening tags in PGN export.

Open questions:

  • Which source to use, and its license. The lichess chess-openings dataset is CC0.
  • Whether to keep showing the last matched name after the game leaves the book.

Acceptance criteria

  • 1.e4 e5 2.Nf3 Nc6 3.Bb5 shows "Ruy Lopez" (or the table's name for it).
  • The name survives a reload and appears in the downloaded PGN.
  • It works offline.

Getting started

  • Relevant files: js/notation.js, js/game.js (status), index.html, sw.js
  • How to run tests: npm test

Filed by repo-audit/full-audit at 01c6a35. Severity: low. Effort: S. audit-key: enhancement|js/notation.js|opening-name

Linguagem predominante
JavaScript
Estrelas
4
Forks
2
Merge médio
22h 16min
PRs com merge (30d)
9

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/Static_Chess

Todas as issues de TMHSDigital/Static_Chess

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.