Thanks for the suggestions. As I mentioned above, I'm trying to persist the same detail view when navigating, and not replace it. The only way I found to do this was to use NavigationLink with .isDetailLink(false).
But when using a NavigationPath approach, NavigationLinks push the view onto the stack but the view doesn't appear. If I then push another view using the router(which does appear) and navigate back, then the view I pushed with the NavigationLink is revealed.
// Destination view does not appear but is pushed to stack
NavigationLink(
destination: {
BasicDataView(citizen: "johndoe")
.navigationBarBackButtonHidden(true)
},
label: {
Text("Character Generation")
}
)
.isDetailLink(false) // Keep in sidebar
// Works correctly but replaces entire content, or if pushed view uses NavigationSplitView then replaces the detail view which is not desirable
Button(action: {
router.push(route: .basicdata(citizen: "johndoe"))
}) {
Text("Character Generation")
}