Skip to content

feature: add Light Mode Only mode#33

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

feature: add Light Mode Only mode#33
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1781101858-light-mode-only

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown

Summary

Adds a Light Mode Only setting that locks the app to the light theme and disables the Dark Mode toggle. Useful for users who never want the app to render in dark mode (e.g. shared/kiosk setups). The preference persists via localStorage under light-mode-only.

When enabled it forces the theme to light and disables the Dark Mode row so it can't be turned back on:

const handleLightModeOnly = () => {
  const next = !isLightModeOnly;
  setIsLightModeOnly(next);
  setLightModeOnly(next);        // persisted to localStorage
  if (next) {
    setIsDarkMode(false);
    setTheme('light');
  }
};

// theme effect only applies dark when not locked
if (isDarkMode && !isLightModeOnly) body.setAttribute('data-theme', 'dark');
else body.removeAttribute('data-theme');

The Switch component gained a disabled prop (native disabled + dimmed .disabled style + click guard), used to lock the Dark Mode row while Light Mode Only is active.

Files

  • src/App.jsx: new light-mode-only localStorage state, handleLightModeOnly, dark-mode guard, props to SettingModal.
  • src/components/SettingModal/SettingModal.jsx: new "Light Mode Only" row; Dark Mode row disabled when active.
  • src/components/Switch/Switch.jsx + .module.scss: disabled prop support and styling.

Verification

Ran npm run check (Prettier) and npm run build — both pass. Manually tested in the browser: enabling Light Mode Only switches the UI to light and locks the Dark Mode toggle (clicking it does nothing).

Link to Devin session: https://app.devin.ai/sessions/09f6572e8db04aeeb65c2b28bafdf34d
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