Release Notes: v2.4.4 — Span Annotation Fixes & UX Improvements
Bug-fix release that resolves span overlay misalignment issues affecting all span annotation tasks, plus a small UX improvement for single-label span schemas.
Bug Fixes
Span Overlay Positioning Fix
- Fixed overlays rendering on the wrong line of text. The root cause was
white-space: pre-wrapon#text-contentbeing inherited by the#span-overlayscontainer. Template whitespace inside#span-overlayswas rendered as real content, causing absolutely-positioned overlays (which lacked explicittop/left) to use a "hypothetical static position" shifted ~30px down — exactly one line height. On multi-line text, overlays appeared on a completely different line than the selected text. - Fixed
collectTextNodeswalking into overlay containers. The text-node walker ingetPositionsFromOffsets,getTextPositions, andgetOffsetsFromSelectionrecursed into#span-overlayschildren, causing overlay label text ("News", delete button "x") to inflate cumulative character offsets. Each successive span rendered at a progressively worse position. - Fixed
createSpanWithAlgorithmusing fragileindexOf-based positioning. The initial span overlay was positioned usinggetTextPositions()which ignored the provided character offsets and searcheddata-original-textwithindexOf(text)instead. Whendata-original-textdiffered from DOM text (e.g., afterloadAnnotationsoverwrites it with normalized API text), theindexOfresult pointed to wrong positions. Now usesgetPositionsFromOffsets()(offset-based DOM walk) consistently, matching the reload rendering path.
Python Compatibility
- Fixed Python 3.9 compatibility: replaced
match/casewithif/elifinai_cache.py
Other Fixes
- Added
__main__.pyto enablepython -m potatoexecution - Fixed marker registry, conversation-tree bug, and KeyError scope (PR #142)
New Features
Auto-Select Single Span Label
When a span schema has exactly one label, it is now automatically selected on page load. Annotators can immediately start highlighting text without needing to click the label checkbox first. Multi-label span schemas are unaffected and still require explicit selection. The checkbox remains visible and can be unchecked to disable span annotation mode.
Upgrade
pip install --upgrade potato-annotation==2.4.4