Commit 985a849
hitl: inline canvas-overlay editor, confidence-tier colors, smarter auto-zoom
- AnnotationCanvas: add `activeBoxId` + `renderActiveBoxOverlay` render-prop
so callers can anchor an HTML widget under the active bounding box;
expose `getFitScale` / `getCanvasSize` for zoom-to-fit calculations;
gate `BoundingBoxLayer` behind a `hideBoxes` prop; move stage deselect
from `mouseDown` to `onClick` so drag-pan no longer clears the active
field. The `screenRect` passed to overlays now also includes `height`
for height-aware widgets.
- CanvasFieldOverlay (new): inline edit widget anchored beneath the
active bounding box. Single-line `TextInput` (or `Checkbox` for
selection-mark fields) exactly matching the bounding-box width.
Font-size auto-scales so the rendered text fills the input width
(text natural width measured via canvas `measureText`). Confidence-
tier border. Mouse-hover and F2-keyboard fade together for
peek-behind. Field key + confidence percentage label sits below the
input, fading in lockstep with the editor.
- useFieldFocus: per-field smart zoom — target a 50 px on-screen box
height as a floor, cap at a configurable fraction of canvas width,
and relax that cap up to an absolute ceiling when the inline
overlay's font would otherwise be too small. Smooth pan-to via
Konva tween (existing behaviour preserved).
- ReviewWorkspacePage: wires the canvas overlay; adds an F2 shortcut
(`alwaysActive: true`) for keyboard peek; adds an eye-icon toggle in
the canvas corner that suppresses bounding boxes entirely while
keeping the active-field overlay; switches sidebar field-row borders
to confidence-tier colors (replacing field-key-based colors); and
teaches `navigateToField` to detect when the cursor is inside the
canvas overlay so Tab navigation keeps focus on the overlay instead
of bouncing to the matching sidebar input.
- ConfidenceIndicator: exports `getConfidenceBorderColor` (CSS
variable, for borders) and `getConfidenceCanvasColor` (hex, for
Konva strokes) so confidence semantics propagate to borders,
document-view bounding-box strokes, and inline overlay borders
consistently.
- SnippetView: borders driven by confidence tier instead of field-key
color (matching the document view); crop padding bumped so each
snippet shows more surrounding document context; label/confidence
stacked vertically on the left under the field name.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent cd87c3c commit 985a849
6 files changed
Lines changed: 674 additions & 64 deletions
File tree
- apps/frontend/src/features/annotation
- core/canvas
- hitl
- components
- hooks
- pages
Lines changed: 141 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
22 | 31 | | |
23 | 32 | | |
24 | 33 | | |
| |||
41 | 50 | | |
42 | 51 | | |
43 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
44 | 80 | | |
45 | 81 | | |
46 | 82 | | |
| |||
60 | 96 | | |
61 | 97 | | |
62 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
63 | 102 | | |
64 | 103 | | |
65 | 104 | | |
| |||
171 | 210 | | |
172 | 211 | | |
173 | 212 | | |
| 213 | + | |
| 214 | + | |
174 | 215 | | |
175 | 216 | | |
176 | 217 | | |
| |||
213 | 254 | | |
214 | 255 | | |
215 | 256 | | |
216 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
217 | 262 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | 263 | | |
222 | 264 | | |
223 | 265 | | |
| |||
271 | 313 | | |
272 | 314 | | |
273 | 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 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
274 | 364 | | |
275 | 365 | | |
276 | 366 | | |
277 | 367 | | |
278 | 368 | | |
279 | 369 | | |
280 | 370 | | |
| 371 | + | |
281 | 372 | | |
282 | 373 | | |
283 | 374 | | |
| |||
292 | 383 | | |
293 | 384 | | |
294 | 385 | | |
| 386 | + | |
295 | 387 | | |
296 | 388 | | |
297 | 389 | | |
| |||
319 | 411 | | |
320 | 412 | | |
321 | 413 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
333 | 427 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
346 | 440 | | |
347 | 441 | | |
348 | 442 | | |
| |||
353 | 447 | | |
354 | 448 | | |
355 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
356 | 470 | | |
357 | 471 | | |
358 | 472 | | |
| |||
0 commit comments