Fix API for QuickGrid#67733
Open
dariatiurina wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the unshipped QuickGrid URL-state API to match the approved design by replacing the single prefix-based parameter with a new options object that allows callers to control each query parameter name, and by renaming the default sort-direction query key from order to direction.
Changes:
- Introduces
QueryParameterNameOptions(prefix-based defaults + per-parameter overrides for sort/direction/page). - Replaces
QuickGrid<TGridItem>.QueryParameterNamePrefixwithQuickGrid<TGridItem>.QueryParameterNameOptions. - Updates test assets and E2E assertions to use the new API and
direction=query parameter.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QueryParameterNameOptions.cs | Adds the new options type for independently controlling query parameter names. |
| src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor.cs | Switches QuickGrid’s query parameter naming to use QueryParameterNameOptions and defaults to direction. |
| src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/PublicAPI.Unshipped.txt | Updates the unshipped API surface to remove the old parameter and add the new type/parameter. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/QuickGrid/QuickGridComponent.razor | Updates sample usage to pass QueryParameterNameOptions with explicit prefixes. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/QuickGrid/QuickGridInteractive.razor | Updates interactive sample usage to pass QueryParameterNameOptions. |
| src/Components/test/E2ETest/Tests/QuickGridNoInteractivityTest.cs | Updates URL assertions and navigation to use direction=. |
| src/Components/test/E2ETest/Tests/QuickGridInteractiveTest.cs | Updates URL assertions and comments to use direction= and the new parameter name. |
| src/Components/test/E2ETest/Tests/QuickGridInteractiveCompatTest.cs | Updates URL assertions to use direction= while preserving compat-mode intent. |
ilonatommy
approved these changes
Jul 14, 2026
ilonatommy
left a comment
Member
There was a problem hiding this comment.
Looks good, 2 small ideas to consider.
ilonatommy
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix API for QuickGrid
Summary
Adjusts the unshipped QuickGrid URL-state API to match what was approved in API review for #66830: the
QueryParameterNamePrefixstring parameter is replaced with a new sealedQueryParameterNameOptionsclass that lets callers control each query parameter name independently.Changes
QueryParameterNameOptionstype — a sealed class with a primary constructorQueryParameterNameOptions(string prefix = "")and three settable properties:Sort,Direction, andPage, defaulting to"{prefix}sort","{prefix}direction", and"{prefix}page".QuickGrid<TGridItem>parameter changed —[Parameter] public string QueryParameterNamePrefixis replaced by[Parameter] public QueryParameterNameOptions? QueryParameterNameOptions. Whennull, the query parameters default tosort,direction, andpage.ordertodirection(the default forQueryParameterNameOptions.Direction).PublicAPI.Unshipped.txtupdated to remove theQueryParameterNamePrefixentries and add the new type and parameter.Details
Previously the component owned the naming scheme: an empty prefix produced
sort/order/page, and a non-empty prefix such as"products"producedproducts_sort/products_order/products_page(the component inserted the_separator). The approved design moves that control to the caller — the prefix now includes its own separator (e.g.new("products_")producesproducts_sort,products_direction,products_page), and each name can also be set individually via theSort/Direction/Pageproperties. This keeps the multi-grid scenario working (unique names per grid to avoid URL conflicts) while giving callers full control over each parameter name.Testing
Existing QuickGrid E2E suites were updated to the new API:
QuickGridNoInteractivityTest,QuickGridInteractiveTest, andQuickGridInteractiveCompatTest— updated sort-direction URL assertions fromorder=todirection=.QuickGridComponent.razor,QuickGridInteractive.razor) — updated to passQueryParameterNameOptionswith an explicit prefix (e.g.new("QuickGrid2_"),new("people_")) in place ofQueryParameterNamePrefix.Breaking Changes
These affect the unshipped (preview) API introduced in #65451, not a released API:
QuickGrid<TGridItem>.QueryParameterNamePrefixis removed; useQueryParameterNameOptionsinstead.ordertodirection.Fixes #66830