Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to

## [Unreleased]

### Added

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

## [v4.8.5] - 2026-04-03

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,35 @@ export const LinkSelected = ({

const { emoji, titleWithoutEmoji } = getEmojiAndTitle(title);
const router = useRouter();
const href = `/docs/${docId}/`;

const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {
e.preventDefault();
void router.push(`/docs/${docId}/`);

// If ctrl or command is pressed, it opens a new tab. If shift is pressed, it opens a new window
if (e.metaKey || e.ctrlKey || e.shiftKey) {
window.open(href, '_blank');
return;
}
void router.push(href);
};

// This triggers on middle-mouse click
const handleAuxClick = (e: React.MouseEvent<HTMLDivElement>) => {
if (e.button !== 1) {
return;
}
e.preventDefault();
e.stopPropagation();
window.open(href, '_blank');
};

return (
<BoxButton
as="span"
className="--docs--interlinking-link-inline-content"
onClick={handleClick}
onAuxClick={handleAuxClick}
draggable="false"
$css={css`
display: inline;
Expand Down
Loading