Add keyboard shortcuts for whiteboard tools

オープン
#618 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

Start with the existing whiteboard keyboard event listener and tool-selection functions in web/interview.js, then inspect the toolbar markup in web/interview.html and styles in web/styles.css. Add browser coverage in tests/browser/whiteboard-shortcuts.test.js for switching tools, cycling colors and sizes, returning from text mode, and ignoring typing, repeats, and shortcuts outside the whiteboard. Done when the visible labels and all listed shortcut behaviors work.

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

説明

Description

The whiteboard toolbar currently requires users to click the pen, eraser, or text controls to switch tools. Add keyboard shortcuts so users can switch tools and adjust pen colors or eraser sizes from the keyboard.

The toolbar should also display small, always visible key labels beside the relevant controls so users can discover the shortcuts.

Expected Behavior

  • Press P to switch to the pen. If the pen is already selected, pressing P cycles through black, red, blue, and green.
  • Press E to switch to the eraser. If the eraser is already selected, pressing E cycles through its available sizes.
  • Press T to switch to the text tool. Pressing T again returns to the previously used pen or eraser.
  • Display P, E, and T key labels beside the pen, eraser, and text controls.
  • Do not trigger shortcuts while the user is typing in a text input or text label.
  • Ignore held-key repeats so one press only changes the color or size once.
  • Only handle these shortcuts while the user is interacting with the whiteboard.

Proposed Solution

  • In web/interview.js, handle P, E, and T key presses in the whiteboard’s existing keyboard event listener. Reuse the current tool-selection functions to switch tools, cycle pen colors or eraser sizes, and return from the text tool to the previously selected pen or eraser. Ignore repeated key events and events from text inputs or editable elements, and only respond when the user is interacting with the whiteboard.
  • In web/interview.html, add always visible P, E, and T labels beside the pen, eraser, and text controls so users can discover the shortcuts.
  • In web/styles.css, style the labels as small keycaps that fit the existing toolbar.
  • In tests/browser/whiteboard-shortcuts.test.js, add browser tests for tool switching, color and size cycling, returning from text mode, and ignoring shortcuts while typing, holding a key, or outside the whiteboard.

Example

Image
主要言語
Rust
スター
223
フォーク
148
平均マージ
1日 7時間
マージ済み PR(30日)
225

環境構築

はじめの一歩

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

sysprog21/codetrial のほかの issue

sysprog21/codetrial の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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