Skip to content

🚸(frontend) allow opening "@page" links with ctrl/command/middle-mouse click#2170

Merged
AntoLC merged 1 commit intosuitenumerique:mainfrom
manuhabitela:interlinking-new-tab
Apr 7, 2026
Merged

🚸(frontend) allow opening "@page" links with ctrl/command/middle-mouse click#2170
AntoLC merged 1 commit intosuitenumerique:mainfrom
manuhabitela:interlinking-new-tab

Conversation

@manuhabitela
Copy link
Copy Markdown
Contributor

@manuhabitela manuhabitela commented Apr 3, 2026

Hey there Docs team 👋

Purpose

Make "interlinking" elements (links to other pages, made through the @ shortcut) usable with ctrl/command/shift+click and mousewheel click to open the link in a new tab or new window.

Proposal

Just add additional event listeners on the existing homemade span. An obviously better solution would have been to find a way to make actual <a> work, but I have to confess I didn't have the motivation to dig deeper. These small changes already make for a better UX I'd say.

Things to know:

  • ⚠️ I didn't manually test this on macOS right now, I have a little trouble setting up necessary stuff on my mac. I tested on Windows Edge/Windows+Linux Chrome/Windows+Linux Firefox/Android Chrome. If someone's willing to verify my mistakes on macOS/iOS for a few minutes just to be sure, it's greatly appreciated 😇
  • I didn't add any tests as I didn't find any existing ones for the interlinking component. But I'm not familiar with the codebase. Let me know if tests are necessary.

External contributions

Thank you for your contribution! 🎉

Please ensure the following items are checked before submitting your pull request:

  • I have read and followed the contributing guidelines
  • I have read and agreed to the Code of Conduct
  • I have signed off my commits with git commit --signoff (DCO compliance)
  • I have signed my commits with my SSH or GPG key (git commit -S)
  • My commit messages follow the required format: <gitmoji>(type) title description
  • I have added a changelog entry under ## [Unreleased] section (if noticeable change)
  • I have added corresponding tests for new features or bug fixes (if applicable)

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 3, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2e20e5fc-7300-4fe5-85fd-e3dc3a8d87bb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Collaborator

@Ovgodd Ovgodd left a comment

Choose a reason for hiding this comment

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

Nice thank You !

Links to other pages created through the "@" shortcut are not actual
anchor (`<a>`) elements seemingly due to conflicts with lower-lvl
code, noticeably when drag&dropping the elements.

So those "links" are actually span and we must handle the
"link behavior" ourselves.

This adds more usual "link behavior" to thoses, allowing users to
ctrl+click, command+click, shift+click and middle-mouse click to
interact with the links and open them in a new tab or new window.

Signed-off-by: Emmanuel Pelletier <manu@habite.la>
@AntoLC AntoLC force-pushed the interlinking-new-tab branch from dc526c9 to 4dcf752 Compare April 7, 2026 09:15
@AntoLC
Copy link
Copy Markdown
Collaborator

AntoLC commented Apr 7, 2026

Nice thank you, first PR 🎉

When I want to test with Mac, usually I use the e2e tests, you can test with a Safari browser.

@AntoLC AntoLC merged commit 4dcf752 into suitenumerique:main Apr 7, 2026
22 of 23 checks passed
@AntoLC AntoLC mentioned this pull request Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants