Is it possible to pop back multiple views in tree-based navigation?

I'm working on a note-taking app that is essentially a trie of text. For example if a user is on a note "Potatoes" inside the path "Home/Hobbies/Cooking/Recipes/Mashed_Potatoes/Ingredients/Potatoes" and wants to return to "Recipes" how might it that pop back be achieved using the navigation library + TCA?

Edit: I tried having a check upon .onAppear for if the currentNote == focusedNote and if not
return .run { _ in await self.dismiss() } in the reducer but it won't work more than once in a row (compiler says that the destination state is absent, but there is no second pop or subsequent pop)

Also I tried accessing the child view from the parent to listen for when to dismiss it, but that only works from one parent to one child