mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 00:09:23 +02:00
[PR #781] [MERGED] fix: populate parallel route segments in LayoutSegmentProvider #843
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#843
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/781
Author: @NathanDrake2406
Created: 4/4/2026
Status: ✅ Merged
Merged: 4/4/2026
Merged by: @james-elicx
Base:
main← Head:fix/parallel-route-segment-map📝 Commits (1)
499b4a6fix: populate parallel route segments in LayoutSegmentProvider📊 Changes
4 files changed (+93 additions, -28 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+1 -0)📝
packages/vinext/src/routing/app-router.ts(+31 -10)📝
packages/vinext/src/server/app-page-route-wiring.tsx(+35 -13)📝
tests/app-router.test.ts(+26 -5)📄 Description
Summary
useSelectedLayoutSegment(key)always returnednullfor named parallel route keys (e.g.,@modal,@sidebar) because theLayoutSegmentProvider'ssegmentMaponly ever contained the"children"keyrouteSegmentsfield toParallelSlot— populated at scan time with the filesystem segments from the slot root to its active page ([]for root page,["members"]for sub-pages,nullfor default fallback)useSelectedLayoutSegment("team")correctly returns the active segment when@team/members/page.tsxis matchedTest plan
useSelectedLayoutSegments()(children key) tests still passuseSelectedLayoutSegments("team")returns["members"]on/dashboard/membersuseSelectedLayoutSegments("analytics")returns[]when slot showsdefault.tsxpnpm run checkpasses (no new type errors or lint issues)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.