Skip to content

fix(ui): preserve fixed dark palette on system theme changes - #88

Merged
DysektAI merged 1 commit into
masterfrom
fix/86-fixed-dark-theme
Nov 2, 2026
Merged

DysektAI merged 1 commit into
masterfrom
fix/86-fixed-dark-theme

Conversation

@DysektAI

@DysektAI DysektAI commented Nov 2, 2026

Copy link
Copy Markdown
Member

System theme notifications could switch the fixed-dark shell to MudBlazor's default light palette, leaving dark text and purple controls on dark surfaces. Disable system-theme observation on the shared provider so the app and overlay keep their intended palette.

Adds a real WebView2 regression that changes dark/light media preferences, navigates Tracking/About/General Settings, checks computed accent/text/surface colors, and captures screenshots. Updates the UI and validation context.

Validation:

  • scripts/verify.ps1 -Mode Full passed: Debug/Release builds with zero warnings/errors, 440 unit tests passed in each configuration (6 optional local image-fixture tests skipped), and all 3 WebView tests passed.
  • Final regression sensitivity: temporarily removing the fix fails with expected brass rgb(166, 154, 119) versus actual default purple rgb(89, 74, 226).
  • Final UI suite rerun after restoring the fix; screenshots visually inspected for readable text and brass accents.
  • CodeRabbit local review: zero findings. Formatting, Markdown, agent-doc and script validator checks passed.

Fixes #86

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 65ed5132-7e20-4c85-9808-3c4823633ac1
Commits

Reviewing files that changed from the base of the PR and between 891b774 and 90caf49.

Files selected for processing: 4
  • docs/agent-context/app-ui.md
  • docs/agent-context/build-and-validation.md
  • src/App/Shared/MainLayout.razor
  • tests/RatScanner.UiTests/WebViewSmokeTests.cs

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • The app now consistently uses its dark theme, including its brass accent colors, even when your device switches between light and dark appearance.
    • The dark color palette remains consistent as you move between Tracking, About, and Settings.

The shared MudBlazor provider now ignores system dark-mode changes. A WebView smoke test checks the dark palette across system scheme changes and app routes.

Changes: Fixed Dark Palette

Layer / File(s) Summary
Configure fixed dark provider
src/App/Shared/MainLayout.razor, docs/agent-context/app-ui.md
The provider disables system dark-mode observation. The UI guidance documents the fixed dark palette, including its brass accent.
Verify palette across routes
tests/RatScanner.UiTests/WebViewSmokeTests.cs, docs/agent-context/build-and-validation.md
The WebView smoke test checks primary, primary-text, and surface colors while changing system schemes and navigating Tracking, About, and Settings. The validation checklist records the palette checks and screenshot capture.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • Issue 87: The planning issue identifies the fixed-dark theme problem as a release follow-up, and this change implements that theme fix.
Merge Risk: Minimal · up to 90caf

No merge-blocking risk is identified for the fixed-dark palette change.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: the fix keeps the fixed dark palette when system theme changes occur. It matches the MainLayout.razor change that sets ObserveSystemDarkModeChange to false, which is t…
Description check Passed The description states the problem (system theme notifications switch the fixed-dark shell to the default light palette) and the fix (disabling system-theme observation on the shared provider). It als…
Linked Issues check Passed The PR meets the coding requirements in issue #86. src/App/Shared/MainLayout.razor sets ObserveSystemDarkModeChange="false" on the shared fixed-dark MudThemeProvider. `Fixed_dark_palette_survive…
Out of Scope Changes check Passed The changes stay within issue #86 scope. The provider change fixes the fixed-dark palette behavior. The WebView regression test validates the affected navigation and palette. The agent-context updates…
Full details: Title check

Explanation

The title names the main change: the fix keeps the fixed dark palette when system theme changes occur. It matches the MainLayout.razor change that sets ObserveSystemDarkModeChange to false, which is the core of the fix. The title uses the conventional fix(ui) prefix and is 60 characters long, which is within a normal length. It does not cover the regression test or the doc updates, which is acceptable.

Full details: Description check

Explanation

The description states the problem (system theme notifications switch the fixed-dark shell to the default light palette) and the fix (disabling system-theme observation on the shared provider). It also describes the added WebView2 regression test, the validation run, and the doc updates. These match the raw summary of changes in MainLayout.razor, WebViewSmokeTests.cs, and the agent-context docs.

Full details: Linked Issues check

Explanation

The PR meets the coding requirements in issue #86. src/App/Shared/MainLayout.razor sets ObserveSystemDarkModeChange="false" on the shared fixed-dark MudThemeProvider. Fixed_dark_palette_survives_system_theme_changes_and_navigation emulates dark and light media changes, navigates Tracking, About, and General Settings, checks primary, text-primary, and surface colors, captures screenshots, and checks runtime failures. The PR description also records that removing the fix reproduced the default purple palette.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #86 scope. The provider change fixes the fixed-dark palette behavior. The WebView regression test validates the affected navigation and palette. The agent-context updates document the same provider behavior and validation. No unrelated display-scale implementation or unrelated product behavior is shown.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@DysektAI DysektAI self-assigned this Nov 2, 2026
@DysektAI
DysektAI merged commit 84aece0 into master Nov 2, 2026
9 checks passed
@DysektAI
DysektAI deleted the fix/86-fixed-dark-theme branch November 2, 2026 05:04
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.

Fixed dark UI can switch to unreadable default light controls after theme notifications

1 participant