Skip to content

feat: add chat appearance settings with multiple color themes#201

Merged
SudiptaPaul-31 merged 1 commit into
Lumina-eX:mainfrom
dotmantissa:main
Jun 29, 2026
Merged

feat: add chat appearance settings with multiple color themes#201
SudiptaPaul-31 merged 1 commit into
Lumina-eX:mainfrom
dotmantissa:main

Conversation

@dotmantissa

Copy link
Copy Markdown
Contributor

📌 Pull Request

🔗 Related Issue

Closes #183


📝 Description

  • Adds a unified Appearance modal accessible from the header (palette icon) that lets users pick both a color theme and dark/light mode — all without a page refresh.
  • The existing ThemeToggle button provided only dark/light switching; there was no way to customize the accent color palette. This PR satisfies the issue requirement to support multiple color themes and persist the preference locally.

🚀 Changes Made

  • Feature implemented: Theme settings modal with 5 color themes (Purple, Ocean, Sunset, Forest, Midnight) and a Dark/Light mode picker
  • Bug fixed:
  • Refactor:
  • Documentation updated:

New files:

  • lib/chat-theme.tsx — React context (ChatThemeProvider + useChatTheme) that manages color theme state, persists selection to localStorage, and applies the three key CSS custom properties (--primary, --secondary, --accent) as inline styles on the document root so changes are instant
  • components/theme-settings-modal.tsx — Radix Dialog modal with a Mode section (Light/Dark) and a Color Theme section showing three color swatches per option plus a radio-style active indicator

Modified files:

  • app/layout.tsx — Wraps the provider tree with ChatThemeProvider (inside ThemeProvider, outside WebSocketProvider)
  • components/header.tsx — Replaces the standalone ThemeToggle with ThemeSettingsModal in both the desktop nav bar and the mobile slide-out drawer

🧪 Testing & Validation

  • Tested locally
  • No runtime errors
  • Existing features work as expected
  • Edge cases handled

Validated:

  • Switching color themes updates the UI instantly (no refresh)
  • Reloading the page restores the last selected theme from localStorage
  • Dark and light modes work correctly for every color theme — neutral variables (background, foreground, card, border) are untouched; only accent colors change
  • Mobile drawer shows the palette button and the modal opens correctly
  • TypeScript type check (pnpm exec tsc --noEmit) passes with zero errors

⚠️ Breaking Changes

  • No breaking changes
  • Breaking changes exist (explain below)

The standalone ThemeToggle component is no longer rendered in the header, but the component file itself (components/theme-toggle.tsx) is kept intact. The new modal surfaces the same dark/light control alongside color theme selection.


📸 Screenshots (REQUIRED for UI changes)

Before After
Header had a sun/moon toggle only Header has a palette icon that opens the Appearance modal
Single dark/light toggle Unified modal with Mode (Light/Dark) + 5 color theme swatches
No color customization Purple, Ocean, Sunset, Forest, Midnight themes available

📋 Contributor Checklist (MANDATORY)

  • I was assigned to this issue
  • My code follows the project structure and conventions
  • I have tested my changes thoroughly
  • I did not introduce unnecessary dependencies
  • I have linked the issue (Closes #183)
  • This PR is ready for review

💡 Notes for Reviewer

  • Key areas to review: lib/chat-theme.tsx — the inline style approach for applying CSS custom properties on document.documentElement is intentional; it beats both :root and .dark class selectors in specificity, which is how theme changes take effect instantly without needing to add/remove classes or re-render the provider tree
  • Known limitations: There is a brief flash on first load if a non-default theme was saved (the CSS defaults apply until useEffect fires and reads localStorage). This is acceptable for a chat app behind auth; a <script> tag in <head> could eliminate it if needed later

@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@dotmantissa Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@SudiptaPaul-31

Copy link
Copy Markdown
Collaborator

@dotmantissa resolve conflicts

Adds a theme settings modal accessible from the header that lets users
customize the chat appearance without a page refresh.

- Five color themes: Purple (default), Ocean, Sunset, Forest, Midnight
- Dark/Light mode selector moved into the modal for a unified UX
- Color preference persists in localStorage across sessions
- Theme changes apply instantly by writing CSS custom properties
  directly onto the document root element, overriding the defaults
  from globals.css without touching any neutral/layout variables
- The existing next-themes dark/light toggle continues to work
  independently; color themes compose correctly with either mode
@dotmantissa dotmantissa force-pushed the main branch 2 times, most recently from 3f6ed34 to 8340b9b Compare June 29, 2026 13:15
@dotmantissa

Copy link
Copy Markdown
Contributor Author

@SudiptaPaul-31
Done.

@SudiptaPaul-31 SudiptaPaul-31 merged commit 6e813bc into Lumina-eX:main Jun 29, 2026
1 check 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.

Implement Chat Theme Customization

2 participants