Try to keep the browsing stack when changing players in media panel #11681
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Breaking change
Proposed change
Persist the current browsing page when changing devices.
CleanShot.2022-02-13.at.20.26.27.mp4
This works, but it has an issue: the back button will now change the device instead of going up a folder because it does a
history.back()
and that is now a different device.This is very confusing as you might not notice that the device is changing.
The only solution that I can think of is that the back button adds new items to the history stack. History.back() means then that you go "back" to the child folder if you previously navigated up.
Marking it as draft as I am not convinced it's good solution yet. Hoping some people have alternative ideas. I thought about changing how the back button behaves only if you have changed a device, but that would result in a non-consistent experience.
Alternative idea from @zsarnett:
We remove the current target from the URL. It's already stored in the local storage so refresh works. We can add support for setting the target via a query param if we want to link to a specific device from somewhere else in the UI (which we don't do yet).
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: