Skip to content

ui: Extend useURLState and useQueryState hooks#6138

Merged
yomete merged 2 commits into
mainfrom
view-adjustments
Jan 13, 2026
Merged

ui: Extend useURLState and useQueryState hooks#6138
yomete merged 2 commits into
mainfrom
view-adjustments

Conversation

@yomete
Copy link
Copy Markdown
Contributor

@yomete yomete commented Jan 7, 2026

This PR refactors the URL state hooks to export raw setters that external wrapper hooks can use.

Changes:

  • useQueryState: Exports raw URL setters (setExpressionParam, setSumByParam, setGroupByParam) for external wrapper hooks
  • useProfileFilters: Exports setAppliedFilters, forceApplyFilters for wrapper hooks

@yomete yomete requested a review from a team as a code owner January 7, 2026 18:52
@alwaysmeticulous
Copy link
Copy Markdown

alwaysmeticulous Bot commented Jan 7, 2026

✅ Meticulous spotted 0 visual differences across 328 screens tested: view results.

Meticulous evaluated ~4 hours of user flows against your PR.

Expected differences? Click here. Last updated for commit ed555b9. This comment will update as new commits are pushed.

const result = encodeProfileFilters(value);
return result;
},
mergeStrategy: 'preserve-existing',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible to apply the mergeStrategy in this component and pass the final value into the URLState?

Adding that functionality into the URL State might complicate things a lot.

This PR refactors the URL state hooks to export raw setters that external wrapper hooks can use.

Changes:

- useQueryState: Exports raw URL setters (setExpressionParam, setSumByParam, setGroupByParam) for external wrapper hooks
- useProfileFilters: Exports setAppliedFilters for wrapper hooks
dispatch(setAutoQuery('true'));
let profileType = profileTypesData.types.find(
type => type.name === 'parca_agent' && type.delta
type => type.name === 'parca_agent' && type.sampleType === 'samples' && type.delta
Copy link
Copy Markdown
Contributor Author

@yomete yomete Jan 13, 2026

Choose a reason for hiding this comment

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

Try to pick On-CPU when auto querying. Noticed this upstream where it inconsistently chooses Off-CPU before On-CPU even though the logic defined here says we prioritize On-CPU

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added tests for the useProfileFiltersUrlState.ts hook

Copy link
Copy Markdown
Contributor

@manojVivek manojVivek left a comment

Choose a reason for hiding this comment

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

Lgtm!

@yomete yomete merged commit f1ac6e1 into main Jan 13, 2026
38 checks passed
@yomete yomete deleted the view-adjustments branch January 13, 2026 12:18
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.

2 participants