Conversation
Owner
flipbit
commented
Mar 6, 2026
- Add automatic image resizing support
setPosition() now multiplies note coordinates by scale factors to convert from natural pixel space to rendered pixel space. resetPosition() divides rendered coordinates by scale factors to store natural pixel values.
When autoResize !== false (default true), attach a ResizeObserver to the canvas that recomputes scale factors and rebuilds annotation views when the container resizes. Active edits are cancelled on resize. The observer is disconnected on destroy().
Replace flaky hover-shows-tooltip test (same issue as pre-existing jquery-basics/vanilla-basics hover failures) with reliable renders- 4-annotations test. Fix viewport resize test to shrink below the 700px CSS breakpoint so the responsive container actually changes width.
…nt cancelEdit - Extract duplicated scaled-image test helper from 3 test files into test/setup.ts as createScaledTestImage() - Remove redundant cancelEdit() call in rescale() since destroyViews() already handles it
Replace manual scaleX/scaleY multiplication and division in annotate-view.ts and annotate-edit.ts with centralized toRendered() and toNatural() methods. resetPosition now reads natural coords from the edit note (set by save handler) instead of re-deriving them from rendered area styles.
…(C1 fix) The image element is now a visible child of the canvas div instead of being hidden and replaced with a CSS background-image. This provides intrinsic sizing via the image itself and simplifies overlay positioning with CSS inset:0. The destroy() method restores the image to its original DOM position with guards for multi-instance and framework (React) unmount scenarios.
When a ResizeObserver fires during an active edit (e.g., mobile keyboard show/hide), the rescale is now deferred instead of immediately destroying the edit form. The pending rescale is flushed after save, delete, or cancel.
React: pass autoResize ?? true to core (was passing undefined when omitted). Vue: change autoResize prop default from undefined to true. Add autoResize prop tests for both wrappers.
- Remove `width: 100%` from `.image-annotate-canvas > img` to respect explicit HTML width attributes (fixes explicit-size scaling test) - Update hover tooltip tests to find the tooltip within its parent area element, matching the new DOM structure where tooltips are children of their area (not siblings appended to the view overlay) - Account for 1px canvas border in explicit-size dimension assertion
- Replace NPM_TOKEN secret with OIDC trusted publishing - Add npm-publish environment and id-token permission - Add --provenance --access public flags - Bump version to 2.0.0-beta.2
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.