Skip to content

Feature/confidence slider - #248

Merged
TrevorBurgoyne merged 11 commits into
mainfrom
feature/confidence-slider
Jul 22, 2026
Merged

Feature/confidence slider#248
TrevorBurgoyne merged 11 commits into
mainfrom
feature/confidence-slider

Conversation

@TrevorBurgoyne

Copy link
Copy Markdown
Member

Confidence Slider

Description

  • Add ConfidenceSlider toolbox item (AllowedToolboxItem.ConfidenceSlider) that deprecates (hides) or shows spatial annotations based on their confidence values. Unlike the now-deprecated KeypointSlider, it works with all spatial annotation types that have a confidence payload (bbox, bbox3, polygon, polyline, contour, tbar, and point), across every subtask.
    • Supports a single global "all" slider and/or per-class sliders, controlled by class_filter_mode ("toggle", "all-only", or "class-only").
    • Configurable via confidence_slider_toolbox_item, including filter_min/filter_max/step_value, per-class default_values, target_spatial_types, and target_class_ids.
  • Add get_confidence_slider_value() public API method to get the current confidence slider values.
  • The default toolbox_order (used when none is provided) now includes ConfidenceSlider instead of KeypointSlider.
  • Log a warning when both the KeypointSlider and ConfidenceSlider toolbox items are enabled at once.
  • Deprecate the KeypointSlider toolbox item and get_keypoint_slider_value() in favor of the ConfidenceSlider and get_confidence_slider_value(). The KeypointSlider is retained for backwards compatibility and continues to filter only point annotations. It will be removed in a future release.

PR Checklist

  • Merged latest main
  • Version number in package.json has been bumped since last release
  • Version numbers match between package package.json and src/version.js
  • Updated documentation if necessary (currently just in api_spec.md)
  • Added changes to changelog.md

Breaking API Changes

Nothing yet. In a future release the KeypointSlider will be removed and replaced by the new ConfidenceSlider

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 API get_confidence_slider_value().
  • Deprecates KeypointSlider (retained for backwards compatibility) and updates default toolbox ordering to prefer ConfidenceSlider.
  • 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.

Comment thread src/index.js
Comment thread src/toolbox_items/confidence_slider.ts Outdated
Comment thread api_spec.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 22 changed files in this pull request and generated 3 comments.

Comment thread src/annotation_operators.ts
Comment thread src/toolbox_items/confidence_slider.ts
Comment thread src/toolbox_items/confidence_slider.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 22 changed files in this pull request and generated 1 comment.

Comment thread src/toolbox_items/confidence_slider.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 22 changed files in this pull request and generated no new comments.

@TrevorBurgoyne
TrevorBurgoyne merged commit 11b5075 into main Jul 22, 2026
4 checks passed
@TrevorBurgoyne
TrevorBurgoyne deleted the feature/confidence-slider branch July 22, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants