返回 CodeWhale
TUI_REDESIGN.md
根目录 / docs / design / TUI_REDESIGN.md
1 # TUI redesign — ocean depth / Workbench index
2
3 ## Overview
4
5 Fresh 0.10.0 terminal installs use **Underwater**, the restrained navy ombré.
6 Shoreline remains the warm charcoal alternative; saved theme choices are
7 preserved. `/theme` previews either treatment, Enter saves, and Escape restores
8 the previous choice. The same layout, whale mark and information hierarchy
9 serve both themes; the ocean is a continuous background, not extra chrome.
10
11 Shoreline is the terminal's warm charcoal, ivory and blue visual system,
12 introduced on 2026-09-15 to bring the TUI closer to the GPUI product client.
13 The 2026-09-19 Workbench index pass organizes that system around the next
14 useful action: start work, resume a session, or inspect connected tools.
15 The founder delegated the visual direction and explicitly allowed replacing
16 the previous appearance when it improved the experience.
17
18 The launch screen centers the canonical braille whale beside the codewhale
19 wordmark, build version, workspace and branch. The mark grows with the space
20 left after the controls fit. New session, recent work and setup actions use
21 tonal rows below the identity. The full-width composer uses the same input
22 and permission handling as the conversation.
23
24 This document describes implemented terminal behavior, not the website's
25 Tidal Folio system. Source owns values and actions; this file records how
26 they form a coherent interface.
27
28 ## Colors
29
30 Underwater's continuous water column is authored by `OceanRamp::for_theme` in
31 `crates/tui/src/tui/ocean.rs`: dark navy at the top, deeper near the composer.
32 Its existing motion policy preserves reduced/still modes and semantic surfaces.
33
34 For the charcoal alternative, the source of truth is `crates/palette/src/rgb.rs` and the
35 `SHORELINE_UI_THEME` / `SHORELINE_LIGHT_UI_THEME` mappings in
36 `crates/palette/src/themes.rs`. The dark palette is unchanged by the
37 Workbench index pass:
38
39 | Role | Value | Use |
40 | --- | --- | --- |
41 | Field (`surface_bg`) | `#211F23` | Warm charcoal reading surface |
42 | Plate (`panel_bg`, `composer_bg`) | `#2B282E` | Composer and raised surfaces |
43 | Elevated | `#35313A` | Hover and secondary control surfaces |
44 | Chrome (`header_bg`, `footer_bg`) | `#1A181C` | Recessed shell information |
45 | Border | `#49424D` | Quiet boundaries and inactive composer |
46 | Body | `#F2ECE5` | Primary ivory text |
47 | Soft / muted / hint / dim | `#D9D2DC` / `#B0A7B2` / `#9A919F` / `#7E7583` | Secondary information by role |
48 | Action / selection background | `#67B8D6` / `#2C4654` | Affordances and focused rows |
49 | Live | `#7FD6C6` | Live activity |
50 | Human | `#F6C453` | Human input and decisions |
51 | Warning / danger / success | `#F0A868` / `#FF8FA8` / `#A3D977` | Semantic state |
52 | Mode ramp | `#7EB4E8` / `#B9DCEC` / `#AD88FF` / `#FF70A0` | Existing mode distinctions |
53
54 Shoreline Light uses warm paper (`#F5F0E9` field) and blue action
55 (`#006684`); its full mapping remains in the same source. Neither this pass
56 nor the Shoreline token family re-inks `web/app/tokens.css`.
57
58 **Focus uses selection ink on selection blue.** Bright action blue is an
59 accent, not a background for pale text. Selected labels, affordances and
60 state annotations must remain readable on the selected surface. Failure,
61 permission and availability also retain words or marks; color never supplies
62 their only meaning.
63
64 Theme remapping keeps direct palette calls consistent with the active preset.
65 The mode ramp remains distinct from the action lane so semantic remapping
66 continues to work in reduced-color terminals. Contrast audits are
67 role-specific: the existing audit requires 4.5:1 for its primary text pairs
68 and 3:1 for hint/dim/status/diff pairs. A passing theme audit is not proof
69 that an arbitrary component foreground/background combination is safe.
70
71 ## Typography
72
73 The terminal host owns the font, size and rasterization. There is no separate
74 application display face. Hierarchy comes from bold identity and selection,
75 regular body text, secondary metadata, and spacing between groups.
76
77 Home shows session titles and age; message counts stay in session details.
78 An empty workspace omits the Recent section. Titles take priority over age. Width calculations
79 and truncation use terminal display cells, including wide characters; omit
80 metadata before reducing a useful title to a stub. Longer labels receive an
81 explicit truncation marker rather than silently running under a border.
82
83 ## Layout
84
85 The home screen is the transcript's launch empty state, implemented by
86 `underwater::launch_empty_state`. The collapsed action lane is capped at 60
87 text cells and expands to 72 for recent work or notices. A two-cell gutter
88 marks keyboard selection where space permits. The build version sits beside
89 the wordmark and can use open space to the right of the action lane to show
90 the full stamp. The workspace caption includes the branch when available.
91
92 Recent expands to show session titles and ages. Connectors reports its
93 configured count or required-connection problems and opens `/mcp`. Skills
94 opens the local inventory at `/skills`, including when it is empty. A first
95 run that needs a model connection offers Connect a model. The menu gives
96 up spacing, optional details and then older recent rows as the pane shrinks.
97 An overflow row keeps hidden sessions reachable while space allows it.
98 Keyboard and mouse navigation follow the actions that fit on screen.
99
100 Shared full-screen settings geometry lives in `views::render_underwater_surface`.
101 At fewer than 24 rows it removes outer vertical margins and top padding;
102 bottom padding is zero. Horizontal outer margins disappear below 44 columns.
103 These are shared layout decisions, not separate compact implementations for
104 each settings page. Config's option editor only expands its header when
105 three choices plus detail still fit. Model/Thinking panes stack when narrow;
106 in short stacked layouts the inactive pane becomes one clickable summary
107 and the focused pane receives the remaining space.
108
109 **Keep the two footer owners until their interactions migrate together.**
110 The posture/activity row in `phase_strip` carries permissions, mode, work
111 navigation and transient state. The metrics row in `ui/frame.rs` carries
112 route, model, context and cost information with its own user configuration
113 and pointer targets. A one-row merge was an earlier proposal, not the
114 implemented design. Hiding metrics would remove model/context interactions
115 unless their measured targets and configuration migrated in the same slice.
116 The Workbench index deliberately retains both rows and their shedding rules.
117
118 ## Elevation & Depth
119
120 The terminal uses tonal surfaces and cell borders. The composer is a plate
121 above the field; an inactive outline recedes without making the input vanish.
122 Full-screen settings use restrained top and bottom rules. Protected-focus
123 modals retain the existing terminal-cell shadow and border treatment.
124 There are no new glow, blur, texture or decorative motion effects.
125
126 ## Shapes
127
128 Actions are measured rows and rectangular controls sized in terminal cells.
129 Their painted area is their pointer target. Home actions share a leading
130 marker, keyboard selection uses a continuous filled band and bold text,
131 and hover uses the elevated surface with an underline. New session has a
132 quiet plate fill before focus; Recent's trailing rule separates the list
133 without enclosing each session in a box. Pointer hover does
134 not silently move keyboard selection. Borders and glyphs use the terminal's
135 existing vocabulary, including its reduced-capability fallbacks.
136
137 ## Components
138
139 ### Home and composer
140
141 Typing begins through the existing composer. Up/Down and Enter navigate and
142 activate visible home rows; clicking a recent row enters the same resume
143 flow. The MCP summary opens the existing manager by mouse or keyboard. A
144 problem row inserts its stated remedy into the composer so the user can see
145 it before submission. No separate command or session authority is introduced.
146
147 The composer keeps its theme’s input surface against the surrounding water.
148 Its bold accent prompt marks keyboard focus. Moving to a home action dims the
149 prompt. The default outline uses the theme border. An explicit chat `/color`
150 still marks the focused outline, and a live turn retains its activity cue.
151 Send appears when a draft or queued message is ready. The footer owns
152 permission, mode and model information.
153
154 ### Resume confirmation
155
156 Resuming names the target session and explicitly states that its history
157 replaces the current context. Warning and button space are reserved before
158 the title and metadata; long titles truncate to one line and cannot push the
159 consequence under a button. Both Resume and Cancel are real mouse targets.
160 Tab, BackTab or Left/Right switches selection; Enter activates the selected
161 button and its visible hint moves with selection. Escape always cancels.
162 An outside click dismisses and never confirms.
163
164 Successful restoration announces the sanitized session title through a
165 localized success toast, using the existing status-toast owner. The string
166 is supplied in all 15 locale packs. It no longer appends a filesystem path,
167 session ID and message-count receipt to the restored transcript, so compact
168 terminals return their space to the conversation.
169
170 ### Settings and pickers
171
172 - **Models:** one provider context row retains catalog freshness without a
173 duplicate route banner. Only the focused pane receives the filled blue
174 selection; the inactive pane retains its current-choice marker. Hover
175 covers the measured row. Compact hints prioritize browsing, searching,
176 switching, applying and canceling; secondary bindings remain available.
177 - **Providers:** ordinary management uses the full-screen shell regardless
178 of configured-provider count. Initial setup, credentials and consent keep
179 their modal flows. The borderless inspector shares the list's canvas and
180 keeps provider identity, credential source, route, endpoint, concise warning
181 lines and consent facts ahead of model choices and prices. The underlined,
182 clickable Open details action and shared Alt+V shortcut (⌥V on macOS)
183 open the existing scrollable pager. That projection retains every warning
184 and the full protocol/capability diagnostics rather than crowding them into
185 the overview. Escape returns to the provider manager.
186 - **Provider choice stages:** Kimi plan tier, Stepfun billing route, xAI auth
187 and ChatGPT auth choices use wrapping, measured selectable rows. A first
188 click selects through the existing key action; a second click activates
189 through the existing Enter action. This does not change billing, consent
190 or credential policy. Key entry, custom-provider text fields and final
191 credential/consent confirmations retain their existing keyboard behavior.
192 - **Extensions:** tabs and inventory rows share selection and independent
193 hover styles. Plugins initially selects the first actual item when one
194 exists; group headings remain reachable for folding. Inventory rows carry
195 identity and state, while the selected description/details have a separate
196 wrapping area of three rows when space permits, one otherwise. Resize
197 clears stale hitboxes before an invisible panel can retain actions. Trust,
198 enablement and removal continue through existing guarded flows.
199 - **Fleet:** the compact roster header has a genuine Workers destination,
200 reachable by mouse and the existing keyboard action. The decorative Setup
201 pseudo-tab is gone. Setup/edit belongs to the selected real member; the
202 display-only Coordinator does not advertise an Enter action it cannot run.
203 Navigation rows preserve identity, role, shadow and edit markers, adding
204 route text only for explicit overrides. Repeated inherited-route sentences
205 and species mosaics no longer tax every row; the selected inspector retains
206 full member identity, route and detail with quiet inline property labels.
207 - **Config:** category tabs and Apply use the shared selection treatment.
208 Selected row annotations inherit readable selection ink instead of keeping
209 dim or action-colored text over the selection band.
210
211 ### Camera readability and evidence
212
213 The founder's acceptance criterion includes pictures and video: recognizable
214 identity, clear hierarchy when reduced, stable composition during interaction,
215 and consistent state colors. The compact wordmark, repeated action gutter
216 and shared selection treatment serve that criterion. Extra ornament is not
217 evidence of camera readability.
218
219 The validation set is 40×12, 60×16, 80×24, 100×32 and 140×40: populated home,
220 MCP failure, selection, resumed conversation, long-title confirmation and
221 Cancel selected, plus representative settings surfaces and provider details.
222 Use fresh evidence for the exact source/binary being delivered; earlier
223 captures do not qualify a later presentation slice. The capture method
224 reconstructs actual PTY cells and their RGB/SGR state with Menlo and Apple
225 Color Emoji fallback. These images are not screenshots of the host terminal
226 and do not prove host font behavior. Static frames do not prove motion,
227 transition timing or video quality.
228
229 The saved conversation and failing MCP server in this evidence are synthetic
230 local fixtures, not customer sessions or working-provider claims. Passing
231 interaction tests demonstrates those tested paths; it does not establish
232 provider success, installation, hosted CI, publication or whole-release
233 readiness. Symbol-only goldens cannot validate color. Use color-preserving
234 PTY evidence and the contrast audit alongside layout/interaction checks;
235 record exact build and installation receipts separately.
236
237 ## Do's and Don'ts
238
239 - **Do** preserve useful content before spacing, branding and secondary hints.
240 - **Do** share geometry between painting and input, and clear targets on resize.
241 - **Do** keep keyboard selection, pointer hover and consequential state distinct.
242 - **Do** reserve consequence text before decorative or variable-length content.
243 - **Do** check long titles, wide characters, compact choices and selected text
244 on the surface where users actually read them.
245 - **Don't** restore a large launch mark at the expense of session-title width.
246 - **Don't** hide footer owners or turn decorative labels into apparent controls.
247 - **Don't** invent new tokens, runtime owners or permissive mutation paths to
248 implement a visual treatment.
249 - **Don't** describe reconstructed cells as host screenshots or static captures
250 as motion proof, and don't imply every settings subview gained mouse parity.
251
252
253 ## Working-screen performance readings (2026-09-20)
254
255 TTFT and output rate reuse the existing session accumulator. The compact footer
256 keeps selected performance readings when they fit, shedding secondary counts
257 and help first. `/statusline` offers separate Time to first token and Output
258 rate controls with immediate preview, Enter to save and Esc to restore. Old
259 `session_metrics` settings continue to enable both and become separate choices
260 when edited. Full, compact and hidden row settings remain in `/config`.
261
262 The motion focal point remains the shared activity marker: request progress,
263 verification and completion use one cadence and the existing bounded completion
264 settle. Numbers stay still between measured receipts, preserving legibility on
265 video. There is no synthetic live speed counter, new timer or extra footer row.
266 Reduced and still motion retain the same readings and explicit phase words.
267 TTFT is a session average; throughput includes first-token wait and stream
268 pauses, but excludes tool/idle gaps. Missing measurements stay absent.
269
270
271 ## Identity, theme and motion refinement (2026-09-20)
272
273 Claude Fable 5.1 reviewed real terminal-cell captures and current motion source.
274 The founder explicitly chose a brief whale reveal: the canonical braille mark
275 resolves through nested dot masks over 360 ms, once from its first launch paint.
276 Text and controls are complete immediately. Typing, paste or resize settles the
277 mark; reduced/still motion shows the complete asset immediately. This reuses the
278 existing frame scheduler and requests no reveal frames after the endpoint.
279
280 Completion keeps the word Done stable while its existing glyph settles. Generic
281 working status uses a direct verb. The send control uses action ink only when the
282 same predicate used by its click handler permits submission; otherwise it is dim.
283 Locked model rows retain readable keyboard focus and their availability warning.
284 New session uses body ink on its filled plate to meet text contrast in light and
285 warm themes. Uwu now participates in the same remapping as other named presets.
286
287 Themes are being checked against five color families: surface, neutral text,
288 action, live/outcome, and attention/danger. Shades preserve contrast and severity;
289 labels and symbols retain meaning without color. Underwater keeps its ambient
290 identity within the same chrome discipline. Nonempty NO_COLOR selects monochrome
291 output: terminal-owned foreground, background, and underline colors, preserving
292 text modifiers and selection symbols. ANSI16 remains a distinct colored fallback
293 for terminals with a limited palette.
294
294 lines MARKDOWN