From 09838a203cb201ecc8a3efe46035c905ef287e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Mon, 23 Feb 2026 00:40:45 +0100 Subject: [PATCH] refactor: consolidate utilities, clean up components, and improve theme persistence - Consolidate common utilities (cn, format, time) into lib/utils - Remove redundant utility files from pastel and units directories - Clean up unused components (Separator, KeyboardShortcutsHelp) - Relocate CommandPalette to components/units/ui/ - Force dark mode on landing page and improve theme persistence logic - Add FOUC prevention script to RootLayout - Fix sidebar height constraint in AppShell --- app/globals.css | 2 +- app/layout.tsx | 24 ++++- app/page.tsx | 11 +- components/layout/AppShell.tsx | 2 +- components/layout/AppSidebar.tsx | 2 +- components/providers/ThemeProvider.tsx | 13 ++- components/ui/KeyboardShortcutsHelp.tsx | 102 ------------------ components/ui/Separator.tsx | 32 ------ .../units/converter/ConversionHistory.tsx | 2 +- components/units/converter/MainConverter.tsx | 4 +- components/units/converter/SearchUnits.tsx | 2 +- .../units/converter/VisualComparison.tsx | 2 +- components/{ => units}/ui/CommandPalette.tsx | 2 +- lib/pastel/utils/cn.ts | 6 -- lib/{units/utils.ts => utils/format.ts} | 52 --------- lib/utils/index.ts | 2 + lib/utils/time.ts | 17 +++ 17 files changed, 71 insertions(+), 206 deletions(-) delete mode 100644 components/ui/KeyboardShortcutsHelp.tsx delete mode 100644 components/ui/Separator.tsx rename components/{ => units}/ui/CommandPalette.tsx (99%) delete mode 100644 lib/pastel/utils/cn.ts rename lib/{units/utils.ts => utils/format.ts} (53%) create mode 100644 lib/utils/time.ts diff --git a/app/globals.css b/app/globals.css index f8aafbe..442415b 100644 --- a/app/globals.css +++ b/app/globals.css @@ -109,7 +109,7 @@ } } -:root { +:root, .dark { /* CORPORATE DARK THEME (The Standard) */ --background: #0a0a0f; --foreground: #ffffff; diff --git a/app/layout.tsx b/app/layout.tsx index b70eeee..3b3d5e8 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -51,10 +51,32 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - + +