Commit 7d0b77f
committed
fix(showcase/shell-docs): copy-button surfaces clipboard failure
- Replace the silent empty `catch {}` with a proper error state:
clipboard write failures now set state to "error", surface a
"Copy blocked" label for 2s, and log the original error so devs
can debug (permissions, insecure context, etc.) instead of the
button failing invisibly.
- Collapse the two booleans into a single `CopyState` so idle/copied/
error styling and aria-label stay in sync.1 parent f119bbe commit 7d0b77f
1 file changed
Lines changed: 32 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
| |||
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
22 | 37 | | |
23 | 38 | | |
24 | | - | |
| 39 | + | |
25 | 40 | | |
26 | 41 | | |
27 | 42 | | |
28 | 43 | | |
29 | 44 | | |
30 | 45 | | |
31 | | - | |
32 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
33 | 56 | | |
34 | 57 | | |
35 | 58 | | |
36 | 59 | | |
37 | 60 | | |
38 | | - | |
| 61 | + | |
39 | 62 | | |
40 | 63 | | |
41 | 64 | | |
0 commit comments