dashboard: holding Enter on the focused Stop button sends an interrupt per key repeat

Open Beginner friendly
#9,271 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
60/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
react, typescript
Domain
frontend

Research direction

The Stop button is in packages/dashboard/src/components/InputBar.tsx, the button with data-testid="interrupt-button" whose onClick calls onInterrupt. First reproduce in a browser: focus that button and hold Enter, then count the interrupt frames sent. If repeats do send several, add a test that fails on current main and fix it so one physical press sends one frame, while mouse click and single Enter or Space still work. If they do not, close the issue with that measurement.

Written by the indexing model from the issue text.

Description

complexity: low dashboard enhancement from-review

Context

Filed from: #9269 (https://github.com/blamechris/chroxy/pull/9269#issuecomment-7071222287)

Identified during review of PR #9269.

Location: packages/dashboard/src/components/InputBar.tsx (the Stop button, data-testid="interrupt-button", onClick={onInterrupt})

Description

#9269 made a held Escape or Cmd+. act once. The Stop button is a third way to reach the same door. A browser fires click on a focused <button> for every Enter keydown, including auto-repeats, so holding Enter while the Stop button has focus calls onInterrupt once per repeat. After output has started that is one interrupt frame per repeat. Before the first output it re-parks the same confirmation, which is harmless.

The button only has focus after a click or a Tab to it, and it unmounts once the session goes idle, so this is rare. #9269 listed it as not examined. It has not been reproduced in a browser.

Acceptance Criteria

  • Confirm in a real browser whether holding Enter on the focused Stop button sends more than one interrupt frame.
  • If it does: one physical press sends one frame, with a test that is red on current main. A mouse click and a single Enter or Space press keep working.
  • If it does not: close with the measurement.
Dominant language
JavaScript
Stars
7
Forks
1
Avg merge
2h 19m
Merged PRs (30d)
263

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blamechris/chroxy

All issues in blamechris/chroxy

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.