v0.5.1 — highlight precision, cache, popover focus
Fixed
- Highlight precision across inline elements. Annotations whose selection crossed inline
<code>,<strong>,<em>or<a>boundaries used to drift by the number of markdown-syntax characters in the path (backticks, asterisks,[).describe()andbuildDomRanges()now share a DOM walker (anchoring/v2/dom-source-map.js) that tracks the rendered-text cursor and the source-offset cursor in lockstep, re-syncing at every element withdata-source-start. Click-to-resolve uses the same walker. - Dev-server cache staleness. The HTML shell was read once at server import and served without a
Cache-Controlheader. Rebuildingdist/while a server was still running left it referencing a bundle hash that no longer existed; browsers further cached the stale shell by heuristic, so bug fixes were invisible after rebuilds. The shell is now re-read on every request and sent withCache-Control: no-cache, no-store, must-revalidate. Hashed asset paths keep theirimmutablecache header. - Popover textarea focus after double-click. Drag-select correctly focused the comment input, but double-click did not — the second
clickevent of a dblclick fires after the popover opens and can blur a freshly-focused textarea. Defense in depth: HTMLautoFocus(atomic with insertion) + synchronousfocus()inuseEffect+ a deferred re-focus viarequestAnimationFrame.
Changed
dist/index.htmlis no longer git-tracked. The file is still shipped viapackage.json#files(read from disk, not git), but rebuilds will no longer show up ingit statusandgit checkoutcan no longer silently revert the bundle reference to a hash that has been overwritten on disk.- Playwright E2E config switched to full Chromium (
channel: 'chromium') so synthesized double-click word-snapping matches real-browser behavior.
Tests
14 new automated checks pinning all three fixes: unit specs on the DOM walker, an integration spec on cache headers + shell freshness, and Playwright specs that exercise real mouse gestures (double-click, drag-select, cross-block drag) against a fixture mirroring the original bug report. Each fix was validated by stashing it and confirming the corresponding tests fail without it.
Upgrade
mdprobe updateOr npm install -g @henryavila/mdprobe@0.5.1. If you had mdprobe -d running in the background, restart it after the upgrade (or mdprobe stop first) so the new server code loads.
Full diff: v0.5.0...v0.5.1