Skip to content

fix/set-annotations - #253

Merged
TrevorBurgoyne merged 2 commits into
mainfrom
hotfix/set-annotations
Aug 13, 2026
Merged

fix/set-annotations#253
TrevorBurgoyne merged 2 commits into
mainfrom
hotfix/set-annotations

Conversation

@TrevorBurgoyne

@TrevorBurgoyne TrevorBurgoyne commented Aug 13, 2026

Copy link
Copy Markdown
Member

fix/set-annotations

Description

  • Fix regression in set_annotations() where hover feedback and the brush stopped working after a swap. The 0.26.1 bulk-teardown path called $("#canvasses__<subtask>").empty(), which removed not just the per-annotation canvases but also the subtask's front canvas and the #dialogs__<subtask> container (which owns the brush circle and polygon ender). state.front_context was left pointing at a detached canvas so hover highlights painted into nothing, and the brush had no parent to attach to. The teardown now removes only > canvas.annotation_canvas children, leaving the front/back canvases and dialogs container intact.
  • New demo: demo/set-annotations.html with buttons that swap through empty / small / medium / large / RLE-bitmask / raw-Uint8Array-bitmask presets so this regression stays visible.

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

No

@TrevorBurgoyne
TrevorBurgoyne requested a lite review from Copilot August 13, 2026 16:53
@TrevorBurgoyne TrevorBurgoyne added the bug Something isn't working label Aug 13, 2026

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

Fixes a set_annotations() regression where bulk teardown removed the subtask’s front canvas and dialogs container (breaking hover feedback and brush UI), and adds a dedicated demo page to exercise annotation swapping scenarios.

Changes:

  • Update bulk teardown to remove only per-annotation canvases (canvas.annotation_canvas) instead of emptying the entire #canvasses__<subtask> container.
  • Strengthen the unit test to reflect the init-time DOM structure and assert the front/back canvases + dialogs container survive teardown.
  • Bump library version to 0.26.2 and add a new set-annotations demo + demo URL listing.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/annotation.test.js Updates teardown test to ensure only per-annotation canvases are removed and critical UI containers remain.
src/index.js Fixes teardown selector to preserve front/back canvases and dialogs container during set_annotations().
src/version.js Bumps exported version to 0.26.2.
package.json Bumps package version to 0.26.2.
package-lock.json Keeps lockfile version metadata in sync with 0.26.2.
demo/set-annotations.html Adds a new demo page to swap through multiple annotation presets (including bitmask variants).
demo.js Adds the new demo URL to the local demo server output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package.json
@TrevorBurgoyne
TrevorBurgoyne merged commit 25e519e into main Aug 13, 2026
4 checks passed
@TrevorBurgoyne
TrevorBurgoyne deleted the hotfix/set-annotations branch August 13, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants