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

Use browser's history when displaying/hiding the infobox on mobile view. #7446

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

isoos
Copy link
Collaborator

@isoos isoos commented Jan 31, 2024

@isoos isoos requested review from szakarias and sigurdm January 31, 2024 16:42
@isoos isoos force-pushed the detail-history branch 2 times, most recently from e89a134 to e6cb953 Compare February 6, 2024 16:26
Comment on lines +80 to +81
// only listen to state events after the first initialization
stateSubscription ??= window.onPopState.listen((event) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work well, if you:

  1. Navigate to pub.dev/packages/retry
  2. Toggle the "details / meta-data" view
  3. Click the repository link (navigating to github.com/...)
  4. Click the back button.
  5. The "details / meta-data" view will not be active, leaving users disappointed.

Am I wrong? (I haven't tested the theory)

We could say that (5) is an acceptable downside.


We could also use pub.dev/packages/retry#details to toggle the "details / meta-data" view. Storing the state in document.location.hash.

We might be able to use the hashchange event then. Though it might be just as complicated.


An alternative is to create a separate page: pub.dev/packages/<package>/details that contains the sidebar. It'll be a bit sad, because it won't work when you resize the window.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've deployed the PR to staging, and it seems to me that clicking through 1-5 is working as expected, at least on Chrome.

@isoos isoos merged commit 2264db2 into dart-lang:master Apr 16, 2024
31 checks passed
@isoos isoos deleted the detail-history branch April 16, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigating back from metadata popup should go back to package-page
2 participants