Files
Tom MoorandClaude f5b45e3d88 feat: section-aware unfurl previews for heading links (#12857)
* feat: section-aware unfurl previews for heading links

When a link targets a specific heading (URL hash anchor), the hover
preview now shows the content of that section rather than the top of
the document.

Adds DocumentHelper.getAnchorContent which extracts the Markdown for the
section beginning at the heading matching a given anchor, spanning until
the next heading of the same or higher level. The urls.unfurl endpoint
passes the URL hash through to the document presenter for both internal
and public share links.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185Tt87p63vsnAC8oGSLLRs

* fix: retain heading anchor in internal document unfurl url

The internal-document unfurl branch never passed a url to the presenter,
so the response fell back to document.url without the hash. Clicking the
hover preview then navigated to the top of the document rather than the
summarized section. Re-append the anchor in the presenter fallback so the
unfurl points at the same heading it previews.

Also supports the mention anchorId path: document mentions serialize their
anchorId into the href hash, which flows through this same path.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-11 08:05:56 -04:00
..
2026-03-14 23:02:20 -04:00
2026-03-14 23:02:20 -04:00
2026-02-20 18:53:00 -05:00
2023-03-17 08:23:32 -07:00