From 5163f3dd48f60bcd2ff84fc630b371cfd0244065 Mon Sep 17 00:00:00 2001 From: "shumeiko.it" Date: Mon, 26 Oct 2026 21:01:27 +0100 Subject: [PATCH] feat(web): add the calm redesign as a sidebar switch The redesign proposed after the anti-slop audit (anti-slop/audit-001) is now an opt-in design layer. The "New design" switch at the bottom of the sidebar sets data-design="calm" on and remembers it; theme-init.js applies the stored choice before the first paint. The classic look stays the default and is unchanged. styles/calm.css, scoped to that attribute, keeps the Hive DS colors and: bundles Hanken Grotesk and JetBrains Mono (@fontsource-variable, OFL-1.1); uses three radii (6 / 10 / 14 px); drops the honeycomb wallpaper, gradient fills, glass, glows and pulsing dots; keeps shadows only on menus and dialogs; shows labels as written instead of tracked capitals; and marks the active sidebar item with fill, a 1px line and weight instead of a stripe. Screen layouts are unchanged. --- apps/web/package.json | 2 + apps/web/public/theme-init.js | 4 + apps/web/src/app-entry.tsx | 4 + apps/web/src/components/os/AppShell.tsx | 2 +- apps/web/src/components/os/Sidebar.tsx | 37 ++++++- apps/web/src/lib/design-mode.ts | 41 +++++++ apps/web/src/styles/calm.css | 141 ++++++++++++++++++++++++ apps/web/src/test/design-mode.test.tsx | 73 ++++++++++++ package-lock.json | 20 ++++ 9 files changed, 321 insertions(+), 3 deletions(-) create mode 100644 apps/web/src/lib/design-mode.ts create mode 100644 apps/web/src/styles/calm.css create mode 100644 apps/web/src/test/design-mode.test.tsx diff --git a/apps/web/package.json b/apps/web/package.json index e5f2faf..418095a 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -16,6 +16,8 @@ "dependencies": { "@clerk/clerk-react": "^5.61.8", "@clerk/themes": "^2.4.57", + "@fontsource-variable/hanken-grotesk": "^5.3.0", + "@fontsource-variable/jetbrains-mono": "^5.3.0", "@hookform/resolvers": "^3.10.0", "@radix-ui/react-accordion": "^1.2.11", "@radix-ui/react-alert-dialog": "^1.1.14", diff --git a/apps/web/public/theme-init.js b/apps/web/public/theme-init.js index fe7cf0c..39941a2 100644 --- a/apps/web/public/theme-init.js +++ b/apps/web/public/theme-init.js @@ -5,6 +5,10 @@ (value === 'system' && window.matchMedia && !window.matchMedia('(prefers-color-scheme: dark)').matches); if (useLightTheme) document.documentElement.setAttribute('data-theme', 'light'); + // The calm redesign (src/lib/design-mode.ts) is opt-in from the sidebar. + if (localStorage.getItem('waggle-design') === 'calm') { + document.documentElement.setAttribute('data-design', 'calm'); + } } catch (_error) { // Storage can be unavailable in hardened webviews; dark is the default. } diff --git a/apps/web/src/app-entry.tsx b/apps/web/src/app-entry.tsx index 5c0833a..9e7a69a 100644 --- a/apps/web/src/app-entry.tsx +++ b/apps/web/src/app-entry.tsx @@ -2,6 +2,10 @@ import { createRoot } from 'react-dom/client'; import { flushSync } from 'react-dom'; import App from './App.tsx'; import './index.css'; +// Bundled fonts and the opt-in calm design layer (src/lib/design-mode.ts). +import '@fontsource-variable/hanken-grotesk'; +import '@fontsource-variable/jetbrains-mono'; +import './styles/calm.css'; import { applyStoredThemeEarly } from '@/providers/ThemeProvider'; export function mountApp(): void { diff --git a/apps/web/src/components/os/AppShell.tsx b/apps/web/src/components/os/AppShell.tsx index 0a8476f..5a45818 100644 --- a/apps/web/src/components/os/AppShell.tsx +++ b/apps/web/src/components/os/AppShell.tsx @@ -452,7 +452,7 @@ const ShellLayout = () => { return (
- +
{ const navigate = useNavigate(); const { pathname } = useLocation(); + const [design, setDesign] = useDesignMode(); + const calm = design === "calm"; const isActive = (item: SidebarNavItem): boolean => item.activeWhen @@ -95,7 +98,7 @@ const Sidebar = ({ {active && ( )} + {/* Design switch: the classic look or the calm redesign (styles/calm.css) */} + + + + {/* User row → Settings */}