Confirm before New Game discards a game in progress

オープン 初心者向け
#53 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript
領域
frontend

調査の方向性

js/game.js:41-42とjs/game.js:76-91を読み、New GameがどのようにresetGameを呼び出すかをたどり、その後index.html:58-61を調べて隣接するコントロールを確認してください。提案された2つの方法のいずれかを選び、ゲーム状態と手順の履歴がどのように保存されるかを確認してください。進行中のゲームを1回のタップで破棄できず、手がない状態またはゲーム終了後に新しいゲームを始める際には追加の手順が不要になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement good first issue severity: medium

Summary

The New Game button sits next to Undo and immediately wipes the board, the move list, the undo stack and the saved game, with no confirmation and no way back.

Where

  • js/game.js:41-42 (button wired straight to resetGame)
  • js/game.js:76-91 (resetGame)
  • index.html:58-61 (the two adjacent buttons)

Proposal

When moves have been played and the game is not over, either ask for confirmation with an inline two-step button (avoiding window.confirm), or keep the previous game in memory and show a short "Game reset. Undo" control that restores it. No prompt when the game has ended or no moves were made.

Who benefits

Anyone who mis-taps next to Undo, most likely on a phone.

Acceptance criteria

  • A game in progress cannot be discarded with a single tap
  • No extra step when there is nothing to lose

Getting started

  • Relevant files: js/game.js, index.html
  • How to run tests: npm install, then npm test and npm run lint
  • Related docs: docs/ARCHITECTURE.md, .github/CONTRIBUTING.md

Filed by repo-audit/full-audit at 8a2c86c. Severity: medium. Effort: S. audit-key: enhancement|js/game.js|resetGame

主要言語
JavaScript
スター
4
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/Static_Chess のほかの issue

TMHSDigital/Static_Chess の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。