-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[SLO] Fix back button when clicking on overview stats #245092
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
base: main
Are you sure you want to change the base?
Conversation
480de5b to
f283aa7
Compare
f283aa7 to
4e7bff5
Compare
3fa6db6 to
6ebe95b
Compare
6ebe95b to
7f07675
Compare
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
|
|
||
| urlStateStorage.current?.set(SLO_LIST_SEARCH_URL_STORAGE_KEY, updatedState, { | ||
| replace: true, | ||
| replace: false, |
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.
replace: false creates a new browser history entry. Previously changes used replace, which blocked back/forward navigation
TODO: completely remove, since replace:false is the default value
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.
Removed in this commit
| useEffect(() => { | ||
| const sub = urlStateStorage.current | ||
| ?.change$<SearchState>(SLO_LIST_SEARCH_URL_STORAGE_KEY) | ||
| .subscribe((newSearchState) => { |
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.
An empty/cleared search state resets to DEFAULT_STATE.
|
Pinging @elastic/actionable-obs-team (Team:actionable-obs) |
|
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
baileycash-elastic
left a comment
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.
Looks good, maybe re-run FTRs for good measure?
💔 Build Failed
Failed CI StepsTest Failures
Metrics [docs]Page load bundle
History
cc @mgiota |
Fixes #245069
Before
Screen.Recording.2025-12-03.at.14.17.40.mov
Before the fix, when clicking on the stats count and then navigating back to
/app/slos (no search params in the URL)the urlStateStorage returned null or undefined, but the subscription had a checkif newSearchStatethat prevented updating the state.After
Now when the URL changes to have no search params (when we click back), the subscription receives null/undefined for newSearchState, it sets the state to DEFAULT_STATE, Searchbar receives the empty state and remounts with cleared values
Screen.Recording.2025-12-03.at.16.08.20.mov