daily icon indicating copy to clipboard operation
daily copied to clipboard

🐛 BUG: Browser navigation not working properly on notification page

Open miroirstudiosrl opened this issue 1 year ago • 4 comments

What went wrong? 🤔

When you navigate to the notification page after opening at least one post going back in history (using the browser back arrow for example) doesn't work. The url changes but the pages remains the notifiication's one. I've noticed that this seems to be related with post's modals since if you don't open them before going on notification page this bug doesn't occurs.

Steps to Reproduce Issue

1. Open a post
2. Close the post's modal
3. Open notification page
4. Navigate back

Solution Proposed

I think the problem is that modals are put in navigation history (in order to close them navigating back), but they aren't properly removed from history when manually closed.

Environment

No response

Browsers

No response

OS

No response

Version of daily.dev

No response

Additional Context

No response

Code of Conduct

  • [X] I follow the conditions of this project.

miroirstudiosrl avatar Jun 12 '24 07:06 miroirstudiosrl

Hey @miroirstudiosrl I wanted to work on this issue, but I am not able to reproduce this issue on my end here. Can you provide screenshots of the issue, if possible?

ParthTyagi15 avatar Jun 12 '24 16:06 ParthTyagi15

Hi @miroirstudiosrl,

Thanks a lot for reporting it. We will look into that

idoshamun avatar Jun 13 '24 05:06 idoshamun

Hey @miroirstudiosrl I wanted to work on this issue, but I am not able to reproduce this issue on my end here. Can you provide screenshots of the issue, if possible?

@ParthTyagi15 was able to reproduce it. First go to any feed -> click any post -> modal will opened -> close the modal -> click the notifications page -> click browser back button. If you skip clicking any post, it should not reproduce. So the issue is definitely the way we handle the URL change on opening the modal. There should be a hook called usePostModalNavigation that facilitates the processing.

sshanzel avatar Jun 13 '24 23:06 sshanzel

@sshanzel Thank you for the reply. Yes, now I am able to see the issue. It only happens if I close the post modal by clicking somewhere outside the Modal. If I close the post using the back arrow in the browser and then go to the notifications page(or any other page for that matter) and then again go back, the issue is not there. So I also agree it's the way we handle the URL change.

ParthTyagi15 avatar Jun 14 '24 08:06 ParthTyagi15