From 5e0f5cf49edf4762c7595d1052b164db9bb82273 Mon Sep 17 00:00:00 2001 From: Corentin Date: Mon, 18 May 2026 11:42:00 +0000 Subject: [PATCH] fix(backlinks): navigate via buildPageUrl so reference clicks work handleNavigate hand-built //page/, a route that does not exist (real route is /s//p/), so clicking any linked reference did nothing. Use the canonical buildPageUrl helper, same as the wikilink node. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../components/linked-references-panel.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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, + ), + ); } };