Skip to content

v0.4.2

Choose a tag to compare

@henryavila henryavila released this 16 Apr 02:23
· 18 commits to main since this release

Bug Fix: Annotation highlight infinite loop

Root cause: highlightLineRange() mutated the DOM via surroundContents() while iterating with TreeWalker, causing the walker to revisit wrapped text nodes infinitely — confirmed by STATUS_STACK_OVERFLOW in Chrome DevTools.

Fixes

  • Collect-then-wrap pattern — separate TreeWalker iteration from DOM mutation
  • Skip nested elements with same data-source-line to prevent double-wrapping
  • normalize() after mark removal to prevent text node fragmentation
  • Debounced signal updates (50ms) to collapse rapid WS broadcasts into one re-render
  • Remote broadcast forwarding via POST /api/broadcast (was silently dropped)
  • /api/review/status returns 200 in non-review mode (was 404)

Tests

693 passing (+6 new covering debounce, fragmentation, and broadcast forwarding)