From b25c3c54822af1fd6d0a72859b446606c08dcd31 Mon Sep 17 00:00:00 2001 From: Madhura68 Date: Tue, 5 May 2026 14:06:24 +0200 Subject: [PATCH] fix(m12): drop bogus /backlog#pbi-{code} route on PBI-link Three places linked to \`/products/[id]/backlog#pbi-{pbi_code}\` after materializing or in the planned-state link-card. That route doesn't exist (product backlog lives at \`/products/[id]\` directly), and the hash was double-prefixed (\`#pbi-PBI-32\`) since pbi_code already starts with PBI-. Result: 404 for the user. Fix: route to \`/products/[id]\` without anchor. The new PBI is the most recent so visible near the top. Per-PBI anchor scrolling is a follow-up once we add \`id="pbi-{id}"\` attributes to pbi-list rows. Co-Authored-By: Claude Opus 4.7 (1M context) --- components/ideas/idea-pbi-link-card.tsx | 2 +- components/ideas/idea-row-actions.tsx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/ideas/idea-pbi-link-card.tsx b/components/ideas/idea-pbi-link-card.tsx index fc7f7fe..1d47854 100644 --- a/components/ideas/idea-pbi-link-card.tsx +++ b/components/ideas/idea-pbi-link-card.tsx @@ -35,7 +35,7 @@ export function IdeaPbiLinkCard({ idea, isDemo }: Props) {

Gematerialiseerd als{' '} {idea.pbi.code} — {idea.pbi.title} diff --git a/components/ideas/idea-row-actions.tsx b/components/ideas/idea-row-actions.tsx index 916f480..3ac7cc1 100644 --- a/components/ideas/idea-row-actions.tsx +++ b/components/ideas/idea-row-actions.tsx @@ -114,9 +114,11 @@ export function IdeaRowActions({ idea, isDemo, onArchive }: IdeaRowActionsProps) return } toast.success(`Gematerialiseerd als ${r.data?.pbi_code}`) - // Navigeer naar de nieuwe PBI in de product-backlog - if (r.data?.pbi_id && idea.product_id) { - router.push(`/products/${idea.product_id}/backlog#pbi-${r.data.pbi_code}`) + // Navigeer naar de product-backlog. Anchor-scrolling per-PBI bestaat + // (nog) niet in pbi-list, dus gewoon naar de overview-pagina; de nieuwe + // PBI is de meest recente. + if (idea.product_id) { + router.push(`/products/${idea.product_id}`) } else { router.refresh() } @@ -131,7 +133,7 @@ export function IdeaRowActions({ idea, isDemo, onArchive }: IdeaRowActionsProps) size="sm" variant="outline" onClick={() => - router.push(`/products/${idea.product_id}/backlog#pbi-${idea.pbi!.code}`) + router.push(`/products/${idea.product_id}`) } > Bekijk {idea.pbi.code}