docs(demo): keep the selected adapter in the URL so links can be shared - #492
Merged
Merged
Conversation
A Fluent UI selection now shows as ?adapter=fluentui in the address bar and is re-applied after every in-site navigation. Opening such a link selects the adapter before Blazor boots and stores it as the visitor's choice. ?adapter=mudblazor forces the default; any other value is ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to #490 / #491. Picking Fluent UI in the top bar now puts
?adapter=fluentuiin the address bar, so a copied link opens the site on the same adapter.Behaviour
?adapter=fluentui, re-applied after every in-site navigation (site links carry no query). Other query parameters and#fragmentsare kept.?adapter=fluentui|mudblazoris read by the pre-boot script inindex.html, so the accent is right on the first paint, and it becomes the visitor's stored choice. Any other value is ignored.fcAdapter.getnow reports the attribute that script resolved, so Blazor and the first paint agree even when storage is blocked.404.htmlstill work: the SPA decode runs before the adapter script.Verification
dotnet build FormCraft.sln -c Release: 0 warnings, 0 errors.DemoAdapterThemeTests12/12 (one new assertion: the boot script reads?adapter=).mudblazorlink overrides a stored Fluent choice, unknown value ignored, Home install command follows the link at 390 px, fragment kept, no console errors.🤖 Generated with Claude Code