Fix QuickGridNoInteractivityTest#66977
Merged
dariatiurina merged 7 commits intoJun 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes process-wide (order-dependent) QuickGrid feature-flag mutation from the Components test server by introducing a per-component-tree opt-in/opt-out for URL-based navigation/sorting via a named cascading parameter. This should eliminate the global-state interaction that made QuickGridNoInteractivityTest flaky and allows URL-driven and legacy button-driven scenarios to run in the same server process.
Changes:
- Added an internal, named cascading override (
EnableUrlBasedQuickGridNavigationAndSorting) toQuickGrid<TGridItem>andPaginator, with fallback to the existingAppContextswitch. - Updated QuickGrid UI rendering (column headers + paginator UI) to respect the per-tree override via
UseUrlBasedNavigationAndSorting. - Removed
AppContext.SetSwitch(...)+ reflection cache-busting from test server startup, updated test pages to provide the cascading override locally, and un-quarantinedQuickGridNoInteractivityTest.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/QuickGrid/QuickGridInteractive.razor | Drives URL-based vs legacy UI via config-backed cascading override for interactive E2E scenarios. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/QuickGrid/QuickGridComponent.razor | Forces URL-based behavior for the no-interactivity QuickGrid page via cascading override. |
| src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs | Removes global AppContext switch mutation and reflection-based cache override. |
| src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsNoInteractivityStartup.cs | Removes global AppContext switch mutation for the no-interactivity startup. |
| src/Components/test/testassets/BasicTestApp/QuickGridTest/SampleQuickGridComponent.razor | Forces legacy/button-based UI locally via cascading override to keep compat behavior stable. |
| src/Components/test/E2ETest/Tests/QuickGridNoInteractivityTest.cs | Un-quarantines the test now that global state coupling is removed. |
| src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGridFeatureFlags.cs | Promotes the switch-name constant to internal for reuse in named cascading parameters. |
| src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor.cs | Adds named cascading override + UseUrlBasedNavigationAndSorting helper for descendant rendering decisions. |
| src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/Pagination/Paginator.razor.cs | Adds named cascading override + UseUrlBasedNavigationAndSorting helper for paginator rendering. |
| src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/Pagination/Paginator.razor | Switches between anchor vs button paginator UI based on the new per-tree override. |
| src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/Columns/ColumnBase.razor | Switches sortable column header rendering (anchor vs button) to respect Grid.UseUrlBasedNavigationAndSorting. |
oroztocil
requested changes
Jun 4, 2026
maraf
approved these changes
Jun 24, 2026
oroztocil
approved these changes
Jun 30, 2026
oroztocil
approved these changes
Jun 30, 2026
javiercn
pushed a commit
that referenced
this pull request
Jun 30, 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 QuickGridNoInteractivityTest
Summary
Un-quarantines
QuickGridNoInteractivityTestby forcing the QuickGrid URL-based navigation feature switch to be observed in the test server, even whenQuickGridFeatureFlags's static cache was already initialized by an earlier test scenario.Changes
RazorComponentEndpointsNoInteractivityStartup.ConfigureServices: after callingAppContext.SetSwitch("Microsoft.AspNetCore.Components.QuickGrid.EnableUrlBasedQuickGridNavigationAndSorting", true), additionally uses reflection to set the private static fieldQuickGridFeatureFlags.s_enableUrlBasedQuickGridNavigationAndSortingtotrue. This guarantees the flag is on regardless of whether the type was already initialized in the test host process.QuickGridNoInteractivityTest: removes the[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/66883")]attribute now that the test can reliably observe the enabled feature switch.Details
QuickGridFeatureFlags.EnableUrlBasedQuickGridNavigationAndSortingreads theAppContextswitch into astaticfield on first access. When another test scenario in the same process touches the type beforeAppContext.SetSwitchruns (or before this startup runs), the cached value sticks andSetSwitchhas no effect. The reflection-based write tos_enableUrlBasedQuickGridNavigationAndSortingoverrides that cached value so this startup's intent is honored.Testing
QuickGridNoInteractivityTestis un-quarantined; it should now pass reliably in CI runs that share the test host with other QuickGrid scenarios.Fixes #66883