SIGN IN SIGN UP

fix(ui): keep GitHub alert titles from breaking annotation anchors and quotes (#1535)

#1509 hoisted an alert's bold-only first line onto the icon row and #1511 put
a visually hidden "<Type>: " span there. Both changed the DOM text of an
annotatable block, which the annotation layer reads.

- Viewer turns on the hook's content-verifying restore. web-highlighter's
  stored metas are positional (`parentIndex` is the index among all elements
  of that tag), so a titled alert that stopped contributing its own `<p>`
  renumbers every later anchor: a pre-upgrade draft resolved silently onto the
  wrong text with nothing to reject it. Verification drops the bad resolve and
  falls through to the text-search rescue. Cost measured at ~5% of a
  300-annotation restore (no extra DOM query; `getDoms` was already called).

- The sr-only type word is marked `annotation-exclude`, and a new annotation's
  quote drops excluded chrome. The class alone was not enough: the highlighter
  skips excluded nodes when painting and searching, but the quote comes from
  the browser's selection string, so a drag starting over the icon still
  produced `originalText: "Tip:Browser quirks"` — a word the reviewer never
  selected, exported to the agent, and unfindable on a share-link restore. The
  painted highlight is now the authority on content and the selection string on
  formatting: excluded runs are removed and the result kept only when it
  matches what was painted, so any unrecognized shape leaves the quote as is.

- An emoji-only first line becoming the alert's icon is intended (the
  documented grammar admits an emoji without a title precisely so it can be the
  icon); the existing case now records that decision and pins that the line is
  relocated, not duplicated.
M
Michael Ramos committed
f93dc6a362beeb904cbafd07ac812cde1c0a1e9b
Parent: 4fd3b42
Committed by GitHub <noreply@github.com> on 9/15/2026, 10:32:08 AM