Commit aeaf3a4
authored
refactor(ui): action-first flow with immediate save (#2340)
## Summary
Replaces #2335 (closed). Combines the action-first UI restructure with
immediate save and UX improvements.
### From #2335 (base changes)
- Restructure overview to action-first flow (Create, Reconfigure,
Promote, Quit)
- Grouped bundle selection with detail boxes and environment filters
- Scrollable panels, breadcrumb navigation, keyboard shortcuts
- Cloud login prompt, error dialogs, nested bundle creation
### New in this PR
- **Immediate save**: Reconfigure and Promote save on confirm (like
Create), removing pending changes batch-save entirely
- **Session panel**: Overview shows "Recently Changed" with grouped
bundles, change kind tags, and direct reconfigure
- **Unified input form**: Single list with inline diff — no
Changed/Unchanged section split
- **Immutable inputs**: Blue values, "immutable" tag, cursor skips them
- **Button flow**: Save/Cancel at bottom, Back when no changes
(reconfig); left/right + up/down navigation
- **ESC handling**: Discard confirmation when reconfig has unsaved
changes
- **Registry cleanup**: Removed `ui.Registry` wrapper, use
`*config.Registry` directly
- **Type system fix**: Moved bundle-ref object→alias extraction from
`BundleType.Apply` to UI layer
- **Upfront validation**: `checkBundleRefsResolved()` replaces brittle
string-matching error detection
- **Styling**: Underlined hotkey letters, env tags in breadcrumbs,
last-saved highlight
- **Dead code removed**: view_edit.go, PendingChanges/ProposedChanges,
SavedChange, and many unused fields
## Test plan
- [ ] Create: saves immediately, appears in session panel and
reconfigure list
- [ ] Reconfigure: saves immediately, session panel shows "reconfigured"
tag
- [ ] Promote: saves immediately, bundle appears in target env
- [ ] Session panel: shows only changed envs, dimmed when unfocused,
Enter reconfigures
- [ ] Reconfig form: immutable fields skipped, changed values orange
with diff
- [ ] Reconfig form: cursor returns to edited item, Save/Cancel at
bottom
- [ ] Reconfig form: ESC with changes triggers discard confirmation
- [ ] Promote form: Save always available, ESC goes back without
confirmation
- [ ] Quit exits immediately (no unsaved changes warning)
- [ ] Bundle references resolve correctly after immediate save (nested
bundles)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes core TUI workflow to write bundle instance YAML immediately
(create/reconfigure/promote) and reload the registry in-session, so
mistakes can persist to disk and affect subsequent resolution/filtering.
UI navigation/rendering was substantially reworked, increasing risk of
UX regressions across create/reconfig/promote flows.
>
> **Overview**
> Refactors the TUI to an **action-first flow** and removes the
pending/batch save model: Create/Reconfigure/Promote now **save bundle
instance YAML immediately**, reload the `config.Registry` after each
save, and the overview shows a **“Recently Changed”** session panel that
can jump straight into reconfigure.
>
> Create selection is redesigned into a **flat, sorted bundle list**
with a detail box, and Create adds a **deferred environment picker**
when the chosen bundle requires an environment. Reconfigure/Promote
selection adds **environment-based filtering** (cycle with `e`), richer
detail boxes, and updated breadcrumbs/hotkeys.
>
> `InputsForm` is unified into a single ordered list (no
Changed/Unchanged split) with inline diffs, improved cursor/navigation
(skips immutable/disabled inputs, wraps), and updated button logic
(Save/Cancel; Back when no reconfig changes; ESC discard confirmation
for reconfig). Bundle-ref handling is hardened by normalizing stored
object values back to alias strings, rebinding `bundle()`/`bundles()` to
the live registry during change evaluation, and adding
`checkBundleRefsResolved()` for clearer missing-dependency errors.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
0a8f97f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->15 files changed
Lines changed: 1788 additions & 1638 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | 66 | | |
81 | 67 | | |
82 | 68 | | |
| |||
90 | 76 | | |
91 | 77 | | |
92 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
93 | 85 | | |
94 | 86 | | |
95 | 87 | | |
| |||
102 | 94 | | |
103 | 95 | | |
104 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
105 | 100 | | |
106 | 101 | | |
107 | 102 | | |
| |||
156 | 151 | | |
157 | 152 | | |
158 | 153 | | |
159 | | - | |
| 154 | + | |
160 | 155 | | |
161 | 156 | | |
162 | 157 | | |
| |||
188 | 183 | | |
189 | 184 | | |
190 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
206 | 209 | | |
207 | 210 | | |
208 | 211 | | |
| |||
258 | 261 | | |
259 | 262 | | |
260 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
261 | 269 | | |
262 | 270 | | |
263 | 271 | | |
| |||
273 | 281 | | |
274 | 282 | | |
275 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
276 | 287 | | |
277 | 288 | | |
278 | 289 | | |
| |||
317 | 328 | | |
318 | 329 | | |
319 | 330 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | 331 | | |
363 | 332 | | |
364 | 333 | | |
| |||
415 | 384 | | |
416 | 385 | | |
417 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
418 | 428 | | |
419 | 429 | | |
420 | 430 | | |
| |||
449 | 459 | | |
450 | 460 | | |
451 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
452 | 470 | | |
453 | 471 | | |
454 | 472 | | |
| |||
0 commit comments