-
Notifications
You must be signed in to change notification settings - Fork 27
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
UrlSync: Variable changes adds browser history steps #882
base: main
Are you sure you want to change the base?
Conversation
@@ -428,6 +446,16 @@ export class MultiValueUrlSyncHandler<TState extends MultiValueVariableState = M | |||
this._sceneObject.changeValueTo(urlValue); | |||
} | |||
} | |||
|
|||
public performBrowserHistoryAction(callback: () => void) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 🎉 Do you think it could be the default behavior of SceneObjectUrlSyncConfig
and AdHocFiltersVariableUrlSyncHandler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, probably. pushed an update to #878 that adds it to SceneObjectUrlSyncConfig
This works on top of #878
and explores adding browser history steps for variables.
Works surprisingly well. The challenge here is that not all variable value changes should create URL history steps.
Given a valid state of datacenter=US , cluster=US-1
To solve this we need to differentiate between variable changes that are due to user actions and those that come due to parent variable change. which is why I am adding isUserAction bool to changeValueTo
works surprisingly well