Commit 35314ef
authored
feat(detections): quick review (Correct/Incorrect) in action menu (#2809)
* feat(i18n): add markCorrect/markFalsePositive labels for action menu
* test(actionmenu): align mock fixture with Detection type
Replace snake_case fields and the `as Detection` cast with a fully
typed object matching the camelCase Detection interface, adding the
required beginTime, endTime, speciesCode, and verified fields.
* feat(actionmenu): add variant prop for default/overlay trigger styling
Adds variant='default'|'overlay' prop to ActionMenu. Default keeps
light in-row styling with marker class am-trigger-default; overlay
renders a semi-transparent dark rounded button for spectrogram use
with marker class am-trigger-overlay. TDD: tests written first.
* feat(actionmenu): add optional Download menu item
* feat(actionmenu): add Correct/Incorrect quick-review items
Adds onMarkCorrect and onMarkFalsePositive props with corresponding menu
items at the top of the action menu. Items are hidden when detection is
locked. Active state badges (tick/cross) appear next to the relevant item
when the detection is already verified. Updates the i18n mock in test
setup with the two new translation keys.
* refactor(actionmenu): remove leftover DaisyUI classes, use native Tailwind
* feat(detections): wire quick-review handlers to ActionMenu
* refactor(dashboard): switch DetectionCard to merged ActionMenu (overlay variant)
* feat(detections): wire quick-review handlers in card grid views
Add handleMarkCorrect and handleMarkFalsePositive to the shared
useDetectionActions composable and pass them through DetectionCardGrid
and DetectionsCardView. The handlers fire the review API immediately
without a confirmation modal, matching DetectionRow fast-triage UX.
* refactor(dashboard): remove CardActionMenu, replaced by merged ActionMenu
* docs(ui): document ActionMenu variant and quick-review props
* fix(actionmenu): address review feedback on auth gating, a11y, theming
- Restructure canEdit gate so trigger and Download are available to
unauthenticated users (matches old CardActionMenu behavior)
- Add hover/padding to menu items (previously relied on dead DaisyUI
classes)
- Restore focus to trigger button after an action is selected, matching
the Escape handler
- Use role="separator" on the quick-review divider
- Drop leftover dropdown class from the root div
- Switch overlay variant to theme-aware CSS vars with backdrop blur
instead of hardcoded slate
* fix(actionmenu): address PR review feedback
- Gate quick-review items by handler presence (not just canEdit/locked)
(Gemini: ActionMenu.svelte:240)
- Restore verified badge on Review item so status stays visible when the
detection is locked and quick-review items are hidden
(Gemini: ActionMenu.svelte:301)
- Extract setDetectionVerification into $lib/utils/reviewDetection and
reuse from DetectionRow and useDetectionActions composable
(Gemini: DetectionRow.svelte:207)
- Use consistent Dutch wording Juist/Onjuist in nl.json
(CodeRabbit: nl.json:660)
- Update ActionMenu tests to supply both callbacks when expecting
quick-review items to be rendered
* fix(actionmenu): address second-round review feedback
- Gate every menu item by its own callback presence, so a consumer that
omits a handler does not render a no-op item
(Gemini + CodeRabbit)
- Make setDetectionVerification pure: accept detectionId, return boolean,
let callers update detection.verified and trigger refresh themselves
(Gemini)
- Forward rest HTML attributes on the root div so callers can pass id,
data-*, aria-* and other standard attributes, per the ui components
convention
(CodeRabbit)1 parent 4d76a89 commit 35314ef
20 files changed
Lines changed: 474 additions & 407 deletions
File tree
- frontend
- src
- lib
- desktop
- components
- ui
- features
- dashboard/components
- detections
- components
- composables
- utils
- test
- static/messages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | 154 | | |
156 | 155 | | |
157 | 156 | | |
| |||
Lines changed: 201 additions & 75 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
24 | 36 | | |
25 | 37 | | |
26 | 38 | | |
27 | | - | |
| 39 | + | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
31 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
32 | 48 | | |
33 | 49 | | |
34 | 50 | | |
| |||
37 | 53 | | |
38 | 54 | | |
39 | 55 | | |
| 56 | + | |
| 57 | + | |
40 | 58 | | |
41 | 59 | | |
| 60 | + | |
| 61 | + | |
42 | 62 | | |
43 | 63 | | |
44 | 64 | | |
| |||
48 | 68 | | |
49 | 69 | | |
50 | 70 | | |
| 71 | + | |
| 72 | + | |
51 | 73 | | |
52 | 74 | | |
53 | 75 | | |
54 | 76 | | |
| 77 | + | |
55 | 78 | | |
| 79 | + | |
56 | 80 | | |
57 | 81 | | |
| 82 | + | |
58 | 83 | | |
59 | 84 | | |
60 | 85 | | |
| |||
114 | 139 | | |
115 | 140 | | |
116 | 141 | | |
| 142 | + | |
117 | 143 | | |
118 | 144 | | |
119 | 145 | | |
| |||
180 | 206 | | |
181 | 207 | | |
182 | 208 | | |
183 | | - | |
184 | | - | |
| 209 | + | |
| 210 | + | |
185 | 211 | | |
186 | 212 | | |
187 | 213 | | |
188 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
189 | 220 | | |
190 | 221 | | |
191 | 222 | | |
| |||
194 | 225 | | |
195 | 226 | | |
196 | 227 | | |
| 228 | + | |
| 229 | + | |
197 | 230 | | |
198 | 231 | | |
199 | 232 | | |
200 | 233 | | |
201 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
202 | 240 | | |
203 | 241 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
221 | 346 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
242 | 372 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
263 | 390 | | |
264 | | - | |
| 391 | + | |
| 392 | + | |
265 | 393 | | |
266 | 394 | | |
267 | 395 | | |
268 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
269 | 402 | | |
270 | 403 | | |
271 | 404 | | |
| |||
279 | 412 | | |
280 | 413 | | |
281 | 414 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
| |||
0 commit comments