Skip to content

feat(build-comparison): Synchronizes the hide small changes switch with a url query param to ensure state is preserved in browser history#105234

Merged
cameroncooke merged 1 commit intomasterfrom
cameroncooke/eme-437-add-hide-small-changes-to-url-state
Dec 19, 2025
Merged

feat(build-comparison): Synchronizes the hide small changes switch with a url query param to ensure state is preserved in browser history#105234
cameroncooke merged 1 commit intomasterfrom
cameroncooke/eme-437-add-hide-small-changes-to-url-state

Conversation

@cameroncooke
Copy link
Copy Markdown
Contributor

@cameroncooke cameroncooke commented Dec 18, 2025

This pull request updates the SizeCompareMainContent component to improve how the "hide small changes" state is managed and synchronized with the URL. The changes ensure that the state persists in the URL, allowing for better navigation and sharing of filtered views.

State management and URL synchronization improvements:

  • Replaced the local useState for hideSmallChanges with useQueryState from nuqs, synchronizing the state with the URL query parameter and providing a default value of true. [1] [2]
  • Updated the disableHideSmallChanges handler to explicitly set hideSmallChanges to false, ensuring consistent behavior with the new state management approach.

@linear
Copy link
Copy Markdown

linear bot commented Dec 18, 2025

Copy link
Copy Markdown
Contributor Author

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 18, 2025
@cameroncooke cameroncooke requested a review from chromy December 18, 2025 15:57
@cameroncooke cameroncooke marked this pull request as ready for review December 18, 2025 15:58
@cameroncooke cameroncooke requested a review from a team as a code owner December 18, 2025 15:58
@cameroncooke cameroncooke force-pushed the cameroncooke/eme-437-add-hide-small-changes-to-url-state branch from 0c86997 to 36ef0ad Compare December 18, 2025 17:15
…ameter management (EME-437)

Added the UrlParamBatchProvider to the BuildComparison component to manage URL query parameters effectively. Updated SizeCompareMainContent to utilize useQueryParamState for handling the 'hideSmallChanges' parameter, improving state management and user experience when toggling visibility of small changes in the comparison view.
@cameroncooke cameroncooke force-pushed the cameroncooke/eme-437-add-hide-small-changes-to-url-state branch from 36ef0ad to 3dc0f70 Compare December 19, 2025 10:52
Copy link
Copy Markdown
Contributor

@chromy chromy left a comment

Choose a reason for hiding this comment

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

lgtm, Thanks!

Commit title might need adjusting when you land this, the PR title still references UrlParamBatchProvider

@cameroncooke cameroncooke changed the title feat(build-comparison): Integrate UrlParamBatchProvider for query parameter management (EME-437) feat(build-comparison): Synchronizes the hide small changes switch with a url query param to ensure state is preserved in browser history Dec 19, 2025
@cameroncooke cameroncooke merged commit 763edbf into master Dec 19, 2025
51 checks passed
@cameroncooke cameroncooke deleted the cameroncooke/eme-437-add-hide-small-changes-to-url-state branch December 19, 2025 11:21
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants