Hello! What would the strategy be to attach neste...
# decompose
n
Hello! What would the strategy be to attach nested navigation to the web history controller?
And, also, is there any reason not to be able to use it with slot navigation? Maybe I’m using slot wrongly but I have the following: Root (slot) - URL • Login - URL www.test.com/login • Main (stack) ◦ Home (slot) - URL www.test.com ▪︎ Bottom sheet - URL www.test.com/details ◦ Other… ◦ Other…
a
Unfortunately, there is no out-of-the-box solution. Maybe something custom would work.
n
That’s what I guessed 🙂. I’ll come back to you because maybe it makes sense to contribute something to the library!
a
Thanks! That would be awesome.
decompose intensifies 1
n
Hey Arkadii, I’ve been thinking about this lately and can’t find a satisfactory way of expressing complex patterns. Imagine the following url:
Copy code
//It's a fake Firebase URL but it's close to reality
<https://console.firebase.google.com/project/uludi-81bcf/users/create>
Leaving aside the host name, this URL has two parts: 1.
/project/uludi-***
-> This one isn’t really expressing navigation, but more like parameters 2.
/users/create
-> This one is really navigation Now imagine that from the navigation part: 1.
/users
express a destination on the main “graph” 2. But
/create
is actually a dialog destination I’m really struggling to model this in the Decompose way. Web routing frameworks usually work with routing patterns like:
Copy code
//main.kt
Routes {
    route("/project/%id") { id ->
        RootLayout {
            route("authentication") {
                AuthenticationScreen()
            }
        }
    }
    else {
       ProjectSelectionScreen()
    }
}

@Composable
fun AuthenticationScreen() {
   ...
   route("create") {
        UserCreationDialog()
   }
}
Syntax and API are absolutely made up. Do you think that sharing a single WebHistoryController in all nested navigations would be a way to go?
a
Yep, this is not going to be easy! I don't have any good ideas off the top of my head. But I do have plans to think about nested navigation on Web soon-ish. This task is prioritized somewhere after migration to AndroidX Lifecycle and shared transitions support for Compose. I'm open for discussion though. I will drop any ideas if I have something.
This requires quite a deep dive into the problem, and I don't have much time currently because of those other tasks. And I'm also still on vacation this week. 🙂
n
Enjoy your vacation! 🌴 I will try to draft something around the idea of sharing the Controller and come back to you next week 🙂.
🙏 1
Thanks!