Skip to content

Commit e4578fd

Browse files
Merge pull request #238 from SenteraLLC/fix/vanish
Fix/vanish
2 parents 2904229 + 7b1b1dc commit e4578fd

22 files changed

Lines changed: 378 additions & 421 deletions

.github/tasks.md

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,3 @@
11
## Tasks
2-
- [x] Add a sideways, clickable arrow to minimize the entire toolbox
3-
- [x] Add collapse button to toolbox HTML
4-
- [x] Add CSS styles for collapsed state
5-
- [x] Add click handler to toggle collapsed state
6-
- [x] Store collapsed state in localStorage
7-
- [x] Test functionality
8-
- [x] Move arrow to top of toolbox (instead of middle)
9-
- [x] Make annbox expand when toolbox is collapsed
10-
- [x] Make collapsed button visible
11-
- [x] Create a keybinds toolbox item
12-
- [x] Research existing keybinds in the codebase
13-
- [x] Create basic keybinds toolbox item file
14-
- [x] Register keybinds toolbox item in configuration
15-
- [x] Display list of all keybinds (the key) labeled with the name
16-
- [x] Add hover tooltips with detailed descriptions (using title attribute)
17-
- [x] Add collision detection and red highlighting
18-
- [x] Implement editing for configurable keybinds
19-
- [x] Test functionality
20-
- [x] Add support for keybind "chords" (ie, "shift+i")
21-
- [x] Update keybind edit handler to capture modifier keys (shift, ctrl, alt)
22-
- [x] Create chord string format (e.g., "shift+i", "ctrl+alt+d")
23-
- [x] Update key comparison logic in listeners to support chords
24-
- [x] Update display to show chords properly (displays captured chord automatically)
25-
- [x] Test chord functionality
26-
- [x] Store collapse/expand for applicable toolbox items
27-
- [x] Keybinds
28-
- [x] Annotation List
29-
- [x] Image Filters
30-
- [x] Make all keybinds configurable
31-
- [x] Minor changes to existing keybinds
32-
- [x] Rename "Change Zoom" keybind to "Reset Zoom"
33-
- [x] Change "Toggle Mode" label in the keybind toolbox item to "Toggle Annotation Mode"
34-
- [x] Make class keybinds configurable in the keybinds toolbox item
35-
- [x] Store keybinds in local storage
36-
- [x] Only save them when a user explicitly sets it
37-
- [x] For keybinds using a user setting, add a button to reset that keybind to default (should change keybind and delete stored keybind)
38-
- [x] Add "Reset All to Default" button in the keybinds toolbox item that resets all keybinds and deletes stored user keybinds
39-
- [x] Add a light yellow highlight on keybinds that are using a user setting instead of a default
40-
- [x] Make sure that we update collison highlights after resetting a keybind to default
41-
- [x] Only show the reset to default for keybinds with user settings, not on those already at the default
42-
- [x] Make sure the class keybinds also are included in the keybind collision checks
43-
- [x] Fix reset to default to use constructor-provided config values instead of hardcoded Configuration defaults
44-
- [x] Centralize keybind config property names in Configuration.KEYBIND_CONFIG_KEYS constant
45-
- [x] Make KEYBIND_CONFIG_KEYS dynamically generated from Configuration class properties
46-
- [x] Rename create_bbox_on_initial_crop to create_bbox_on_initial_crop_keybind for consistency
47-
- [x] Replace any console outputs with `log_message`
48-
- [x] Replace the "reset_zoom_keybind" with two separate keybinds:
49-
- [x] Add "show_full_image_keybind" property to Configuration
50-
- [x] Update listeners.ts to use both keybinds independently
51-
- [x] Update toolbox.ts to use both keybinds independently
52-
- [x] Update api_spec.md to document both keybinds
53-
- [x] Write e2e tests for the keybind toolbox item
54-
- [x] Ability to set keybind to a chord
55-
- [x] Ability to reset keybind
56-
- [x] Ability to set a class keybind
57-
- [x] Run tests to verify they pass
58-
- [x] Write a e2e test for each keybind
59-
- [x] reset_zoom_keybind (r)
60-
- [x] show_full_image_keybind (shift+r)
61-
- [x] create_point_annotation_keybind (c)
62-
- [x] delete_annotation_keybind (d)
63-
- [x] switch_subtask_keybind (z)
64-
- [x] toggle_annotation_mode_keybind (u)
65-
- [x] create_bbox_on_initial_crop_keybind (f)
66-
- [x] toggle_brush_mode_keybind (g)
67-
- [x] toggle_erase_mode_keybind (e)
68-
- [x] increase_brush_size_keybind (])
69-
- [x] decrease_brush_size_keybind ([)
70-
- [x] annotation_size_small_keybind (s)
71-
- [x] annotation_size_large_keybind (l)
72-
- [x] annotation_size_plus_keybind (=)
73-
- [x] annotation_size_minus_keybind (-)
74-
- [x] annotation_vanish_keybind (v)
75-
- [x] fly_to_next_annotation_keybind (tab)
76-
- [x] fly_to_previous_annotation_keybind (shift+tab)
2+
- [x] Remove the "line_size" property from ULabelAnnotation. Update the entire codebase to ensure no reference to it remains. Instead, use the line_size defined for the annotation's subtask when we need a line size for drawing the annotation.
773

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ build/*
55
output.txt
66
test-results/
77
playwright-report/
8-
dist
8+
dist
9+
*.log

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented here.
44

55
## [unreleased]
66

7+
## [0.22.1] - Jan 13th, 2026
8+
- Don't draw annotations when a subtask is vanished
9+
- Add configurable `annotation_vanish_all_keybind`
10+
- Track annotation size per subtask
11+
- Remove annotation size cookie, since it was tracking just one size per annotation session
12+
- Deprecated the `default_annotation_size` argument in the configuration object. Use the `initial_line_size` argument instead. See api_spec.md for details.
13+
- Fix toolbox collapse arrow positioning, and make frame annotation dialogs disappear on collapse
14+
- Removed the `line_size` property from annotation objects. `subtask.state.line_size` determined the size of drawn annotations within a subtask.
15+
716
## [0.22.0] - Oct 30th, 2025
817
- Add collapsible toolbox with arrow button at top
918
- Toolbox collapse state persists in browser

api_spec.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class ULabel({
5555
reset_zoom_keybind: string,
5656
show_full_image_keybind: string,
5757
create_point_annotation_keybind: string,
58-
default_annotation_size: number,
5958
delete_annotation_keybind: string,
6059
keypoint_slider_default_value: number,
6160
filter_annotations_on_load: boolean,
@@ -196,9 +195,6 @@ As you can see, each subtask will have a corresponding list of annotation object
196195
}
197196
],
198197

199-
// size in underlying image pixels
200-
"line_size": "<number>",
201-
202198
// (nullable) frame ann was created for
203199
"frame": "<int>",
204200

@@ -316,7 +312,7 @@ In some cases, you may want the annotations to render at a higher or lower resol
316312
317313
### `initial_line_size`
318314
319-
The line width with which new annotations are drawn initially. Units are pixels in the underlying image. When this value is not included, the default value of `4` is used.
315+
The line width with which new annotations are drawn initially. Units are pixels in the underlying image. When this value is not included, the default value of `5` is used.
320316
321317
### `anno_scaling_mode`
322318
@@ -434,9 +430,6 @@ Keybind to set the zoom level to show the full image. Default is `shift+r`.
434430
### `create_point_annotation_keybind`
435431
Keybind to create a point annotation at the mouse location. Default is `c`. Requires the active subtask to have a `point` mode.
436432
437-
### `default_annotation_size`
438-
Default size of annotations in pixels. Default is `6`.
439-
440433
### `delete_annotation_keybind`
441434
Keybind to delete the annotation that the mouse is hovering over. Default is `d`.
442435
@@ -486,7 +479,10 @@ Keybind to increment the annotation size for the current subtask. Default is `=`
486479
Keybind to decrement the annotation size for the current subtask. Default is `-`.
487480
488481
### `annotation_vanish_keybind`
489-
Keybind to toggle vanish mode for annotations in the current subtask (lowercase toggles current subtask, uppercase toggles all subtasks). Default is `v`.
482+
Keybind to toggle vanish mode for annotations in the current subtask. Default is `v`.
483+
484+
### `annotation_vanish_all_keybind`
485+
Keybind to toggle vanish mode for all subtasks. Default is `shift+v`
490486
491487
### `fly_to_max_zoom`
492488
Maximum zoom factor used when flying-to an annotation. Default is `10`, value must be > `0`.

demo/box-roi.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@
106106
}
107107
],
108108

109-
// size in underlying image pixels
110-
"line_size": roi_line_size,
111-
112109
// (nullable) frame ann was created for
113110
"frame": 0,
114111

demo/resume-from.html

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
{"class_id": 11, "confidence": 1.0},
4040
{"class_id": 10, "confidence": 0.0},
4141
],
42-
"line_size": 4
4342
},
4443
{
4544
"id": "4a586dc4-0efa-4563-a42b-8eea3dd5b04b",
@@ -48,7 +47,6 @@
4847
"classification_payloads": [
4948
{"class_id": 10, "confidence": 1.0},
5049
],
51-
"line_size": 4
5250
},
5351
{
5452
"id": "4a686dc4-0efa-4563-a42b-8eea3dd5b04b",
@@ -57,7 +55,6 @@
5755
"classification_payloads": [
5856
{"class_id": 12, "confidence": 1.0},
5957
],
60-
"line_size": 4
6158
},
6259
{
6360
"id": "4a186dc4-0efa-4563-a42b-8eea3dd5b04b",
@@ -185,7 +182,6 @@
185182
"confidence": 0
186183
}
187184
],
188-
"line_size": 3,
189185
"text_payload": "",
190186
"annotation_meta": null
191187
},
@@ -224,7 +220,6 @@
224220
"confidence": 0
225221
}
226222
],
227-
"line_size": 4,
228223
"text_payload": "",
229224
"annotation_meta": null
230225
}
@@ -299,8 +294,26 @@
299294

300295
});
301296
</script>
297+
<style>
298+
body {
299+
margin: 0;
300+
padding: 0;
301+
}
302+
.test-banner {
303+
background-color: #333;
304+
color: white;
305+
padding: 2px;
306+
text-align: center;
307+
font-family: sans-serif;
308+
}
309+
</style>
302310
</head>
303311
<body>
304-
<div id="container" style="width: 100%; height: 100vh; position: absolute; top: 0; left: 0;"></div>
312+
<div class="test-banner">
313+
<h2>Test Banner - This tests that the collapse button respects container positioning</h2>
314+
</div>
315+
<div id="wrapper">
316+
<div id="container" style="width: 100%; height: calc(100vh - 140px);"></div>
317+
</div>
305318
</body>
306319
</html>

demo/row-filtering-example.html

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"confidence": 0.21
5151
}
5252
],
53-
"line_size": 6.831220813875917,
5453
"containing_box": {
5554
"tlx": 112.73736341325133,
5655
"tly": 263.0492900187559,
@@ -84,7 +83,6 @@
8483
"confidence": 0.51
8584
}
8685
],
87-
"line_size": 6.831220813875917,
8886
"containing_box": {
8987
"tlx": 370.6589647476967,
9088
"tly": 459.4796486509494,
@@ -118,7 +116,6 @@
118116
"confidence": 0.41
119117
}
120118
],
121-
"line_size": 6.831220813875917,
122119
"containing_box": {
123120
"tlx": 546.5922424791396,
124121
"tly": 823.302834639273,
@@ -152,7 +149,6 @@
152149
"confidence": 0.01
153150
}
154151
],
155-
"line_size": 6.831220813875917,
156152
"containing_box": {
157153
"tlx": 444.10683797538644,
158154
"tly": 210.0984976918168,
@@ -186,7 +182,6 @@
186182
"confidence": 0.81
187183
}
188184
],
189-
"line_size": 6.831220813875917,
190185
"containing_box": {
191186
"tlx": 806.2219338886475,
192187
"tly": 206.68231754169167,
@@ -220,7 +215,6 @@
220215
"confidence": 0.71
221216
}
222217
],
223-
"line_size": 6.831220813875917,
224218
"containing_box": {
225219
"tlx": 869.4212666659619,
226220
"tly": 705.4446194599569,
@@ -254,7 +248,6 @@
254248
"confidence": 0.71
255249
}
256250
],
257-
"line_size": 6.831220813875917,
258251
"containing_box": {
259252
"tlx": 1163.2127595767208,
260253
"tly": 693.4879889345191,
@@ -288,7 +281,6 @@
288281
"confidence": 0.61
289282
}
290283
],
291-
"line_size": 6.831220813875917,
292284
"containing_box": {
293285
"tlx": 968.49049101959,
294286
"tly": 452.64728835069917,
@@ -322,7 +314,6 @@
322314
"confidence": 0.51
323315
}
324316
],
325-
"line_size": 6.831220813875917,
326317
"containing_box": {
327318
"tlx": 929.2044192931512,
328319
"tly": 153.73152521475257,
@@ -356,7 +347,6 @@
356347
"confidence": 1
357348
}
358349
],
359-
"line_size": 6.831220813875917,
360350
"containing_box": {
361351
"tlx": 1084.6406161238435,
362352
"tly": 881.3778971913998,
@@ -390,7 +380,6 @@
390380
"confidence": 0.41
391381
}
392382
],
393-
"line_size": 6.831220813875917,
394383
"containing_box": {
395384
"tlx": 1390.3887395600402,
396385
"tly": 100.78073288781346,
@@ -424,7 +413,6 @@
424413
"confidence": 0.5
425414
}
426415
],
427-
"line_size": 6.831220813875917,
428416
"containing_box": {
429417
"tlx": 1393.8049197101654,
430418
"tly": 377.4913250479469,
@@ -458,7 +446,6 @@
458446
"confidence": 1
459447
}
460448
],
461-
"line_size": 6.831220813875917,
462449
"containing_box": {
463450
"tlx": 1600.4838187927342,
464451
"tly": 712.2769797602072,
@@ -492,7 +479,6 @@
492479
"confidence": 0.91
493480
}
494481
],
495-
"line_size": 6.831220813875917,
496482
"containing_box": {
497483
"tlx": 1537.2844860154198,
498484
"tly": 263.0492900187559,
@@ -526,7 +512,6 @@
526512
"confidence": 0.21
527513
}
528514
],
529-
"line_size": 6.831220813875917,
530515
"containing_box": {
531516
"tlx": 1889.1510414783056,
532517
"tly": 582.4621340554531,
@@ -560,7 +545,6 @@
560545
"confidence": 0.11
561546
}
562547
],
563-
"line_size": 6.831220813875917,
564548
"containing_box": {
565549
"tlx": 1308.4004159570377,
566550
"tly": 563.6731432297651,
@@ -603,7 +587,6 @@
603587
"confidence": 0
604588
}
605589
],
606-
"line_size": 6.831220813875917,
607590
"containing_box": {
608591
"tlx": 251.09265949331802,
609592
"tly": 148.60725498956492,
@@ -646,7 +629,6 @@
646629
"confidence": 0
647630
}
648631
],
649-
"line_size": 6.831220813875917,
650632
"containing_box": {
651633
"tlx": 1311.816596107163,
652634
"tly": 105.90500311300111,
@@ -697,7 +679,6 @@
697679
"confidence": 1
698680
}
699681
],
700-
"line_size": 6.831220813875917,
701682
"containing_box": {
702683
"tlx": 792.5572132881471,
703684
"tly": 114.44545348831386,

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ export class ULabel {
258258
// TODO (joshua-dean): this is never assigned, is it used?
259259
demo_canvas_context: CanvasRenderingContext2D;
260260
edited: boolean;
261+
all_subtasks_vanished: boolean;
261262
};
262263

263264
config: Configuration;

0 commit comments

Comments
 (0)