Skip to content

feature: add explicit light mode theme (default)#34

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1781102341-light-mode-theme
Open

feature: add explicit light mode theme (default)#34
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1781102341-light-mode-theme

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 10, 2026

Copy link
Copy Markdown

Summary

Makes light mode an explicit, well-defined theme and the default on first load. Previously "off" dark mode just removed data-theme, relying on the :root fallback; now light mode is a named theme set via data-theme="light", mirroring how dark works.

Key changes:

  • App.module.scss: added an explicit [data-theme='light'] variable block (alongside the existing :root defaults and [data-theme='dark']), and changed the hardcoded body { color: #fff } to var(--color-text-primary) so text is readable in light mode.
  • App.jsx: the theme effect now sets the attribute in both directions instead of removing it:
    - if (isDarkMode) document.body.setAttribute('data-theme', 'dark');
    - else document.body.removeAttribute('data-theme');
    + if (isDarkMode) document.body.setAttribute('data-theme', 'dark');
    + else document.body.setAttribute('data-theme', 'light');
  • App.jsx: default stored theme changed from 'dark' to 'light', so first-time visitors get light mode. The existing toggle in SettingModal ("Dark Mode") already persists 'light'/'dark' to localStorage via handleDarkMode, so the choice continues to survive reloads.

Screenshots

Light mode (new default):

light mode

Dark mode (via Settings → Dark Mode, persists across reloads):

dark mode

Testing

  • npm run check (prettier) passes.
  • Verified in browser: light default on fresh load, toggling Dark Mode switches data-theme and persists (localStorage.theme="dark", body[data-theme="dark"]) across reload.
  • Note: the single existing Jest test (App.test.jsx) fails on main as well (unrelated — useAlert is undefined without its provider in the test). Not introduced by this PR.

Link to Devin session: https://app.devin.ai/sessions/edc13b821f804c1ebec949e766235288
Requested by: @shahmir-masood


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

Co-Authored-By: shahmir.masood <shahmir.masood@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

0 participants