fix: a double click on a Top tokens button tracks the token once (closes #729) #731

Merged
clawbot merged 1 commits from issue-729-top-tokens-double-click into next 2026-11-03 07:37:04 +01:00
Collaborator

A "Top tokens:" button on SettingsAddToken had no already-tracked check and stays enabled until its save ends. A fast double click therefore tracked the token twice in memory.

The handler now starts with the isTracked check the rest of the screen uses. A second click shows "Already tracked." and tracks nothing. The top 100 dropdown already has this check, so it is unchanged.

tests/addTokenLateAnswer.test.js gains a double-click test. The test "a second click on Add while the lookup waits tracks the token once" now also checks state.trackedTokens, because a save drops duplicates from the stored list.

What the diff does not show:

  • When the first click's save ends, its "Added SYMBOL" flash message replaces "Already tracked."
  • The test page builds no elements from markup, so the new test hands the screen a stand-in button.

Disclosures:

  • Unverified: the double click was not run in a browser.
  • Judgement call: README.md is unchanged, as the plan names only two files. Its SettingsAddToken section says a tracked token "is disabled" and names "Already tracked." only for the dropdown, which leaves out this short window before the save ends.

Model: opus-5-5

A "Top tokens:" button on SettingsAddToken had no already-tracked check and stays enabled until its save ends. A fast double click therefore tracked the token twice in memory. The handler now starts with the `isTracked` check the rest of the screen uses. A second click shows "Already tracked." and tracks nothing. The top 100 dropdown already has this check, so it is unchanged. `tests/addTokenLateAnswer.test.js` gains a double-click test. The test "a second click on Add while the lookup waits tracks the token once" now also checks `state.trackedTokens`, because a save drops duplicates from the stored list. What the diff does not show: - When the first click's save ends, its "Added SYMBOL" flash message replaces "Already tracked." - The test page builds no elements from markup, so the new test hands the screen a stand-in button. Disclosures: - Unverified: the double click was not run in a browser. - Judgement call: `README.md` is unchanged, as the plan names only two files. Its SettingsAddToken section says a tracked token "is disabled" and names "Already tracked." only for the dropdown, which leaves out this short window before the save ends. Model: opus-5-5
clawbot added the needs-review label 2026-11-03 06:47:36 +01:00
clawbot self-assigned this 2026-11-03 06:47:36 +01:00
clawbot added 1 commit 2026-11-03 06:47:36 +01:00
fix: a double click on a Top tokens button tracks the token once (closes #729)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
e0ccb1c8de
A "Top tokens:" button had no already-tracked check and stays enabled until its
save ends, so a fast double click tracked the token twice in memory. Its handler
now checks first. A second click shows "Already tracked." and tracks nothing.
The top 100 dropdown already has this check, so it is unchanged.

Model: opus-5-5
Author
Collaborator

PASS: a second click on a "Top tokens:" button before the first click's save ends now shows "Already tracked." and tracks nothing, as #729 asks, and the new test fails without the fix.

  • Follow-up: the new test's comment in tests/addTokenLateAnswer.test.js says "The page stub". tests/support/popupBoot.js calls it "The DOM stub", so the comment should use that name.
  • Follow-up: the commit is authored as sneak <sneak@sneak.berlin>, not clawbot. The squash merge replaces the author, but the worker should commit as clawbot.
  • Unverified: the double click was not run in a browser.

Model: opus-5-5

PASS: a second click on a "Top tokens:" button before the first click's save ends now shows "Already tracked." and tracks nothing, as https://git.eeqj.de/sneak/AutistMask/issues/729 asks, and the new test fails without the fix. - Follow-up: the new test's comment in `tests/addTokenLateAnswer.test.js` says "The page stub". `tests/support/popupBoot.js` calls it "The DOM stub", so the comment should use that name. - Follow-up: the commit is authored as `sneak <sneak@sneak.berlin>`, not `clawbot`. The squash merge replaces the author, but the worker should commit as `clawbot`. - Unverified: the double click was not run in a browser. Model: opus-5-5
clawbot merged commit 21d5e42528 into next 2026-11-03 07:37:04 +01:00
clawbot deleted branch issue-729-top-tokens-double-click 2026-11-03 07:37:05 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#731