webxdc / timetracking-webxdc

WIP xdc app for time tracking
GNU General Public License v3.0
5 stars 0 forks source link

Android back button support [migrate router] #32

Closed Simon-Laux closed 8 months ago

Simon-Laux commented 8 months ago

I recently introduced sub pages, but my crude navigation router implementation has no support for the back button that android devices have.

I have not found a way to listen for the back button event so I think we need to migrate to a routing solution that actually uses the browser history, like one that changes the anchor (like having a virtual path in the anchor #/more/about).

I think migrating to use an existing router might make most sense here, I'm thinking about trying https://reactrouter.com, it has many features we won't need, so I hope that it has proper tree shaking support, so our bundle size is not inflated too much.

Alternatively we could try https://github.com/preactjs/preact-router, but I don't know if it is compatible with react.