Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to keep the browsing stack when changing players in media panel #11681

Merged
merged 2 commits into from Feb 14, 2022

Conversation

balloob
Copy link
Member

@balloob balloob commented Feb 14, 2022

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

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@balloob
Copy link
Member Author

balloob commented Feb 14, 2022

I think that the alternative offered by Zack has a few edge cases that need more thought. So for now let's go with the approach that pressing the back arrow will open the parent item.

@balloob balloob marked this pull request as ready for review February 14, 2022 21:43
@balloob balloob merged commit 520896a into dev Feb 14, 2022
@balloob balloob deleted the persist-media-browser-route-changing-device branch February 14, 2022 23:21
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants