Commit 006d420
Code mode: file tree with responsive collapse (#570)
* docs(spec): code-mode file tree (VS Code style, lg+ responsive)
Adds a file tree on the left of the Code-mode tab strip at lg+, with all
files pre-opened as tabs, tree-click activates existing tab or opens new,
close X on tabs, no cross-capability persistence, collapse persisted via
localStorage. No new deps; pure presentational FileTree + state moved
into CodeMode.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs(plan): code-mode file tree implementation plan
8 tasks: land prerequisite prose/padding work, buildTree utility (TDD),
CodeMode state migration to openPaths+activePath, FileTree component (TDD),
lg: responsive split + tree-click integration, tab close (×) + last-tab
empty state, collapse toggle with localStorage, full verification.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(cockpit): unified prose width modifiers + code-mode padding wrapper
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(cockpit): add buildTree utility for Code-mode file tree
Pure function that converts flat file paths into a compact tree with
VS-Code-style single-child folder merging and namespace-prefix peeling.
All 6 unit tests green.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(cockpit): tighten buildTree test assertions and normalize path slashes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor(cockpit): controlled openPaths + activePath state in CodeMode
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(cockpit): FileTree component with folder collapse and active row
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(cockpit): file row click target + ellipsis label + drop role=tree
Wrap file label in <span data-file-label> for text-overflow to work on
flex children; move chip inside the button so clicking it fires onSelect;
remove role="tree" from the outer <ul> (no treeitem/group/arrow-key
support). Update both spec assertions to query [data-file-label].
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(cockpit): mount FileTree in Code mode with lg: responsive split
Places the FileTree to the left of the tab strip at lg:+ widths, hidden below. Wires onSelect to openPaths/activePath handlers so tree-clicks activate existing tabs or open and activate new ones.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(cockpit): file-tree aside opacity + remove dead file-row CSS rule
* feat(cockpit): tab close button + last-tab empty state in Code mode
Adds × close affordance on each Code-mode tab (visible on hover / active tab).
Closing a tab removes it from openPaths, activates the left neighbor (or new
leftmost if first was closed), and shows a "Select a file from the tree to
begin." empty state when all tabs are closed. TDD: 2 new passing tests; 6
pre-existing tests updated to strip × from textContent comparisons.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(cockpit): gate Tabs on open count + keyboard-accessible tab close
- Render <Tabs> only when openPaths.length > 0 and activePath !== null; show
empty-state as the exclusive alternative (eliminates Radix controlled→uncontrolled
warning on last-tab-close).
- value={activePath} without ?? undefined inside the guarded branch.
- Add tabIndex={0} and onKeyDown (Enter/Space) to close <span> for a11y.
- Remove unreachable ?? next[0] fallback in handleClose.
- Hoist getTabLabel(path) to a single const per map iteration.
- Add keyboard-close test (9 total in code-mode.spec.tsx).
* feat(cockpit): persistent collapse toggle for Code-mode file tree
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(cockpit): suppress collapse animation on hydration + flex layout for smooth transition
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a3a9420 commit 006d420
10 files changed
Lines changed: 2011 additions & 48 deletions
File tree
- apps/cockpit/src
- app
- components
- api-mode
- code-mode
- docs/superpowers
- plans
- specs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| 216 | + | |
| 217 | + | |
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| |||
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
| 133 | + | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
Lines changed: 168 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
122 | 287 | | |
123 | 288 | | |
124 | 289 | | |
| |||
0 commit comments