# Handoff: ChatApp — Clean Rail Redesign (Chat + Friends + Admin + Settings + Calls) ## Overview Full design spec for redesigning the existing ChatApp (Netralax) interface around a **Clean Rail** layout aesthetic. Covers **four main screens** plus the complete call UX: 1. **Chat** — icon-rail + chat list + conversation area 2. **Friends** — friends list, outgoing requests, incoming requests, user search 3. **Admin** — stats, invite-code management, user administration 4. **Settings** — account, appearance, privacy, voice/audio, screenshare, devices, danger zone 5. **Calls** — incoming overlay → in-call dock → fullscreen → picture-in-picture All screens work in **light** and **dark** mode. --- ## About the Design Files The files in this bundle are **design references created in HTML/React/CSS** — prototypes showing the intended look, layout, and behavior. They are **not production code** to copy verbatim. Your task is to **recreate these designs inside the existing ChatApp codebase** using its established patterns (existing React components, styling conventions, state management, icon library, etc.). If some tokens or helper components don't exist yet in the codebase, add them but keep them aligned with what's already there. File layout: - `ChatApp Redesign.html` — entry HTML (open in a browser to see the prototype) - `components/app.jsx` — main layout (rail + chat list + chat area + call state machine + tab switching) - `components/pages.jsx` — **Friends, Admin, Settings page components** plus shared page primitives (PageHeader, Section, Toggle, SegmentedControl, Row, Empty, Banner, FlagChip, FriendRow) - `components/call.jsx` — call UI (IncomingCallScreen, ActiveCallScreen, ParticipantTile, CallControls, PipCall) - `components/icons.jsx` — SVG icon set - `components/data.jsx` — dummy chat/message data - `styles/base.css` — shared base tokens + layout primitives - `styles/variants.css` — `variant-clean` light + dark token definitions - `styles/rail.css` — rail-layout specifics - `styles/call.css` — call UI styles - `styles/pages.css` — **Friends/Admin/Settings page styles** - `screenshots/` — reference images ## Fidelity **High-fidelity.** Exact colors, radii, spacing, typography and motion are specified. Recreate pixel-perfectly using the codebase's existing component library — but prefer the codebase's primitives over duplicating the prototype's raw CSS where equivalents exist. --- ## Design Tokens (Clean Rail) ### Colors — Light mode (`.variant-clean`) ``` --bg: #fafaf9 --bg-2: #f4f4f2 --bg-3: #ffffff --fg: #0a0a0f --fg-muted: #737380 --line: rgba(10,10,15,0.08) --accent: #4F46E5 --accent-fg: #ffffff ``` ### Colors — Dark mode (`.variant-clean.dark`) ``` --bg: #050507 --bg-2: #111118 --bg-3: #0A0A0F --fg: #f4f4f5 --fg-muted: #8a8a99 --line: rgba(255,255,255,0.07) --accent: #6D73FF --accent-fg: #ffffff ``` ### Semantic Colors ``` Success / Online / E2EE: #16a34a (light) · #4ade80 / #22c55e (dark) Danger / Decline: #dc2626 / #b91c1c hover · #fb7185 (dark accent for borders/text) Warning / Expired: #f59e0b · #d97706 light · #fbbf24 dark Live / Recording: #ef4444 ``` ### Avatar swatches (assigned per user) ``` violet: bg #ddd6fe / fg #5b21b6 (dark: #312E81 / #C4B5FD) amber: bg #fde68a / fg #78350f rose: bg #fecdd3 / fg #881337 teal: bg #99f6e4 / fg #134e4a (dark: #134e4a / #99f6e4) ``` ### Typography - Family: `'Inter', system-ui, sans-serif` base; display `'Outfit'` (page titles, call participant name, stat-card values); mono `'JetBrains Mono'` (invite codes, device IDs, keyboard hotkeys, inline stats). - Scale: - Page title (`Freunde`, `Admin`, `Einstellungen`, call participant): 28px (page) / 24px (call) / 700 / Outfit / letter-spacing -0.02em - Section label (uppercase eyebrow): 11px / 600 / tracked 0.08em - Body labels, chat name, friend name: 14–15px / 600 - Body text, bubbles, settings hint: 12–14px / 400–500 - Meta, timestamps, handles, stat labels: 11–12px / 500, uppercase 10–11px tracked 0.06em - Mono values: 11–12px / JetBrains Mono / 500 ### Spacing / Radius - Page content max-width: **820px**, centered, 28px top padding, 32px horizontal. - Section card radius 16, section header padded 16×20 with bottom border, section body padded 16×20 gap 14. - Button radius 8–10, chip/pill 999, stat card 12, device card 12. - Toggle switch: 40×22 with 16×16 thumb, 2px inset, transitions all 0.2s. ### Shadows - Elevated card light: `0 20px 60px rgba(0,0,0,0.1)` - Elevated card dark: `0 20px 60px rgba(0,0,0,0.5)` - Accent button: `0 4px 14px rgba(79,70,229,0.25)` - Avatar-large glow: `0 2px 6px rgba(0,0,0,0.08)` ### Motion - Standard UI transition: `all 0.15s` - Toggle switch thumb: `transform 0.2s` - PTT hotkey capture pulse: `keyPulse 1.2s ease-in-out infinite` (opacity 1↔0.6) --- ## Tab Switching Behavior The icon rail (`.icon-rail`) holds 4 primary tabs: **Chats**, **Friends**, **Admin**, **Settings**. Clicking an icon sets `activeTab`. Layout adapts: - **`activeTab === 'chats'`** → renders icon-rail + chat-list + chat-area (3 columns: `64px 280px 1fr`). - **`activeTab !== 'chats'`** → renders icon-rail + page content (2 columns: `64px 1fr`). Chat list is removed. The page component (`FriendsPageContent`, `AdminPageContent`, `SettingsPageContent`) renders inside the chat-area slot with its own scroll container and 820px centered inner. The `.rail-layout.page-mode` class toggles the grid-template-columns. **IMPORTANT:** this override is inlined in the entry HTML as a `