Skip to content

docs(demo): keep the selected adapter in the URL so links can be shared - #492

Merged
phmatray merged 1 commit into
devfrom
docs/demo-adapter-url
Sep 25, 2026
Merged

phmatray merged 1 commit into
devfrom
docs/demo-adapter-url

Conversation

@phmatray

Copy link
Copy Markdown
Owner

Follow-up to #490 / #491. Picking Fluent UI in the top bar now puts ?adapter=fluentui in the address bar, so a copied link opens the site on the same adapter.

Behaviour

  • Fluent UI selected → ?adapter=fluentui, re-applied after every in-site navigation (site links carry no query). Other query parameters and #fragments are kept.
  • MudBlazor is the default and drops the parameter.
  • An inbound ?adapter=fluentui|mudblazor is read by the pre-boot script in index.html, so the accent is right on the first paint, and it becomes the visitor's stored choice. Any other value is ignored.
  • fcAdapter.get now reports the attribute that script resolved, so Blazor and the first paint agree even when storage is blocked.
  • Deep links through GitHub Pages' 404.html still work: the SPA decode runs before the adapter script.

Verification

  • dotnet build FormCraft.sln -c Release: 0 warnings, 0 errors. DemoAdapterThemeTests 12/12 (one new assertion: the boot script reads ?adapter=).
  • Headless Chrome against the Release build, 13/13 checks: pre-boot attribute from a link, param kept across navigation, dropped on MudBlazor, re-added on Fluent, survives reload, mudblazor link 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

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>
@phmatray
phmatray merged commit a30cb4c into dev Sep 25, 2026
3 checks passed
@phmatray
phmatray deleted the docs/demo-adapter-url branch September 25, 2026 12:37
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.

1 participant