Commit ecc54cc
fix(inspector): scope copy-button reset timeouts per button
The previous copyResetTimeout field was a single instance-level number,
shared across every code block in a multi-block announcement. Clicking
Copy on block A then block B cancelled block A's reset timer, leaving
block A stuck on "Copied" forever.
Switch to a WeakMap<HTMLButtonElement, number> so each button manages
its own pending reset and is naturally cleaned up when the announcement
re-renders. Also keep aria-label in sync with the visible text label so
screen-reader users hear "Code copied" while sighted users see "Copied".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 55b2562 commit ecc54cc
1 file changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
7816 | 7816 | | |
7817 | 7817 | | |
7818 | 7818 | | |
7819 | | - | |
| 7819 | + | |
7820 | 7820 | | |
7821 | 7821 | | |
7822 | 7822 | | |
| |||
7853 | 7853 | | |
7854 | 7854 | | |
7855 | 7855 | | |
7856 | | - | |
7857 | | - | |
| 7856 | + | |
| 7857 | + | |
| 7858 | + | |
7858 | 7859 | | |
7859 | 7860 | | |
| 7861 | + | |
7860 | 7862 | | |
7861 | | - | |
| 7863 | + | |
7862 | 7864 | | |
| 7865 | + | |
7863 | 7866 | | |
7864 | | - | |
| 7867 | + | |
7865 | 7868 | | |
| 7869 | + | |
7866 | 7870 | | |
7867 | 7871 | | |
7868 | 7872 | | |
| |||
0 commit comments