aboutsummaryrefslogtreecommitdiffstats
path: root/.claude-flow/research.md
diff options
context:
space:
mode:
authorClawd <ai@clawd.bot>2026-02-28 15:21:27 -0800
committerClawd <ai@clawd.bot>2026-02-28 15:21:27 -0800
commita9ae7c65c387bcf144de8df0a13dbbfd7496cc1e (patch)
treee742a76e5638e8564b893584836678dec095fee8 /.claude-flow/research.md
parent4bd42f9c508345391806eb7c5c2ed39863764695 (diff)
Restyle UI with light/dark theme support
- Add light/dark theme toggle with localStorage persistence - Add 'Claude Flow' wordmark in header - Switch to monospace font (SF Mono, Cascadia Code, etc.) - Update accent colors (lighter blue) - Add theme-aware CodeMirror styling (oneDark vs defaultHighlightStyle) - Update window title to 'Claude Flow' - Refine spacing and visual polish throughout - Add .claude-flow/ artifacts from self-restyling session
Diffstat (limited to '.claude-flow/research.md')
-rw-r--r--.claude-flow/research.md214
1 files changed, 214 insertions, 0 deletions
diff --git a/.claude-flow/research.md b/.claude-flow/research.md
new file mode 100644
index 0000000..30c4832
--- /dev/null
+++ b/.claude-flow/research.md
@@ -0,0 +1,214 @@
1# Research Findings
2
3## Overview
4
5This is an Electron + React + TypeScript app called "Claude Flow" that provides a structured AI-assisted coding workflow (Research → Plan → Implement). The styling is managed through a single monolithic CSS file using CSS custom properties. The current window title is "minimal" (a leftover from the starter template). There is no light/dark mode — only dark. The goal is to: rename the title, add a header wordmark, modernize the UI with a cipherpunk aesthetic (full monospace font, sharper borders, electric-blue accent), and add a text-based light/dark mode toggle.
6
7---
8
9## Architecture
10
11### Tech Stack
12- **Electron 38** — main process, window chrome, IPC
13- **React 19 + Vite** — renderer process
14- **TypeScript** throughout
15- **CodeMirror 6** — markdown editor in DocumentPane
16- **better-sqlite3** — local DB for projects/sessions/messages
17
18### Renderer Structure
19```
20renderer/
21 index.html ← <title>minimal</title> — MUST CHANGE to "Claude Flow"
22 src/
23 main.tsx ← React root mount
24 App.tsx ← Top-level state, layout
25 types.ts ← Shared TS types
26 styles/globals.css ← ALL styling lives here (CSS custom properties)
27 components/
28 Header.tsx ← Top bar: project/session selectors, phase indicator
29 DocumentPane.tsx ← Left pane: CodeMirror editor + ReactMarkdown preview
30 ChatPane.tsx ← Right pane: message list + text input
31 ActionBar.tsx ← Bottom bar: token usage bar, Review/Submit buttons
32```
33
34### Main Process Structure
35```
36src/main/
37 index.ts ← BrowserWindow creation (titleBarStyle: "hiddenInset"), IPC setup
38 preload.ts ← Exposes window.api bridge
39 ipc/handlers.ts
40 db/ ← SQLite schema/queries
41 claude/ ← Claude SDK integration
42```
43
44---
45
46## Relevant Files
47
48| File | Relevance to Task |
49|------|-------------------|
50| `renderer/index.html` | **Line 10**: `<title>minimal</title>` → change to `Claude Flow` |
51| `renderer/src/styles/globals.css` | **All CSS** — CSS custom properties `:root {}` define the entire theme. Single file, ~543 lines |
52| `renderer/src/components/Header.tsx` | Add app wordmark + text theme toggle button (header-right div) |
53| `renderer/src/App.tsx` | Add theme state, persist to localStorage, set `data-theme` on `document.documentElement`, pass props down |
54| `renderer/src/components/DocumentPane.tsx` | Make CodeMirror theme dynamic — swap `oneDark` ↔ `syntaxHighlighting(defaultHighlightStyle)` |
55| `src/main/index.ts` | `titleBarStyle: "hiddenInset"` — macOS frameless, HTML title used in Dock/app switcher |
56
57---
58
59## Key Insights
60
61### 1. Title Change — Two Locations
62The title "minimal" appears in:
63- `renderer/index.html` line 10: `<title>minimal</title>` — the browser/OS-level window title
64- `package.json` line 1: `"name": "minimal-electron-vite-react-better-sqlite"` — package name (lower-priority)
65- `package.json` line 19: `"appId": "com.example.minimalbsqlite"` — build identifier (lower-priority)
66
67**Primary fix**: change `<title>minimal</title>` in `renderer/index.html`.
68
69### 2. Current Color Palette (Dark Only)
70```css
71:root {
72 --bg-primary: #1a1a1a /* near-black background */
73 --bg-secondary: #252525 /* panels, header */
74 --bg-tertiary: #333 /* inputs, code blocks */
75 --border: #444 /* dividers */
76 --text-primary: #e0e0e0 /* main text */
77 --text-secondary:#888 /* muted text, labels */
78 --accent: #3b82f6 /* blue — buttons, links */
79 --accent-hover: #2563eb
80 --success: #10b981 /* green */
81 --warning: #f59e0b /* amber */
82 --danger: #ef4444 /* red */
83}
84```
85No light mode variables exist. The mechanism for light/dark is straightforward: add `html[data-theme="light"]` overrides.
86
87### 3. Light/Dark Mode — Implementation Path
88**Theme storage**: `localStorage` — persist across sessions
89**Toggle mechanism**: Set `data-theme="light"` or `data-theme="dark"` on `document.documentElement`
90**CSS**: Override variables under `html[data-theme="light"]` selector
91**State**: `useState` + `useEffect` in `App.tsx` — no Context needed, just pass `theme` + `onToggleTheme` as props
92**Toggle style**: Text-only, bracket notation: `[dark]` / `[light]` — fits the cipherpunk chrome feel
93
94The `Header` will receive `theme: "dark" | "light"` and `onToggleTheme: () => void` as new props.
95
96**CodeMirror — RESOLVED (no new packages needed)**:
97`@codemirror/language` is already installed as a transitive dependency and exports both `defaultHighlightStyle` and `syntaxHighlighting`. The `defaultHighlightStyle` provides a full light-mode syntax highlighting scheme (keywords in purple, strings in red, literals in green, etc.) — identical coverage to `oneDark`, just different colors.
98
99Strategy:
100- **Dark** → use `[oneDark]` as today
101- **Light** → use `[syntaxHighlighting(defaultHighlightStyle)]` from `@codemirror/language`
102
103`DocumentPane` will receive a `theme` prop. The CodeMirror `useEffect` dependency array will include `theme` (alongside the existing `disabled`) so the editor reinitializes with the correct extension set when the theme changes.
104
105### 4. Accent Color — RESOLVED
106
107**Keep blue, go more electric. No green/cyan.**
108
109The cipherpunk feel will come from sharpness and monospace typography — not a color gimmick.
110
111Proposed accent colors:
112```
113Dark mode: #60a5fa (bright electric blue — more vivid than current #3b82f6)
114 hover: #93c5fd
115Light mode: #2563eb (deeper blue — maintains contrast on light backgrounds)
116 hover: #1d4ed8
117```
118
119### 5. Font — RESOLVED: Full Monospace
120
121Apply a monospace font stack to `body` — the entire UI goes mono. The codebase already uses this stack for code blocks, so extending it to the whole UI creates a unified terminal aesthetic without importing any font files.
122
123```css
124body {
125 font-family: "SF Mono", "Cascadia Code", "JetBrains Mono", "Fira Code", Monaco, "Courier New", monospace;
126}
127```
128
129### 6. Header Wordmark — RESOLVED: Yes, Add It
130
131Add a styled `<span className="app-wordmark">CLAUDE FLOW</span>` as the **first element** inside `.header-left`, before the project dropdown. Separated from the controls by a subtle right border.
132
133```css
134.app-wordmark {
135 font-size: 13px;
136 font-weight: 700;
137 letter-spacing: 0.15em;
138 text-transform: uppercase;
139 color: var(--text-primary);
140 padding-right: 12px;
141 border-right: 1px solid var(--border);
142 margin-right: 4px;
143 user-select: none;
144 white-space: nowrap;
145}
146```
147
148### 7. Other Cipherpunk Touches — All CSS-Only
149
150- **Sharper borders**: reduce `border-radius` from 4–8px → **2px** on all controls (buttons, inputs, messages, badges). Phase steps → 2px. Chat messages → 4px.
151- **Uppercase meta labels**: `text-transform: uppercase; letter-spacing: 0.07em` on `.token-label`, `.phase-step`, `.document-header span`, `.badge`, `.implementing-status`
152- **Subtle focus glow**: `box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3)` on focused inputs and buttons
153- **Phase brackets**: Phase step text to be updated in `Header.tsx` JSX: `[Research]` → `[RESEARCH]` etc., with CSS uppercase doing the work so the component just renders the labels naturally
154
155### 8. Light Mode Color Palette (Proposed)
156
157```css
158html[data-theme="light"] {
159 --bg-primary: #f4f4f2; /* warm off-white — not stark, feels terminal-adjacent */
160 --bg-secondary: #e8e8e5; /* panels, header */
161 --bg-tertiary: #d8d8d4; /* inputs, code blocks */
162 --border: #b4b4b0; /* dividers */
163 --text-primary: #1a1a18; /* near-black */
164 --text-secondary:#5a5a56; /* muted */
165 --accent: #2563eb; /* deep blue */
166 --accent-hover: #1d4ed8;
167 --success: #059669;
168 --warning: #d97706;
169 --danger: #dc2626;
170}
171```
172
173Warm stone tones rather than pure white — keeps the app from feeling like a generic SaaS product.
174
175### 9. No Existing Theme Infrastructure
176There is currently **no ThemeContext, no localStorage usage, no `data-theme` attribute**. Fully greenfield. Simple prop-passing from `App.tsx` is sufficient.
177
178### 10. Window Styling Note
179- **macOS** (`titleBarStyle: "hiddenInset"`): traffic lights appear, no visible title text in window frame. HTML `<title>` shows in Dock tooltip and app switcher.
180- **Linux/Windows**: default Electron title bar shows `<title>` in window chrome. Critical to fix.
181
182---
183
184## Resolved Decisions
185
186| Question | Decision |
187|----------|----------|
188| Accent color | Electric blue: `#60a5fa` (dark) / `#2563eb` (light). No green/cyan. |
189| CodeMirror light theme | `syntaxHighlighting(defaultHighlightStyle)` from already-installed `@codemirror/language`. Zero new packages. |
190| Font scope | **Full mono** — `body` font-family. Entire UI uses monospace stack. |
191| Header wordmark | **Yes** — `CLAUDE FLOW` in `.header-left`, uppercase + letter-spacing + right-border separator |
192| Theme toggle style | **Text toggle**: `[dark]` / `[light]` bracket notation |
193
194---
195
196## Proposed Change Scope
197
198| Change | File(s) | Effort |
199|--------|---------|--------|
200| Fix `<title>` | `renderer/index.html` | Trivial |
201| Apply monospace body font | `globals.css` | Trivial |
202| Sharpen border-radius across all controls | `globals.css` | Small |
203| Uppercase + letter-spacing on meta labels | `globals.css` | Small |
204| Brighter dark-mode accent (#60a5fa) | `globals.css` | Trivial |
205| Add `html[data-theme="light"]` color block | `globals.css` | Small |
206| Add focus glow styles | `globals.css` | Small |
207| Add `.app-wordmark` styles | `globals.css` | Trivial |
208| Add `[dark]`/`[light]` toggle button styles | `globals.css` | Trivial |
209| Add theme state + `localStorage` init | `App.tsx` | Small |
210| Pass `theme` + `onToggleTheme` props to Header | `App.tsx` → `Header.tsx` | Small |
211| Pass `theme` prop to DocumentPane | `App.tsx` → `DocumentPane.tsx` | Small |
212| Add `CLAUDE FLOW` wordmark element | `Header.tsx` | Trivial |
213| Add `[dark]`/`[light]` toggle button | `Header.tsx` | Small |
214| Make CodeMirror theme dynamic | `DocumentPane.tsx` | Small |