Skip to content

#5 Implement Dark Mode - #11

Merged
jimbethancourt merged 5 commits into
mainfrom
implement-dark-mode
Sep 28, 2026
Merged

jimbethancourt merged 5 commits into
mainfrom
implement-dark-mode

Conversation

@jimbethancourt

@jimbethancourt jimbethancourt commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added Light, Dark, and System theme options. Explicit choices are restored across reloads and navigation, while System follows your device’s appearance preference.
    • Updated report pages to show breadcrumbs and theme controls together on a shared row.
    • Applied theme-aware colors across the interface, including report widgets.
  • Tests

    • Added coverage for theme selection, persistence, appearance, accessibility, and layout.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f179ba75-1c2d-42c7-bf93-1757d6cc0e14

📥 Commits

Reviewing files that changed from the base of the PR and between f1a00f3 and c65198d.

📒 Files selected for processing (10)
  • AGENTS.md
  • app/globals.css
  • app/layout.jsx
  • components/site-header.jsx
  • components/theme-toggle.jsx
  • plans/css-only-dark-mode.md
  • tests/e2e/dark-mode.spec.js
  • tests/integration/theme-toggle.test.jsx
  • tests/unit/layout-styles.test.js
  • tests/unit/theme-css.test.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds light, dark, and system theme controls. CSS selects the palette, and an inline script restores and saves explicit choices. The theme controls share a row with report breadcrumbs. Tests cover theme behavior, layout, and palette contrast.

Changes

Theme selection and persistence

Layer / File(s) Summary
Theme control, placement, and persistence
components/theme-toggle.jsx, app/layout.jsx, app/globals.css, components/site-header.jsx, tests/integration/theme-toggle.test.jsx, tests/e2e/dark-mode.spec.js, tests/unit/layout-styles.test.js, plans/css-only-dark-mode.md, AGENTS.md
Adds a labeled three-option radio group, places it in a theme bar with report breadcrumbs, and restores or saves explicit choices through local storage. Tests check the control, placement, alignment, and persistence.
Palette rules and color updates
app/globals.css, tests/unit/theme-css.test.js, tests/e2e/dark-mode.spec.js, plans/css-only-dark-mode.md, AGENTS.md
Defines light and dark palettes, applies palette variables to site and report styles, and checks OS-based selection and contrast. Guidance documents palette locations and overrides.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant ThemeToggle
  participant globals.css
  participant RootLayoutScript
  participant localStorage
  User->>ThemeToggle: Select a theme radio
  ThemeToggle->>globals.css: Checked radio selects the CSS palette
  ThemeToggle->>RootLayoutScript: Radio change event
  RootLayoutScript->>localStorage: Save rf-theme value
  RootLayoutScript->>ThemeToggle: Restore saved light or dark choice
Loading

Merge Risk: ⚪ Minimal · up to c6519

The theme controls and saved choices have no established merge-blocking issue; the remaining placement-description discrepancy is documentation-only.

Security Architecture Review

Security architecture risk: 🔵 Low · up to c6519

The change affects presentation preferences rather than access to protected data or services. The remaining uncertainty is whether every deployment applies the existing security-policy hash step to the new inline script.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected new state flow is confined to same-origin browser presentation state: a local-storage preference, radio properties, and CSS palette selection.

Trust Boundaries and Controls

  • observed — The inspected script does not evaluate saved data or use it to construct a URL; it checks a fixed radio ID only for saved light or dark values. The repository build is configured to hash inline scripts without adding unsafe-inline to the existing policy.

Resilience and Maintainability Implications

  • inferred — Already-open tabs can show different palettes after one tab changes the shared saved value: each page derives its palette from its own radio, and the script has no storage-event listener. The inspected effect is presentation drift, not drift in a security control.

Hardening Proposals

  • proposed — Verify that production deployment serves the post-build HTML containing the new inline script’s policy hash; repository build wiring alone does not establish the deployed response.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: implementing dark mode with light, dark, and system theme options.
Docstring Coverage ✅ Passed Docstring coverage is 90.91% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 7 files. (3 skipped: 3 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/globals.css

Parsing error: Unexpected token :


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jimbethancourt
jimbethancourt merged commit 740ca69 into main Sep 28, 2026
6 checks passed
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