From 5da4ef67ec94b90a724a1c4276aa9e092cfd50bd Mon Sep 17 00:00:00 2001 From: try2love <161727775+try2love@users.noreply.github.com> Date: Wed, 10 Dec 2025 08:21:15 +0800 Subject: [PATCH] feat:light/dark mode switch (#138) Summary - Adds browser theme detection on first visit using prefers-color-scheme media query - Renames localStorage key from dark-mode to next-ai-draw-io-dark-mode for consistency with other keys - Uses STORAGE_DIAGRAM_XML_KEY constant instead of hardcoded string in diagram-context.tsx Changes app/page.tsx: - On first visit (no saved preference), detect browser's color scheme preference - Update localStorage key to follow project naming convention (next-ai-draw-io-*) contexts/diagram-context.tsx: - Import STORAGE_DIAGRAM_XML_KEY from chat-panel.tsx - Replace hardcoded "next-ai-draw-io-diagram-xml" with the constant --- app/layout.tsx | 2 +- app/page.tsx | 85 ++++++++++++++++++++--------- components/chat-input.tsx | 69 ----------------------- components/chat-message-display.tsx | 1 + components/chat-panel.tsx | 48 ++++++++-------- components/settings-dialog.tsx | 50 +++++++++++++++++ contexts/diagram-context.tsx | 15 ++++- 7 files changed, 148 insertions(+), 122 deletions(-) diff --git a/app/layout.tsx b/app/layout.tsx index aa94e9c..19f0134 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -106,7 +106,7 @@ export default function RootLayout({ } return ( - +