Feature/confidence slider - #248
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new ConfidenceSlider toolbox item to filter (deprecate/show) spatial annotations by confidence across multiple spatial types and subtasks, while deprecating the legacy KeypointSlider.
Changes:
- Adds
ConfidenceSlider(configurable global + per-class modes) and a new public APIget_confidence_slider_value(). - Deprecates
KeypointSlider(retained for backwards compatibility) and updates default toolbox ordering to preferConfidenceSlider. - Adds unit + e2e coverage, updates docs/demos, and bumps version to
0.24.0.
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/types/index.test-d.ts | Extends AllowedToolboxItem type test coverage to include ConfidenceSlider. |
| tests/testing-utils/version_stub.js | Adds Jest stub for ESM src/version.js to keep unit tests CJS-compatible. |
| tests/testing-utils/blobs_stub.js | Adds Jest stub for ESM src/blobs.js (icons) to keep unit tests CJS-compatible. |
| tests/e2e/slider-api.spec.js | Adds e2e assertions for the new get_confidence_slider_value() API. |
| tests/e2e/confidence-slider.spec.js | Adds e2e coverage for DOM behavior, modes, config, and coexistence warning. |
| tests/confidence_slider.test.js | Adds unit tests for ConfidenceSlider filtering, modes, HTML, and default toolbox order. |
| tests/annotation_operators.test.js | Adds unit tests for new/updated confidence & class-definition operators. |
| src/version.js | Bumps runtime version constant to 0.24.0. |
| src/toolbox.ts | Adds warning when both KeypointSlider and ConfidenceSlider are enabled; moves slider classes out. |
| src/toolbox_items/confidence_slider.ts | Implements ConfidenceSlider and relocates deprecated KeypointSliderItem. |
| src/index.js | Adds get_confidence_slider_value() public API method. |
| src/configuration.ts | Adds enum entry + defaults + config wiring for ConfidenceSlider; updates default toolbox order. |
| src/annotation_operators.ts | Adds confidence/class utilities and generalized class-definition discovery for slider rendering. |
| package.json | Bumps package version to 0.24.0. |
| jest.config.js | Maps ESM modules (src/version, src/blobs) to test stubs for Jest. |
| index.d.ts | Extends public typings for new config/API and new confidence_slider deprecation key. |
| demo/row-filtering-example.html | Switches demo to use ConfidenceSlider and demonstrates config usage. |
| demo/resume-from.html | Updates demo data and toolbox_order to include ConfidenceSlider. |
| demo/multi-class.html | Enables ConfidenceSlider alongside deprecated KeypointSlider for demo/testing. |
| demo/live_demo.html | Adds varied-confidence annotations to better demonstrate the new slider behavior. |
| CHANGELOG.md | Adds 0.24.0 release notes covering slider changes and deprecations. |
| api_spec.md | Documents confidence_slider_toolbox_item config and the new public API method. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Confidence Slider
Description
ConfidenceSlidertoolbox item (AllowedToolboxItem.ConfidenceSlider) that deprecates (hides) or shows spatial annotations based on their confidence values. Unlike the now-deprecatedKeypointSlider, it works with all spatial annotation types that have a confidence payload (bbox,bbox3,polygon,polyline,contour,tbar, andpoint), across every subtask.class_filter_mode("toggle","all-only", or"class-only").confidence_slider_toolbox_item, includingfilter_min/filter_max/step_value, per-classdefault_values,target_spatial_types, andtarget_class_ids.get_confidence_slider_value()public API method to get the current confidence slider values.toolbox_order(used when none is provided) now includesConfidenceSliderinstead ofKeypointSlider.KeypointSliderandConfidenceSlidertoolbox items are enabled at once.KeypointSlidertoolbox item andget_keypoint_slider_value()in favor of theConfidenceSliderandget_confidence_slider_value(). TheKeypointSlideris retained for backwards compatibility and continues to filter onlypointannotations. It will be removed in a future release.PR Checklist
package.jsonhas been bumped since last releasepackage.jsonandsrc/version.jsapi_spec.md)changelog.mdBreaking API Changes
Nothing yet. In a future release the
KeypointSliderwill be removed and replaced by the newConfidenceSlider