How to get current URL in app.html.heex

To add some context, the reason the current URL isn’t just available to views is that it needs to be stored on the socket (as mentioned above) which isn’t free. Not every application needs it and many applications only need pieces of it (for example perhaps they don’t care about query params or perhaps just the first slash segment) so it’s left up to the developer to decide what to store.