Distinguish link types in the inline link popover (RND-12165) - #4495
Draft
zenoachtig wants to merge 1 commit into
Draft
Distinguish link types in the inline link popover (RND-12165)#4495zenoachtig wants to merge 1 commit into
zenoachtig wants to merge 1 commit into
Conversation
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
🦋 Changeset detectedLatest commit: db9fb17 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(theInlineLinkTooltipWrapper), using only data already available to the component:ref.kind === 'anchor'with nopage): 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-guide→Installation guide). The true section title is not resolved here on purpose —resolveAnchorTextis intentionally disabled for performance — so the humanized anchor is a reasonable stand-in; resolving the exact heading text is a possible follow-up.ref.kind === 'url'): the heading now shows the domain (hostname withoutwww.) 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
resolveContentRefInSpace), while within-space links show only page-group ancestors. This wrapper does not have the pagecontext, 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
🌙 Night-shift draft — NOT verified in a running browser. Please sanity-check before marking ready.
Generated by Claude Code