From b20bf41bf44a80f4854986312502d9f82763aab6 Mon Sep 17 00:00:00 2001 From: Nicolas Varrot Date: Thu, 12 Feb 2026 23:51:01 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20theme=20switcher=20=E2=80=94=20dark,=20?= =?UTF-8?q?light,=20OLED=20modes=20with=20configurable=20accent=20colors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add ThemeContext with CSS custom properties for all base colors - Three theme modes: Dark (default), Light, OLED Black - Six accent colors: Cyan, Violet, Emerald, Amber, Rose, Blue - Theme switcher dropdown in header (palette icon) - Persisted in localStorage - CSS variables replace hardcoded hex colors in index.css and components - i18n support (EN/FR) for theme labels --- src/App.tsx | 4 +- src/components/ChatInput.tsx | 4 +- src/components/ErrorBoundary.tsx | 2 +- src/components/Header.tsx | 6 +- src/components/KeyboardShortcuts.tsx | 2 +- src/components/LoginScreen.tsx | 4 +- src/components/Sidebar.tsx | 4 +- src/components/ThemeSwitcher.tsx | 95 ++++++++++++++ src/components/ToolCall.tsx | 6 +- src/contexts/ThemeContext.tsx | 183 +++++++++++++++++++++++++++ src/index.css | 41 ++++-- src/lib/i18n.ts | 15 +++ src/main.tsx | 5 +- 13 files changed, 347 insertions(+), 24 deletions(-) create mode 100644 src/components/ThemeSwitcher.tsx create mode 100644 src/contexts/ThemeContext.tsx diff --git a/src/App.tsx b/src/App.tsx index 5107cc9..e3b363f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -74,7 +74,7 @@ export default function App() { // Still checking stored credentials if (authenticated === null) { return ( -
+
Connecting…
); @@ -87,7 +87,7 @@ export default function App() { return ( -
+
-
+
{/* File previews */} {files.length > 0 && (
diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index 41683e9..ba69531 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -40,7 +40,7 @@ export class ErrorBoundary extends Component { if (this.props.fallback) return this.props.fallback; return ( -
+
đź’Ą

diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 04ed521..4e92cda 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -3,6 +3,7 @@ import { Menu, Sparkles, LogOut, Volume2, VolumeOff, Cpu, Bot, Download } from ' import type { ConnectionStatus, Session, ChatMessage } from '../types'; import { useT } from '../hooks/useLocale'; import { LanguageSelector } from './LanguageSelector'; +import { ThemeSwitcher } from './ThemeSwitcher'; import { sessionDisplayName } from '../lib/sessionName'; import { messagesToMarkdown, downloadFile } from '../lib/exportChat'; @@ -32,7 +33,7 @@ export function Header({ status, sessionKey, onToggleSidebar, activeSessionData, return ( <> -
+
@@ -76,6 +77,7 @@ export function Header({ status, sessionKey, onToggleSidebar, activeSessionData, )} + {status === 'connected' ? (
@@ -113,7 +115,7 @@ export function Header({ status, sessionKey, onToggleSidebar, activeSessionData, const opacity = Math.max(0.35, Math.min(1, pct / 100)); const barStyle = { width: `${pct}%`, backgroundColor: `rgba(56, 189, 248, ${opacity})` }; return ( -
+
{activeSessionData?.model && ( diff --git a/src/components/KeyboardShortcuts.tsx b/src/components/KeyboardShortcuts.tsx index 5e3a627..19f1d41 100644 --- a/src/components/KeyboardShortcuts.tsx +++ b/src/components/KeyboardShortcuts.tsx @@ -56,7 +56,7 @@ export function KeyboardShortcuts({ open, onClose }: Props) { {/* Modal */}
e.stopPropagation()} > {/* Header */} diff --git a/src/components/LoginScreen.tsx b/src/components/LoginScreen.tsx index 0c3770a..26babad 100644 --- a/src/components/LoginScreen.tsx +++ b/src/components/LoginScreen.tsx @@ -37,7 +37,7 @@ export function LoginScreen({ onConnect, error, isConnecting }: Props) { }; return ( -
+
{/* Logo */}
@@ -50,7 +50,7 @@ export function LoginScreen({ onConnect, error, isConnecting }: Props) {
{/* Form */} -
+