Post

I've converted my side project to Navigation 3 (or at least, a similar close fork of Navigation 3), which you can try out on the web here! alex.vanyo.dev/composelife Two more complex scene ideas I've been playing around with: A SceneStrategy wrapping another SceneStrategy, and derived entry lists.

Idea 1: I have a list-detail setup for my settings, but if there's even more space available, I want the entire list-detail setup to be in a dialog. I can do that by creating a custom DialogSceneStrategy that wraps my other scene strategies, and having the DialogScene wrap an arbitrary Scene:

Idea 2: Because Navigation 3 allows hoisting the backstack state arbitrarily, you can give a backstack to the NavDisplay that is derived from some other state. Another tricky list-detail case is when you want the first detail visible initially, but only if there's enough space for it.

One technique to solve this is to not have the detail in the underlying backstack state at first, and derive an entry list with a "transient" detail entry at larger window sizes. Only when you actually navigate to that entry does the entry get "realized" and get added to the underlying backstack.

0 reposts0 likes

That way, resizing the window smaller will remain on the list until you've directly navigated to the detail, and then resizing smaller will remain on the detail. No need for an empty detail placeholder: