Repository navigation
Conversation
Reviewer's GuideUIUse the shared error page for unmatched routes and redirect null or 404 status codes to the home page.
Replace the print-specific layout with the empty layout for the print view.
ConfigurationConfigure exception and status-code handling to use the error route, and redirect unmatched requests to the home page.
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Linked issuesChecked at commit 11b7de4 #8910 fix(Server): prevent first-paint theme flash and fix pt-BR time format · 4 of 5 met
|
| <head> | ||
| <script> | ||
| (() => { | ||
| const theme = localStorage.getItem('theme') ?? 'auto'; |
There was a problem hiding this comment.
🟡 Medium · System theme is not applied
When browser policy blocks access to local storage, localStorage.getItem throws before matchMedia runs, aborting the script and leaving the page with its hard-coded light theme instead of the system theme.
Catch local-storage access errors and fall back to auto so the script can read the system preference.
| const activeTheme = theme === 'auto' | ||
| ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') | ||
| : theme; | ||
| document.documentElement.setAttribute('data-bs-theme', activeTheme); |
There was a problem hiding this comment.
⚪ Low · Theme setup bypasses JSInterop
When the first-paint theme initializer runs, the inline script calls document.documentElement.setAttribute directly instead of using JSInterop, violating the repository’s DOM-access rule.
Replace the direct DOM mutation with a repository-approved JSInterop-based DOM update.
From docs/agents/component-checklist.md L21:
- 不直接操作 DOM(用 JSInterop)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8911 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 664 664
Lines 30526 30526
=========================================
Hits 30526 30526
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# Conflicts: # src/BootstrapBlazor.Server/Components/Pages/Error.razor
Link issues
fixes #8910
Summary By Copilot
Router.NotFoundPageto theErrorpage, delete theNotFoundpage, and handle unknown Blazor routes inError.razor./error/{StatusCode:int?}route; a 404 or a missing status code redirects to the home page.PrintLayouttoEmptyLayoutand use it for both theErrorpage andPrintView./error/{0}, route the MVC exception handler to/error, and redirect the unknown MVC fallback to the home page.Regression?
Risk
Changes are limited to the sample site (
BootstrapBlazor.Server); the component library API is unchanged.Verification
No build or tests were run for this PR-only task; only the branch diff was checked, and no browser verification was performed.
Packaging changes reviewed?
☑️ Self Check before Merge