back button doesn't close certain views
Describe the bug Most of the app has consistent behavior with the back button: close the current view and return to the previous view where you had left off. There are a few places in the app that I've noticed it does not behave the same: compose new post, compose reply post, and account "preview".
- Which site: dev.phanpy.social
- Which instance: infosec.exchange
To Reproduce Steps to reproduce the behavior:
- On your home feed, click on a post.
- Click on "reply to post".
- Click the browser back button.
- Notice the reply to post screen is still active, and the background is now on your home feed instead of viewing the post being replied to.
- This also happens when composing a new post, and also when you view someone's account details by clicking on their avatar.
Expected behavior The "reply to post" view will close and return to the post being replied to.
Desktop (please complete the following information):
- OS: Windows
- Browser: Firefox
- Version: 115
Smartphone (please complete the following information):
- Device: Samsung S23
- OS: Android
- Browser: Chrome PWA
- Version: 115
Additional context This behavior is present in mobile chrome PWA and also Firefox on my windows desktop.
Disclaimer: I've only ever used Phanpy on mobile, so can't really comment about the UX on desktop.
On Android, it will soon be possible to use CloseWatcher to have elements (such as the account sheet) dismissed with the back button (iiuc, should work for the esc key on desktop too): https://groups.google.com/a/chromium.org/g/blink-dev/c/jM5au7yYzHM/m/L8r7x5CmAAAJ
On mobile, the compose and compose-reply dialog however look like entirely separate pages to me, so could be handled via routes.
@tbroyer thanks! This is very useful, hopefully it gets supported in more browsers/devices soon 🤞
Handling by routes is kinda like the only way (no other choice though) to handle Back actions in browsers. It's doable but adds more overhead and will get more complicated if there are nested multiple modals/sheets/popovers 🫣
I'm getting this situation a lot too.
I'm mainly using Phanpy on mobile in dark mode, and most of these overlays (compose, reply, account preview etc) look almost full screen when opened.
It's confusing that going 'back' doesn't get me out of them, but changes what's underneath them - and I don't seem to be able to train my muscle memory out of trying to back out of them every time!
This is actually my biggest bugbear about the whole thing - any other niggles have been minor, for me.
Thank you for all your work!
Hi! Loving phanpy very much. Using it mostly on mobile via a homescreen shortcut. When previewing an account, back button closes the application, and when reopened, it goes to the most recent toots. Thus forgetting the timeline scroll position of the moment when I opened the account preview. This is quite annoying. I have almost trained myself not to use back button when previewing an account, but sometimes muscle memory still kicks in. :) Would be great if this behaviour could be adjusted to close the account preview instead.
@2m what's the browser that you're using?
Firefox.
@2m noted.
As of now, Phanpy implements CloseWatcher which only works on latest Chrome-based browsers unfortunately.
Understood. I tried with Chrome, and it surely works! I will use it as Chrome-based app for now then. It doesn't matter so much which browser is used when in app-mode, as no browser UI is visible then.