Skip to content

Conversation

@mgiota
Copy link
Contributor

@mgiota mgiota commented Dec 3, 2025

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 check if newSearchState that 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

@github-actions github-actions bot added the author:actionable-obs PRs authored by the actionable obs team label Dec 3, 2025
@mgiota mgiota force-pushed the slo-fix-back-button-overview-stats branch from 480de5b to f283aa7 Compare December 3, 2025 14:28
@mgiota mgiota requested a review from Copilot December 3, 2025 14:29
@mgiota mgiota self-assigned this Dec 3, 2025
@mgiota mgiota added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Dec 3, 2025
Copilot finished reviewing on behalf of mgiota December 3, 2025 14:33

This comment was marked as outdated.

@mgiota mgiota force-pushed the slo-fix-back-button-overview-stats branch from f283aa7 to 4e7bff5 Compare December 3, 2025 14:52
@elastic elastic deleted a comment from Copilot AI Dec 3, 2025
@mgiota mgiota force-pushed the slo-fix-back-button-overview-stats branch 4 times, most recently from 3fa6db6 to 6ebe95b Compare December 3, 2025 15:25
@mgiota mgiota force-pushed the slo-fix-back-button-overview-stats branch from 6ebe95b to 7f07675 Compare December 3, 2025 15:28
@elastic elastic deleted a comment from Copilot AI Dec 3, 2025
@mgiota mgiota requested a review from Copilot December 3, 2025 15:28
Copilot finished reviewing on behalf of mgiota December 3, 2025 15:32
Copy link
Contributor

Copilot AI left a 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,
Copy link
Contributor Author

@mgiota mgiota Dec 3, 2025

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

Copy link
Contributor Author

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) => {
Copy link
Contributor Author

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.

@mgiota mgiota marked this pull request as ready for review December 3, 2025 16:27
@mgiota mgiota requested a review from a team as a code owner December 3, 2025 16:27
@elasticmachine
Copy link
Contributor

Pinging @elastic/actionable-obs-team (Team:actionable-obs)

@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@mgiota mgiota added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Dec 3, 2025
Copy link
Contributor

@baileycash-elastic baileycash-elastic left a 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?

@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 4, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #14 / ruleActionsConnectorsModal should allow for searching of connectors
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results allows cloning an SLO
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results allows cloning an SLO
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results allows creating a new rule for an SLO
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results allows creating a new rule for an SLO
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results allows deleting an SLO
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results allows deleting an SLO
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results allows editing an SLO
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results allows editing an SLO
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results allows managing rules for an SLO
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results allows managing rules for an SLO
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results renders the SLO list with SLO items
  • [job] [logs] Jest Tests #14 / SLOs Page when the correct license is found when API has returned results renders the SLO list with SLO items

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
slo 33.5KB 33.5KB -6.0B

History

cc @mgiota

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:actionable-obs PRs authored by the actionable obs team backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. Team:obs-ux-management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SLO] Fix back button functionality when a user clicks on a state count

3 participants