feat(web): tighten the calm design after its anti-slop audit

Fixes items 3-11 of anti-slop/audit-002, all scoped to data-design=calm:
- no colored edges on Model Pilot rows, a connected extension or the
  active file workspace;
- section labels and eyebrows in the text face, mono for data only;
- one accent: honey text, washes and hover lines turn neutral, honey stays
  on primary buttons, the switch, focus and attention counts;
- dots with no state behind them are hidden and live dots no longer pulse;
- no card shadow or hover lift, including the --shadow token;
- inline-style gradients go solid or flat, glows go;
- no entrance motion: framer-motion animations finish instantly and the
  inline card-enter and scroll reveals are off;
- stock Tailwind hues map onto Hive status tokens, mixed toward --text so
  small status text keeps 4.5:1 in light;
- radii follow the 6 / 10 / 14 scale, text pills become chips.

The classic design is unchanged.
This commit is contained in:
shumeiko.it
2026-10-27 12:55:02 +01:00
parent ef99f04c5b
commit da574a5a7e
10 changed files with 348 additions and 11 deletions

View File

@@ -348,14 +348,14 @@ const ModelPilotCard = ({
the LaneDropdown below overhangs the row). */}
<span
aria-hidden
className="absolute left-0 top-1.5 bottom-1.5 w-[3px] rounded-full"
className="lane-rail absolute left-0 top-1.5 bottom-1.5 w-[3px] rounded-full"
style={{ background: lane.rail }}
/>
<div className="flex items-center justify-between">
<div className="flex items-center gap-2 min-w-0">
<lane.icon className="w-3.5 h-3.5 shrink-0 text-muted-foreground" />
<div className="min-w-0">
<p className="text-[11px] font-display font-semibold" style={{ color: lane.rail }}>
<p className="lane-label text-[11px] font-display font-semibold" style={{ color: lane.rail }}>
{lane.label}
</p>
<p className="text-[11px] text-muted-foreground truncate">{lane.description}</p>

View File

@@ -211,9 +211,10 @@ const Sidebar = ({
onClick={() => setDesign(calm ? "classic" : "calm")}
className="flex items-center justify-center gap-3 rounded-[10px] px-2.5 py-2 text-left text-[var(--text-2)] transition-colors hover:bg-[var(--surface-2)] hover:text-[var(--text)] lg:justify-start"
>
{/* Honey when on, so the icon-only rail shows the state too. */}
{/* Honey when on, so the icon-only rail shows the state too. --attention,
not --honey-text: calm turns honey text neutral. */}
<Palette
className={`h-[18px] w-[18px] shrink-0 ${calm ? "text-[var(--honey-text)]" : ""}`}
className={`h-[18px] w-[18px] shrink-0 ${calm ? "text-[var(--attention)]" : ""}`}
strokeWidth={1.7}
/>
<span className="hidden flex-1 text-[13px] font-medium lg:inline">New design</span>

View File

@@ -216,7 +216,7 @@ const StatusBar = ({ workspaceName, focusedWindowLabel, model, tokensUsed, costU
<button onClick={onNotificationClick} className="flex items-center gap-1 text-muted-foreground hover:text-honey transition-colors" aria-label={`Notifications${unreadNotifications > 0 ? ` (${unreadNotifications} unread)` : ''}`}>
<Bell className="w-3.5 h-3.5" />
{unreadNotifications > 0 && (
<span className="min-w-[15px] h-[15px] rounded-full bg-[var(--honey)] text-[10px] leading-none text-[#1a1407] flex items-center justify-center font-bold px-1 whitespace-nowrap">
<span className="unread-badge min-w-[15px] h-[15px] rounded-full bg-[var(--honey)] text-[10px] leading-none text-[#1a1407] flex items-center justify-center font-bold px-1 whitespace-nowrap">
{unreadNotifications > 9 ? '9+' : unreadNotifications}
</span>
)}

View File

@@ -1634,7 +1634,7 @@ const ChatApp = ({
title="Waggle picked the model — click to override"
className={STRIP_PILL}
>
<DotLive tone="healthy" size={7} />
<DotLive tone="healthy" size={7} className="decor-dot" />
<span className="max-w-[82px] truncate font-mono text-[var(--text-2)] sm:max-w-[140px]">
{currentModel ? formatModelLabel(currentModel) : 'auto'}
</span>

View File

@@ -315,7 +315,7 @@ function GreetingHeader({
<header className="mb-9">
<div className="mb-4 flex items-center justify-between gap-3">
<div className="flex items-center gap-2 font-mono text-[11px] uppercase tracking-[0.12em] text-[var(--honey-text)]">
<DotLive tone="healthy" size={7} />
<DotLive tone="healthy" size={7} className="decor-dot" />
<span>{formatBriefingDate(date)}</span>
{formatClock(date) && <span className="text-[var(--text-tertiary)]">· {formatClock(date)}</span>}
</div>

View File

@@ -18,7 +18,7 @@ interface ModelPillProps {
export function ModelPill({ mode = 'auto', model, onClick, title, className }: ModelPillProps) {
const content = (
<>
<DotLive tone="healthy" size={7} />
<DotLive tone="healthy" size={7} className="decor-dot" />
<span className="font-mono text-[12px] text-[var(--text-2)]">
{mode ? <span className="text-[var(--text-dim)]">{mode} · </span> : null}
{model}

View File

@@ -39,7 +39,7 @@ export function OvernightHero({
/>
<div className="relative">
<div className="mb-3 flex items-center gap-2 font-mono text-[11px] uppercase tracking-[0.1em] text-[var(--text-muted)]">
<DotLive tone="intel" size={7} />
<DotLive tone="intel" size={7} className="decor-dot" />
{eyebrow}
</div>
<p className="max-w-[60ch] text-[clamp(19px,2.4vw,26px)] font-semibold leading-[1.4] text-[var(--text)]">

View File

@@ -6,6 +6,7 @@
* the first paint, so a reload never flashes the other design.
*/
import { useSyncExternalStore } from 'react';
import { MotionGlobalConfig } from 'framer-motion';
export type DesignMode = 'classic' | 'calm';
@@ -18,10 +19,19 @@ export function getDesignMode(): DesignMode {
return document.documentElement.getAttribute('data-design') === 'calm' ? 'calm' : 'classic';
}
/** Calm has no entrance, idle or layout motion. CSS cannot reach framer-motion's
* inline styles, so its animations are told to finish instantly instead. */
function syncMotion(mode: DesignMode): void {
MotionGlobalConfig.skipAnimations = mode === 'calm';
}
syncMotion(getDesignMode());
export function setDesignMode(mode: DesignMode): void {
const root = document.documentElement;
if (mode === 'calm') root.setAttribute('data-design', 'calm');
else root.removeAttribute('data-design');
syncMotion(mode);
try {
localStorage.setItem(DESIGN_STORAGE_KEY, mode);
} catch {

View File

@@ -17,13 +17,34 @@
--font-sans: var(--sans);
--font-mono: var(--mono);
--radius: 10px;
--r-sm: 6px;
--r: 10px;
--r-lg: 10px;
--r-xl: 14px;
--shadow: none;
--shadow-lg: none;
--shadow-card: none;
--shadow-elevated: none;
--shadow-sm: none;
--shadow-honey: none;
--shadow-honey-bloom: none;
--honey-glow: transparent;
/* One accent. Honey stays on primary buttons, the switch, focus rings and
attention counts; honey text, washes and hover lines turn neutral. */
--honey-text: var(--text);
--honey-wash: var(--surface-2);
--honey-line: var(--line-strong);
/* Small status text needs 4.5:1. Light --healthy and --risk reach only
3.5-4.4:1 on the paper surfaces, so text mixes them toward --text
(5.2:1 or more in light, 7.3:1 or more in dark). */
--calm-healthy-text: color-mix(in srgb, var(--healthy) 72%, var(--text));
--calm-risk-text: color-mix(in srgb, var(--risk) 72%, var(--text));
/* The older status set used stock Tailwind hues; it follows Hive here. */
--status-healthy: var(--calm-healthy-text);
--status-warning: var(--attention);
--status-error: var(--calm-risk-text);
--status-info: var(--text-2);
--status-ai: var(--text-2);
}
/* ── Type ─────────────────────────────────────────────────────────────── */
@@ -42,6 +63,12 @@
letter-spacing: normal;
}
/* Mono is for data. Section labels and eyebrows were mono capitals; they read
as ordinary words in the text face. */
:root[data-design="calm"] .font-mono.uppercase {
font-family: var(--sans);
}
/* ── Radii: 6 for controls, 10 for cards, 14 for windows ──────────────── */
:root[data-design="calm"] :is(.rounded-sm, .rounded-md) {
@@ -56,6 +83,24 @@
border-radius: 14px;
}
:root[data-design="calm"] :is(.rounded-\[7px\], .rounded-\[8px\]) {
border-radius: 6px;
}
:root[data-design="calm"] :is(.rounded-\[9px\], .rounded-\[11px\], .rounded-\[12px\]) {
border-radius: 10px;
}
:root[data-design="calm"] :is(.rounded-\[16px\], .rounded-\[18px\], .rounded-\[26px\]) {
border-radius: 14px;
}
/* Pills that hold text become chips at the control radius. Dots, avatars and
switch tracks carry no horizontal padding, so they stay round. */
:root[data-design="calm"] .rounded-full[class*="px-"] {
border-radius: 6px;
}
/* ── Depth: flat surfaces; only menus and dialogs float ───────────────── */
:root[data-design="calm"] :is(.shadow-sm, .shadow, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl):not(
@@ -64,6 +109,19 @@
box-shadow: none;
}
/* Cards do not lift or glow on hover; the border still answers the pointer. */
:root[data-design="calm"] :is(.hive-interactive, .hive-interactive-row):is(:hover, :focus-visible, :focus-within, :active) {
transform: none;
}
:root[data-design="calm"] [class*="hover:-translate-y"]:hover {
--tw-translate-y: 0;
}
:root[data-design="calm"] .group:hover .group-hover\:shadow-xl {
box-shadow: none;
}
:root[data-design="calm"] :is(.glass, .glass-strong) {
background: var(--surface);
}
@@ -92,11 +150,35 @@
}
/* A status dot shows a state; it does not pulse. Loading skeletons keep
animate-pulse, since they mark real loading. */
:root[data-design="calm"] :is(.animate-ping, .honey-pulse, .glow-breathe, .hive-ambient-breath) {
animate-pulse, since they mark real loading. Framer-motion animations are
switched off in lib/design-mode.ts. */
:root[data-design="calm"] :is(.animate-ping, .honey-pulse, .glow-breathe, .hive-ambient-breath, .dot-live, .float, .recall-bloom) {
animation: none;
}
/* Cards on Home, All workspaces and Memory rise into place through an inline
card-enter animation; in calm they are simply there. */
:root[data-design="calm"] [style*="card-enter"] {
animation: none !important;
}
/* Home sections otherwise wait, invisible, until they scroll into view. */
:root[data-design="calm"] [data-reveal="pending"] {
opacity: 1 !important;
}
/* Dots with no state behind them: the date on Home, the overnight eyebrow and
the always-green dot beside the model name. */
:root[data-design="calm"] .decor-dot {
display: none;
}
/* The unread count is a fact, not an accent. */
:root[data-design="calm"] .unread-badge {
background: var(--text);
color: var(--bg);
}
/* ── Sidebar: active item by fill, 1px line and weight, no stripe ─────── */
:root[data-design="calm"] .waggle-sidebar .nav-active-stripe {
@@ -113,6 +195,26 @@
color: inherit;
}
/* The same rule elsewhere: no colored edge on a row or card. Model Pilot names
each role in text, so its rail and tinted label go. A connected extension
and the active file workspace keep their fill and get a 1px line. */
:root[data-design="calm"] .lane-rail {
display: none;
}
:root[data-design="calm"] .lane-label {
color: var(--text) !important;
}
:root[data-design="calm"] [class*="shadow-[inset_2px_0_0_0_var(--honey)"] {
box-shadow: inset 0 0 0 1px var(--line-strong);
background-image: none;
}
:root[data-design="calm"] .border-l-2:is(.border-primary, .border-primary\/60) {
border-left-color: transparent;
}
/* ── Surfaces: a plain backdrop and flat cards ─────────────────────────── */
:root[data-design="calm"] body {
@@ -128,6 +230,24 @@
border-color: var(--line);
}
:root[data-design="calm"] [class*="bg-gradient-to-"] {
background-image: none;
}
/* Gradients set in style attributes: honey marks and bars go solid, surface
gradients go flat, glows go. */
:root[data-design="calm"] [style*="gradient"]:is([style*="--honey-bright"], [style*="--honey-deep"]):not(.hex) {
background: var(--honey) !important;
}
:root[data-design="calm"] [style*="gradient"]:is([style*="--secondary"], [style*="var(--bg-2), var(--bg)"]) {
background: var(--surface) !important;
}
:root[data-design="calm"] [style*="gradient"]:is([style*="--honey-wash"], [style*="--honey-glow"], [style*="rgba(229, 160, 0"], [style*="rgba(255, 255, 255, 0.12)"]) {
background: none !important;
}
/* Decorative glows sit behind content and never take pointer events. */
:root[data-design="calm"] [class*="bg-[radial-gradient"].pointer-events-none {
display: none;
@@ -139,3 +259,199 @@
background: var(--surface-2) !important;
color: var(--text) !important;
}
/* ── Palette: stock Tailwind hues mapped onto Hive DS ───────────────────
Green, amber and red carry state, so they take --healthy, --attention and
--risk. Blue, sky, cyan and violet mark nothing and turn neutral. Solid
green and amber fills are action buttons and take the primary honey fill.
The selectors list the utilities the components use today; a hue added
later needs its own line here. */
:root[data-design="calm"] .bg-amber-400 {
background-color: var(--attention);
}
:root[data-design="calm"] .bg-amber-500,
:root[data-design="calm"] .bg-emerald-600,
:root[data-design="calm"] .hover\:bg-emerald-500:hover {
background-color: var(--honey);
color: #1a1407;
}
:root[data-design="calm"] .bg-amber-500\/10,
:root[data-design="calm"] .bg-orange-500\/10 {
background-color: color-mix(in srgb, var(--attention) 10%, transparent);
}
:root[data-design="calm"] .bg-amber-500\/15 {
background-color: color-mix(in srgb, var(--attention) 15%, transparent);
}
:root[data-design="calm"] .bg-amber-500\/20 {
background-color: color-mix(in srgb, var(--attention) 20%, transparent);
}
:root[data-design="calm"] .bg-amber-500\/5 {
background-color: color-mix(in srgb, var(--attention) 5%, transparent);
}
:root[data-design="calm"] .bg-blue-500\/20,
:root[data-design="calm"] .bg-purple-500\/20,
:root[data-design="calm"] .bg-sky-500\/20,
:root[data-design="calm"] .bg-violet-500\/20 {
background-color: color-mix(in srgb, var(--text) 10%, transparent);
}
:root[data-design="calm"] .bg-emerald-400 {
background-color: var(--healthy);
}
:root[data-design="calm"] .bg-emerald-500\/10,
:root[data-design="calm"] .bg-teal-500\/10,
:root[data-design="calm"] .hover\:bg-emerald-500\/10:hover {
background-color: color-mix(in srgb, var(--healthy) 10%, transparent);
}
:root[data-design="calm"] .bg-emerald-500\/15,
:root[data-design="calm"] .bg-green-500\/15 {
background-color: color-mix(in srgb, var(--healthy) 15%, transparent);
}
:root[data-design="calm"] .bg-emerald-500\/20 {
background-color: color-mix(in srgb, var(--healthy) 20%, transparent);
}
:root[data-design="calm"] .bg-emerald-500\/5 {
background-color: color-mix(in srgb, var(--healthy) 5%, transparent);
}
:root[data-design="calm"] .bg-rose-500\/20 {
background-color: color-mix(in srgb, var(--risk) 20%, transparent);
}
:root[data-design="calm"] .bg-sky-500\/10,
:root[data-design="calm"] .bg-violet-500\/10 {
background-color: color-mix(in srgb, var(--text) 5%, transparent);
}
:root[data-design="calm"] .bg-sky-500\/15 {
background-color: color-mix(in srgb, var(--text) 7%, transparent);
}
:root[data-design="calm"] .bg-violet-500\/5 {
background-color: color-mix(in srgb, var(--text) 3%, transparent);
}
:root[data-design="calm"] .border-amber-400\/30,
:root[data-design="calm"] .border-amber-500\/30 {
border-color: color-mix(in srgb, var(--attention) 30%, transparent);
}
:root[data-design="calm"] .border-amber-500 {
border-color: var(--attention);
}
:root[data-design="calm"] .border-amber-500\/20 {
border-color: color-mix(in srgb, var(--attention) 20%, transparent);
}
:root[data-design="calm"] .border-amber-500\/50 {
border-color: color-mix(in srgb, var(--attention) 50%, transparent);
}
:root[data-design="calm"] .border-amber-500\/60 {
border-color: color-mix(in srgb, var(--attention) 60%, transparent);
}
:root[data-design="calm"] .border-emerald-400\/30,
:root[data-design="calm"] .border-emerald-500\/30 {
border-color: color-mix(in srgb, var(--healthy) 30%, transparent);
}
:root[data-design="calm"] .border-emerald-500\/20 {
border-color: color-mix(in srgb, var(--healthy) 20%, transparent);
}
:root[data-design="calm"] .border-emerald-500\/40 {
border-color: color-mix(in srgb, var(--healthy) 40%, transparent);
}
:root[data-design="calm"] .border-sky-400\/30,
:root[data-design="calm"] .border-sky-500\/30,
:root[data-design="calm"] .border-violet-400\/30,
:root[data-design="calm"] .border-violet-500\/20,
:root[data-design="calm"] .border-violet-500\/30 {
border-color: var(--line-strong);
}
:root[data-design="calm"] .hover\:bg-amber-400:hover {
background-color: var(--honey-bright);
}
:root[data-design="calm"] .hover\:bg-amber-500\/30:hover {
background-color: color-mix(in srgb, var(--attention) 30%, transparent);
}
:root[data-design="calm"] .hover\:bg-violet-500\/30:hover {
background-color: color-mix(in srgb, var(--text) 15%, transparent);
}
:root[data-design="calm"] .hover\:text-amber-400:hover,
:root[data-design="calm"] .text-amber-200,
:root[data-design="calm"] .text-amber-300,
:root[data-design="calm"] .text-amber-400,
:root[data-design="calm"] .text-orange-400 {
color: var(--attention);
}
:root[data-design="calm"] .hover\:text-emerald-300:hover,
:root[data-design="calm"] .hover\:text-emerald-400:hover,
:root[data-design="calm"] .hover\:text-green-400:hover,
:root[data-design="calm"] .text-emerald-300,
:root[data-design="calm"] .text-emerald-400,
:root[data-design="calm"] .text-emerald-500,
:root[data-design="calm"] .text-green-400,
:root[data-design="calm"] .text-green-500,
:root[data-design="calm"] .text-teal-400 {
color: var(--calm-healthy-text);
}
:root[data-design="calm"] .ring-emerald-500\/30,
:root[data-design="calm"] .ring-teal-500\/30 {
--tw-ring-color: color-mix(in srgb, var(--healthy) 30%, transparent);
}
:root[data-design="calm"] .ring-orange-500\/30 {
--tw-ring-color: color-mix(in srgb, var(--attention) 30%, transparent);
}
:root[data-design="calm"] .ring-sky-500\/30 {
--tw-ring-color: var(--line-strong);
}
:root[data-design="calm"] .text-amber-400\/70 {
color: color-mix(in srgb, var(--attention) 70%, transparent);
}
:root[data-design="calm"] .text-amber-950 {
color: #1a1407;
}
:root[data-design="calm"] .text-blue-400,
:root[data-design="calm"] .text-cyan-400,
:root[data-design="calm"] .text-purple-400,
:root[data-design="calm"] .text-sky-300,
:root[data-design="calm"] .text-sky-400,
:root[data-design="calm"] .text-sky-400\/80,
:root[data-design="calm"] .text-sky-400\/90,
:root[data-design="calm"] .text-violet-400 {
color: var(--text-2);
}
:root[data-design="calm"] .text-emerald-400\/40 {
color: color-mix(in srgb, var(--calm-healthy-text) 40%, transparent);
}
:root[data-design="calm"] .text-rose-400 {
color: var(--calm-risk-text);
}

View File

@@ -9,6 +9,7 @@ import { MemoryRouter } from 'react-router-dom';
import fs from 'node:fs';
import path from 'node:path';
import { Home } from 'lucide-react';
import { MotionGlobalConfig } from 'framer-motion';
import Sidebar from '@/components/os/Sidebar';
import { DESIGN_STORAGE_KEY, getDesignMode, setDesignMode } from '@/lib/design-mode';
@@ -18,6 +19,7 @@ afterEach(() => {
cleanup();
root.removeAttribute('data-design');
localStorage.clear();
MotionGlobalConfig.skipAnimations = false;
});
function renderSidebar() {
@@ -48,6 +50,14 @@ describe('design mode', () => {
expect(getDesignMode()).toBe('classic');
});
it('makes framer-motion animations instant only in the calm design', () => {
setDesignMode('calm');
expect(MotionGlobalConfig.skipAnimations).toBe(true);
setDesignMode('classic');
expect(MotionGlobalConfig.skipAnimations).toBe(false);
});
it('switches between the designs from the sidebar', () => {
renderSidebar();
const toggle = screen.getByRole('switch', { name: 'New design' });