Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(docs-infra): Adds copy link to anchor functionality#65712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
SkyZeroZx wants to merge1 commit intoangular:main
base:main
Choose a base branch
Loading
fromSkyZeroZx:docs/copy-link

Conversation

@SkyZeroZx
Copy link
Contributor

@SkyZeroZxSkyZeroZx commentedNov 28, 2025
edited
Loading

Enables copying a direct link to any section by clicking its anchor. Also updates the aria-label to remove the code tag.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Currently when clicked in clipboard icon only navigate to anchor and don't copy o anything

What is the new behavior?

Add a tooltip that provides a similar user experience to the one used in the Chrome developer docs.

image

Also normalized text whencode tag is used in aria label

imageimage

Does this PR introduce a breaking change?

  • Yes
  • No

@angular-robotangular-robotbot added detected: featurePR contains a feature commit area: docs-infraAngular.dev application and infrastructure labelsNov 28, 2025
@ngbotngbotbot added this to theBacklog milestoneNov 28, 2025
@github-actions
Copy link

github-actionsbot commentedNov 28, 2025
edited
Loading

Deployed adev-preview for060fc4e to:https://ng-dev-previews-fw--pr-angular-angular-65712-adev-prev-shulgigx.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@JeanMeche
Copy link
Member

Thanks for the suggestion, I like the general idea but the tooltip is a bit too much visual noise imho.

Maybe we should only copy the lick (and show the tooltip) when hovering that link icon ?

@JeanMecheJeanMeche requested review fromJeanMeche and removed request foratscottNovember 28, 2025 21:19
@SkyZeroZx
Copy link
ContributorAuthor

Thanks for the suggestion, I like the general idea but the tooltip is a bit too much visual noise imho.

Maybe we should only copy the lick (and show the tooltip) when hovering that link icon ?

Updated

@JeanMeche
Copy link
Member

The heading text has a problem right now, it includes the "link to" text.
Screenshot 2025-11-29 at 10 29 56

I think we can/should simplify the change, the copy component should only do that an be included inside the anchor element.

SkyZeroZx reacted with thumbs up emoji

Enables copying a direct link to any section by clicking its anchor. Also updates the aria-label to remove the code tag.
constcustomId=customIdRegex.exec(anchorLessText)?.[1];
constlink=customId??getHeaderId(anchorLessText);
constlabel=anchorLessText.replace(/`(.*?)`/g,'<code>$1</code>').replace(customIdRegex,'');
constnormalizedLabel=label.replace(/<\/?code>/g,'');
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm adding this to prevent the tag code from going in the aria label; I don't know if we can take the previoustext, but from what I understand it wouldn't be possible.

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

Reviewers

@JeanMecheJeanMecheAwaiting requested review from JeanMeche

Assignees

No one assigned

Labels

adev: previewarea: docs-infraAngular.dev application and infrastructuredetected: featurePR contains a feature commit

Projects

None yet

Milestone

Backlog

Development

Successfully merging this pull request may close these issues.

2 participants

@SkyZeroZx@JeanMeche

[8]ページ先頭

©2009-2025 Movatter.jp