Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 1 addition & 75 deletions .github/tasks.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,3 @@
## Tasks
- [x] Add a sideways, clickable arrow to minimize the entire toolbox
- [x] Add collapse button to toolbox HTML
- [x] Add CSS styles for collapsed state
- [x] Add click handler to toggle collapsed state
- [x] Store collapsed state in localStorage
- [x] Test functionality
- [x] Move arrow to top of toolbox (instead of middle)
- [x] Make annbox expand when toolbox is collapsed
- [x] Make collapsed button visible
- [x] Create a keybinds toolbox item
- [x] Research existing keybinds in the codebase
- [x] Create basic keybinds toolbox item file
- [x] Register keybinds toolbox item in configuration
- [x] Display list of all keybinds (the key) labeled with the name
- [x] Add hover tooltips with detailed descriptions (using title attribute)
- [x] Add collision detection and red highlighting
- [x] Implement editing for configurable keybinds
- [x] Test functionality
- [x] Add support for keybind "chords" (ie, "shift+i")
- [x] Update keybind edit handler to capture modifier keys (shift, ctrl, alt)
- [x] Create chord string format (e.g., "shift+i", "ctrl+alt+d")
- [x] Update key comparison logic in listeners to support chords
- [x] Update display to show chords properly (displays captured chord automatically)
- [x] Test chord functionality
- [x] Store collapse/expand for applicable toolbox items
- [x] Keybinds
- [x] Annotation List
- [x] Image Filters
- [x] Make all keybinds configurable
- [x] Minor changes to existing keybinds
- [x] Rename "Change Zoom" keybind to "Reset Zoom"
- [x] Change "Toggle Mode" label in the keybind toolbox item to "Toggle Annotation Mode"
- [x] Make class keybinds configurable in the keybinds toolbox item
- [x] Store keybinds in local storage
- [x] Only save them when a user explicitly sets it
- [x] For keybinds using a user setting, add a button to reset that keybind to default (should change keybind and delete stored keybind)
- [x] Add "Reset All to Default" button in the keybinds toolbox item that resets all keybinds and deletes stored user keybinds
- [x] Add a light yellow highlight on keybinds that are using a user setting instead of a default
- [x] Make sure that we update collison highlights after resetting a keybind to default
- [x] Only show the reset to default for keybinds with user settings, not on those already at the default
- [x] Make sure the class keybinds also are included in the keybind collision checks
- [x] Fix reset to default to use constructor-provided config values instead of hardcoded Configuration defaults
- [x] Centralize keybind config property names in Configuration.KEYBIND_CONFIG_KEYS constant
- [x] Make KEYBIND_CONFIG_KEYS dynamically generated from Configuration class properties
- [x] Rename create_bbox_on_initial_crop to create_bbox_on_initial_crop_keybind for consistency
- [x] Replace any console outputs with `log_message`
- [x] Replace the "reset_zoom_keybind" with two separate keybinds:
- [x] Add "show_full_image_keybind" property to Configuration
- [x] Update listeners.ts to use both keybinds independently
- [x] Update toolbox.ts to use both keybinds independently
- [x] Update api_spec.md to document both keybinds
- [x] Write e2e tests for the keybind toolbox item
- [x] Ability to set keybind to a chord
- [x] Ability to reset keybind
- [x] Ability to set a class keybind
- [x] Run tests to verify they pass
- [x] Write a e2e test for each keybind
- [x] reset_zoom_keybind (r)
- [x] show_full_image_keybind (shift+r)
- [x] create_point_annotation_keybind (c)
- [x] delete_annotation_keybind (d)
- [x] switch_subtask_keybind (z)
- [x] toggle_annotation_mode_keybind (u)
- [x] create_bbox_on_initial_crop_keybind (f)
- [x] toggle_brush_mode_keybind (g)
- [x] toggle_erase_mode_keybind (e)
- [x] increase_brush_size_keybind (])
- [x] decrease_brush_size_keybind ([)
- [x] annotation_size_small_keybind (s)
- [x] annotation_size_large_keybind (l)
- [x] annotation_size_plus_keybind (=)
- [x] annotation_size_minus_keybind (-)
- [x] annotation_vanish_keybind (v)
- [x] fly_to_next_annotation_keybind (tab)
- [x] fly_to_previous_annotation_keybind (shift+tab)
- [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.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ build/*
output.txt
test-results/
playwright-report/
dist
dist
*.log
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented here.

## [unreleased]

## [0.22.1] - Jan 13th, 2026
- Don't draw annotations when a subtask is vanished
- Add configurable `annotation_vanish_all_keybind`
- Track annotation size per subtask
- Remove annotation size cookie, since it was tracking just one size per annotation session
- Deprecated the `default_annotation_size` argument in the configuration object. Use the `initial_line_size` argument instead. See api_spec.md for details.
- Fix toolbox collapse arrow positioning, and make frame annotation dialogs disappear on collapse
- Removed the `line_size` property from annotation objects. `subtask.state.line_size` determined the size of drawn annotations within a subtask.

## [0.22.0] - Oct 30th, 2025
- Add collapsible toolbox with arrow button at top
- Toolbox collapse state persists in browser
Expand Down
14 changes: 5 additions & 9 deletions api_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class ULabel({
reset_zoom_keybind: string,
show_full_image_keybind: string,
create_point_annotation_keybind: string,
default_annotation_size: number,
delete_annotation_keybind: string,
keypoint_slider_default_value: number,
filter_annotations_on_load: boolean,
Expand Down Expand Up @@ -196,9 +195,6 @@ As you can see, each subtask will have a corresponding list of annotation object
}
],

// size in underlying image pixels
"line_size": "<number>",

// (nullable) frame ann was created for
"frame": "<int>",

Expand Down Expand Up @@ -316,7 +312,7 @@ In some cases, you may want the annotations to render at a higher or lower resol

### `initial_line_size`

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.
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.

### `anno_scaling_mode`

Expand Down Expand Up @@ -434,9 +430,6 @@ Keybind to set the zoom level to show the full image. Default is `shift+r`.
### `create_point_annotation_keybind`
Keybind to create a point annotation at the mouse location. Default is `c`. Requires the active subtask to have a `point` mode.

### `default_annotation_size`
Default size of annotations in pixels. Default is `6`.

### `delete_annotation_keybind`
Keybind to delete the annotation that the mouse is hovering over. Default is `d`.

Expand Down Expand Up @@ -486,7 +479,10 @@ Keybind to increment the annotation size for the current subtask. Default is `=`
Keybind to decrement the annotation size for the current subtask. Default is `-`.

### `annotation_vanish_keybind`
Keybind to toggle vanish mode for annotations in the current subtask (lowercase toggles current subtask, uppercase toggles all subtasks). Default is `v`.
Keybind to toggle vanish mode for annotations in the current subtask. Default is `v`.

### `annotation_vanish_all_keybind`
Keybind to toggle vanish mode for all subtasks. Default is `shift+v`

### `fly_to_max_zoom`
Maximum zoom factor used when flying-to an annotation. Default is `10`, value must be > `0`.
Expand Down
3 changes: 0 additions & 3 deletions demo/box-roi.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@
}
],

// size in underlying image pixels
"line_size": roi_line_size,

// (nullable) frame ann was created for
"frame": 0,

Expand Down
25 changes: 19 additions & 6 deletions demo/resume-from.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
{"class_id": 11, "confidence": 1.0},
{"class_id": 10, "confidence": 0.0},
],
"line_size": 4
},
{
"id": "4a586dc4-0efa-4563-a42b-8eea3dd5b04b",
Expand All @@ -48,7 +47,6 @@
"classification_payloads": [
{"class_id": 10, "confidence": 1.0},
],
"line_size": 4
},
{
"id": "4a686dc4-0efa-4563-a42b-8eea3dd5b04b",
Expand All @@ -57,7 +55,6 @@
"classification_payloads": [
{"class_id": 12, "confidence": 1.0},
],
"line_size": 4
},
{
"id": "4a186dc4-0efa-4563-a42b-8eea3dd5b04b",
Expand Down Expand Up @@ -185,7 +182,6 @@
"confidence": 0
}
],
"line_size": 3,
"text_payload": "",
"annotation_meta": null
},
Expand Down Expand Up @@ -224,7 +220,6 @@
"confidence": 0
}
],
"line_size": 4,
"text_payload": "",
"annotation_meta": null
}
Expand Down Expand Up @@ -299,8 +294,26 @@

});
</script>
<style>
body {
margin: 0;
padding: 0;
}
.test-banner {
background-color: #333;
color: white;
padding: 2px;
text-align: center;
font-family: sans-serif;
}
</style>
</head>
<body>
<div id="container" style="width: 100%; height: 100vh; position: absolute; top: 0; left: 0;"></div>
<div class="test-banner">
<h2>Test Banner - This tests that the collapse button respects container positioning</h2>
</div>
<div id="wrapper">
<div id="container" style="width: 100%; height: calc(100vh - 140px);"></div>
</div>
</body>
</html>
19 changes: 0 additions & 19 deletions demo/row-filtering-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"confidence": 0.21
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 112.73736341325133,
"tly": 263.0492900187559,
Expand Down Expand Up @@ -84,7 +83,6 @@
"confidence": 0.51
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 370.6589647476967,
"tly": 459.4796486509494,
Expand Down Expand Up @@ -118,7 +116,6 @@
"confidence": 0.41
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 546.5922424791396,
"tly": 823.302834639273,
Expand Down Expand Up @@ -152,7 +149,6 @@
"confidence": 0.01
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 444.10683797538644,
"tly": 210.0984976918168,
Expand Down Expand Up @@ -186,7 +182,6 @@
"confidence": 0.81
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 806.2219338886475,
"tly": 206.68231754169167,
Expand Down Expand Up @@ -220,7 +215,6 @@
"confidence": 0.71
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 869.4212666659619,
"tly": 705.4446194599569,
Expand Down Expand Up @@ -254,7 +248,6 @@
"confidence": 0.71
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 1163.2127595767208,
"tly": 693.4879889345191,
Expand Down Expand Up @@ -288,7 +281,6 @@
"confidence": 0.61
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 968.49049101959,
"tly": 452.64728835069917,
Expand Down Expand Up @@ -322,7 +314,6 @@
"confidence": 0.51
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 929.2044192931512,
"tly": 153.73152521475257,
Expand Down Expand Up @@ -356,7 +347,6 @@
"confidence": 1
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 1084.6406161238435,
"tly": 881.3778971913998,
Expand Down Expand Up @@ -390,7 +380,6 @@
"confidence": 0.41
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 1390.3887395600402,
"tly": 100.78073288781346,
Expand Down Expand Up @@ -424,7 +413,6 @@
"confidence": 0.5
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 1393.8049197101654,
"tly": 377.4913250479469,
Expand Down Expand Up @@ -458,7 +446,6 @@
"confidence": 1
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 1600.4838187927342,
"tly": 712.2769797602072,
Expand Down Expand Up @@ -492,7 +479,6 @@
"confidence": 0.91
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 1537.2844860154198,
"tly": 263.0492900187559,
Expand Down Expand Up @@ -526,7 +512,6 @@
"confidence": 0.21
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 1889.1510414783056,
"tly": 582.4621340554531,
Expand Down Expand Up @@ -560,7 +545,6 @@
"confidence": 0.11
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 1308.4004159570377,
"tly": 563.6731432297651,
Expand Down Expand Up @@ -603,7 +587,6 @@
"confidence": 0
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 251.09265949331802,
"tly": 148.60725498956492,
Expand Down Expand Up @@ -646,7 +629,6 @@
"confidence": 0
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 1311.816596107163,
"tly": 105.90500311300111,
Expand Down Expand Up @@ -697,7 +679,6 @@
"confidence": 1
}
],
"line_size": 6.831220813875917,
"containing_box": {
"tlx": 792.5572132881471,
"tly": 114.44545348831386,
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export class ULabel {
// TODO (joshua-dean): this is never assigned, is it used?
demo_canvas_context: CanvasRenderingContext2D;
edited: boolean;
all_subtasks_vanished: boolean;
};

config: Configuration;
Expand Down
Loading