diff --git a/apps/client/src/features/acadenice/backlinks/components/linked-references-panel.tsx b/apps/client/src/features/acadenice/backlinks/components/linked-references-panel.tsx index 916762ec..7548f38e 100644 --- a/apps/client/src/features/acadenice/backlinks/components/linked-references-panel.tsx +++ b/apps/client/src/features/acadenice/backlinks/components/linked-references-panel.tsx @@ -20,6 +20,7 @@ import { } from '@tabler/icons-react'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; +import { buildPageUrl } from '@/features/page/page.utils.ts'; import { useBacklinks } from '../queries/backlinks-query'; import type { BacklinkEntry } from '../queries/backlinks-query'; import classes from './linked-references-panel.module.css'; @@ -84,10 +85,17 @@ export function LinkedReferencesPanel({ pageId }: LinkedReferencesPanelProps) { const handleNavigate = (entry: BacklinkEntry) => { if (entry.source.slugId) { - // Navigate to the source page that links here. - // The full path includes the space slug — fall back to page UUID if slugId only. - const spacePart = entry.source.spaceSlug ? `/${entry.source.spaceSlug}` : ''; - navigate(`${spacePart}/page/${entry.source.slugId}`); + // Use the canonical builder so links land on the real + // /s//p/ route (same helper the wikilink node uses). + // The previous hand-built `//page/` path matched no + // route, so clicking a reference did nothing. + navigate( + buildPageUrl( + entry.source.spaceSlug ?? undefined, + entry.source.slugId, + entry.source.title ?? undefined, + ), + ); } };