fix(viewerAction): replace the history entry when closing the viewer - #3331
fix(viewerAction): replace the history entry when closing the viewer#3331ELHart05 wants to merge 2 commits into
Conversation
Opening a file replaces the folder's history entry with one that carries `openfile`. Closing pushed a new entry on top of it instead of replacing it, so the entry carrying `openfile` was left behind: going back after closing reopened the file that had just been closed instead of leaving the folder, and further back navigation bounced between the leftover entries. Closing now replaces the current entry, mirroring what opening does. Signed-off-by: ELHart05 <o.allaoua@esi-sba.dz>
bf0051a to
3cc0d2e
Compare
Signed-off-by: ELHart05 <o.allaoua@esi-sba.dz>
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Summary
pushToHistoryopens a file by replacing the folder's history entry with one that carriesopenfile, butonClosepushes a new entry instead of replacing it. The entry carryingopenfileis left behind, so after closing a file, going back reopens the file you just closed rather than leaving the folder. Pressing back again bounces between the leftoverediting=falseentries, because the viewer keeps pushing while you are navigating backwards.Steps, on 34.0.2:
Expected: you leave the folder. Actual: the viewer reopens.
Closing now replaces the current entry, which mirrors what opening does and leaves the history exactly as it was before the file was opened.
Added a case to
playwright/e2e/navigation.spec.tsnext to the existing back-button test. It fails without the change.Needs
/compilebefore merging.