Commit dd08243
authored
feat(website): add copy buttons to triage columns (#5525)
## Overview
Adds a floating copy-to-clipboard button to each result column on the
`/triage` page, making it easier to copy conversion data during local
testing.
Fixes #5368
## Details
- Adds a copy icon to the bottom-right corner of each result box.
- Keeps the copy button visible while the JSON content is scrolled.
- Copies the complete formatted JSON for the selected source.
- Disables copying while data is unavailable or loading.
- Displays a check icon and a `Copied` label after a successful copy.
- Restores the copy icon after 1.5 seconds.
- Uses the existing `@github/clipboard-copy-element` component.
### Screenshots
#### Copy buttons
<img width="1878" height="911" alt="image"
src="https://github.com/user-attachments/assets/9d660ed4-13de-4a5d-9d3f-c6d01c97c4f8"
/>
#### Copy feedback
<img width="1876" height="921" alt="image"
src="https://github.com/user-attachments/assets/57225b42-adc3-49cf-982d-578eae83a463"
/>
## Testing
- Ran `pnpm run build`.
- Launched the website emulator with OAuth bypass enabled:
```shell
BYPASS_OAUTH_FOR_LOCAL_DEV=true make run-website-emulator
```
- Loaded `CVE-2021-44228` from `api.osv.dev`.
- Verified that each column copies its complete JSON content.
- Verified that the button remains fixed after scrolling the result
content.
- Verified that clicking the button displays visible feedback and then
resets.1 parent 5e0153c commit dd08243
3 files changed
Lines changed: 107 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
52 | 63 | | |
53 | 64 | | |
54 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
12 | 51 | | |
13 | 52 | | |
14 | 53 | | |
| |||
91 | 130 | | |
92 | 131 | | |
93 | 132 | | |
| 133 | + | |
94 | 134 | | |
95 | 135 | | |
96 | 136 | | |
97 | 137 | | |
98 | 138 | | |
| 139 | + | |
99 | 140 | | |
100 | 141 | | |
101 | 142 | | |
102 | 143 | | |
103 | 144 | | |
| 145 | + | |
104 | 146 | | |
105 | 147 | | |
106 | 148 | | |
107 | 149 | | |
108 | 150 | | |
109 | 151 | | |
| 152 | + | |
110 | 153 | | |
111 | 154 | | |
112 | 155 | | |
| 156 | + | |
113 | 157 | | |
114 | 158 | | |
115 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
| 81 | + | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
| |||
94 | 101 | | |
95 | 102 | | |
96 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
97 | 145 | | |
98 | 146 | | |
99 | 147 | | |
| |||
168 | 216 | | |
169 | 217 | | |
170 | 218 | | |
171 | | - | |
| 219 | + | |
0 commit comments