Files
outline/server
Tom MoorandClaude Opus 4.8 19a4922ed1 fix: Ensure mention in doc emails always include context (#12787)
* fix: Include surrounding container in document mention emails

getNodeForMentionEmail only preserved tables and checkbox lists around a
mention; mentions inside bullet/numbered lists, blockquotes and notices were
returned as a bare paragraph with their structure stripped. Add those
containers so the snippet keeps its context.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* refactor: Resolve mention position and walk ancestors for email snippet

Replace the top-down scan-and-guess over a block-node allowlist with a single
position resolve and an ancestor walk. Behaviour is unchanged — same outermost
container, minified to the child on the path to the mention — but extraction is
idiomatic ProseMirror and drops the redundant subtree traversals.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* refactor: Size-bound mention email snippet, drop container special-casing

Replace the per-type container allowlist and minify logic with a single rule:
climb the mention's ancestor chain outward and keep the largest complete block
that still fits a character budget. This drops all special-casing, is robust to
new node types, and naturally bounds snippet size.

Semantics change accordingly — a small container is now shown whole (with its
sibling rows/items) rather than minified to the mention's child, degrading to an
inner block once the container overflows the budget. Tests updated to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat: Window mention email snippet to nearby list items

Lists can be long, so instead of including the whole list as the size-bounded
walk would, trim a surrounding list to the mentioned item plus one sibling on
either side. Uses the nearest list ancestor so nested lists show the items
closest to the mention. Non-list content keeps the size-bounded behaviour.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: Ensure mention in doc emails always include context

* PR feedback

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 19:28:26 -04:00
..