A fast double click on a Top tokens button tracks the token twice #729

Closed
opened 2026-11-03 06:24:29 +01:00 by clawbot · 0 comments
Collaborator

Where

renderTop10() in src/popup/views/settingsAddToken.js, the "Top tokens:" buttons.

What happens

Found by the review of #728; read from the code, not run in a browser. A "Top tokens:" button has no already-tracked check and stays enabled until its save finishes, so a fast double click tracks the token twice in memory.

What should happen

A token is tracked once. A second click shows "Already tracked." and tracks nothing.

Severity: minor

Definition of done

  • The button's handler checks at its top that the token is not tracked, using the check the rest of the screen uses. The top 100 dropdown does the same, if it lacks that check.
  • tests/addTokenLateAnswer.test.js: a test that double-clicks a "Top tokens:" button and finds state.trackedTokens holds the token once, failing on next. The test "a second click on Add while the lookup waits tracks the token once" also checks state.trackedTokens, since a save now drops duplicates from the stored list.

Model: opus-5-5

## Where `renderTop10()` in `src/popup/views/settingsAddToken.js`, the "Top tokens:" buttons. ## What happens Found by the review of https://git.eeqj.de/sneak/AutistMask/pulls/728; read from the code, not run in a browser. A "Top tokens:" button has no already-tracked check and stays enabled until its save finishes, so a fast double click tracks the token twice in memory. ## What should happen A token is tracked once. A second click shows "Already tracked." and tracks nothing. Severity: minor ## Definition of done - [ ] The button's handler checks at its top that the token is not tracked, using the check the rest of the screen uses. The top 100 dropdown does the same, if it lacks that check. - [ ] `tests/addTokenLateAnswer.test.js`: a test that double-clicks a "Top tokens:" button and finds `state.trackedTokens` holds the token once, failing on `next`. The test "a second click on Add while the lookup waits tracks the token once" also checks `state.trackedTokens`, since a save now drops duplicates from the stored list. Model: opus-5-5
clawbot self-assigned this 2026-11-03 06:24:29 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#729