fragment
The half-frame that became PersistentBackgroundNavigation
There was a flicker in Tesserae I couldn't stop seeing. The root view had a color gradient with animated nodes drifting across the screen, slow and atmospheric. Every time I pushed a new view onto the NavigationStack, the gradient pulsed. Not for long. A single wrong-color half-frame as the transition logic recomputed the destination's chrome.
The user doesn't have words for it. They feel it.
I spent weeks chasing it. Every forum thread I found assumed the background was a property of the view, something you set with .background(...) and then chase around with modifiers when it misbehaves. I tried the modifier stack. I tried setting the background on the NavigationStack itself. I tried .toolbarBackground(.hidden). I tried Color.clear on every layer I could find. Each attempt moved the artifact somewhere else without removing it.
The breakthrough was changing the question. The background wasn't supposed to be inside the thing that's transitioning. The background is the room. The views are the furniture being rearranged. You don't repaint the walls when you move a chair.
Structurally, that meant pulling the background out of the navigation hierarchy entirely. The app gets a ZStack at the root, the background sits as one sibling, the NavigationStack sits as the other. Then .containerBackground(for: .navigation) { Color.clear } tells the navigation chrome to stop drawing its own surface on top. The background never participates in a transition because it never tears down. Push, pop, present, dismiss; the nodes keep drifting.
I called it PersistentBackgroundNavigation. It worked the moment I wired it into Tesserae.
Two things from this are worth recording.
The first is that Apple's SwiftUI conventions encode an assumption that views own their visual surface. That assumption is right most of the time, and it's why nobody writes a tutorial on hoisting the background out of the hierarchy. It's also why the workaround took weeks to find: the convention is loud and the structural alternative is quiet.
The second is that the fix didn't feel like mine. It felt like something other people would also want. I had reached for it because Tesserae has a particular contemplative mood that breaks if anything chrome-related flinches between screens. But a quiet animated background under a navigation stack is a recurring idea, not a personal one. So I lifted the relevant files into a SwiftUI package, wrote a one-liner API for it, and shipped it. That package is SeaBearKit, and PersistentBackgroundNavigation is still the first utility in the README.
Some of the best small libraries come out of refusing to live with an artifact nobody else is bothered by.