Skip to content

Distinguish link types in the inline link popover (RND-12165) - #4495

Draft
zenoachtig wants to merge 1 commit into
mainfrom
claude/tender-allen-7fti70-rnd-12165
Draft

Distinguish link types in the inline link popover (RND-12165)#4495
zenoachtig wants to merge 1 commit into
mainfrom
claude/tender-allen-7fti70-rnd-12165

Conversation

@zenoachtig

Copy link
Copy Markdown
Contributor

Proposed changes

RND-12165: the hover popover for inline links made every link look like a link to another page — it surfaced a page/URL title as the destination heading even for a link to a heading on the same page, and external links dumped the raw URL as the heading.

Changes in InlineLink.tsx (the InlineLinkTooltipWrapper), using only data already available to the component:

  • Same-page anchor (ref.kind === 'anchor' with no page): no longer shows the current page's title as if it were a destination. It keeps the "Jump to section" breadcrumb and shows the target section (derived by humanizing the anchor id, e.g. installation-guideInstallation guide). The true section title is not resolved here on purpose — resolveAnchorText is intentionally disabled for performance — so the humanized anchor is a reasonable stand-in; resolving the exact heading text is a possible follow-up.
  • External link (ref.kind === 'url'): the heading now shows the domain (hostname without www.) with the full URL as sub-text, instead of the raw URL as a pseudo-title.

Two small private helpers (getHostname, humanizeAnchor) were added; both fail safe (fall back to the previous text) when parsing fails.

Distinctions made vs. follow-up

  • ✅ (a) within-page anchor — reframed as an on-page section jump.
  • ✅ (d) external — domain shown as the indicator, full URL as sub-text (the arrow-up-right icon on the anchor itself already marks external links).
  • ➖ (b) within-space vs. (c) cross-space — already partly distinguished today: cross-space links get the target space/section title prepended as the first breadcrumb (via resolveContentRefInSpace), while within-space links show only page-group ancestors. This wrapper does not have the page context, so it cannot cheaply add a dedicated cross-space badge/icon. Flagging a clearer cross-space indicator (icon/label) as a product/design follow-up rather than inventing it here.

Assumptions to sanity-check: humanizing the anchor id reads well for heading-slug anchors (the common case) but will look odd for opaque block-id anchors; and email links are unchanged.

Changelog

  • [Fix] Inline link popovers now distinguish a same-page section jump from a link to another page, and show the domain for external links instead of the raw URL.

🌙 Night-shift draft — NOT verified in a running browser. Please sanity-check before marking ready.


Generated by Claude Code

Same-page anchor links now show the target section (humanized anchor)
instead of the current page's title, and external links show their
domain as the heading with the full URL as sub-text.

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

linear-code Bot commented Aug 13, 2026

Copy link
Copy Markdown

RND-12165

@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: db9fb17

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
gitbook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@argos-ci

argos-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2-cloudflare (Inspect) ⚠️ Changes detected (Review) 7 changed, 4 ignored Aug 13, 2026, 12:33 AM
customers-v2-vercel (Inspect) ⚠️ Changes detected (Review) 1 changed, 4 removed, 1 failure, 4 ignored Aug 13, 2026, 12:32 AM
v2-cloudflare (Inspect) ⚠️ Changes detected (Review) 5 changed, 3 ignored Aug 13, 2026, 12:36 AM
v2-vercel (Inspect) ✅ No changes detected 5 ignored Aug 13, 2026, 12:33 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants