Sprint: ll (#207)
* feat(PBI-ll): voeg lib/product-switch-path.ts toe met resolveProductSwitchTarget Pure helper die doel-URL bij product-wissel bepaalt; unit-tests dekken alle pad-gevallen. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(product-switch-path): dek alle pad-categorieën en null-terugval af * feat(nav-bar): gebruik resolveProductSwitchTarget bij product-wissel Vervang router.refresh() door gerichte navigatie via resolveProductSwitchTarget, zodat product/sprint/solo-pagina's direct naar het nieuwe product navigeren. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(nav-bar): voeg navigatie-assertions toe voor product-wissel Voeg 4 tests toe die verifiëren dat NavBar na product-wissel naar de juiste URL navigeert: /products/B, /products/B/sprint, /products/B/solo, en router.refresh() op niet-product-pagina's. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3ad352c10f
commit
8287509c7c
4 changed files with 114 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ import { NotificationsBell } from '@/components/shared/notifications-bell'
|
|||
import { SoloNavStatusIndicators } from '@/components/solo/nav-status-indicators'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { setActiveProductAction } from '@/actions/active-product'
|
||||
import { resolveProductSwitchTarget } from '@/lib/product-switch-path'
|
||||
import { debugProps } from '@/lib/debug'
|
||||
|
||||
interface NavBarProps {
|
||||
|
|
@ -70,7 +71,8 @@ export function NavBar({
|
|||
}
|
||||
const next = products.find(p => p.id === productId)
|
||||
toast.success(`Actief product: ${next?.name ?? 'gewijzigd'}`)
|
||||
router.refresh()
|
||||
const target = resolveProductSwitchTarget(pathname, productId)
|
||||
if (target) router.push(target); else router.refresh()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue