Skip to content

fix(tui): wizard Back panic, vanishing errors, lost answers, double hint bar - #80

Open
yutkin wants to merge 1 commit into
mainfrom
claude/fix-tui-wizard-bugs-a7b72a
Open

yutkin wants to merge 1 commit into
mainfrom
claude/fix-tui-wizard-bugs-a7b72a

Conversation

@yutkin

@yutkin yutkin commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The shared wizard code had four bugs and a duplicate hint bar. Real terminal runs of the new verda mk8s wizards exposed them.

Why it matters: two of them panic or hide errors, and every wizard (vm, network, auth, registry, objectstorage, settings, serverless) shares this code.

Bug Cause Fix
Panic on multiselect ← Back (Ctrl+A, or Space on Back, then Enter) Back was a normal checkbox row, and its index was read as a choice Back is an action row with no checkbox. Select-all skips it, Enter on it goes back, and the engine ignores out-of-range indices
Terminal left in raw mode after a wizard panic The prompt program was never stopped on abnormal exit Deferred cleanup stops it
Validation error disappears after about 0.5s Error was cleared on every message, including the cursor blink Clear it only when the typed value changes
Placeholder shows > d instead of default: 90 days bubbles shows one character while width is 0 Empty input gets the placeholder's width
Esc (Back) empties the step you return to rewindOne cleared its answer Keep it as the prompt default. The store value is still cleared and loaders still re-run, so later steps never see a stale value
Two hint bars on screen, saying esc cancel and esc back Seven wizards registered a HintBarView, but the wizard already draws its own bar Remove the extra view (vm, network, auth, registry, objectstorage x2, settings) and fix the doc example that taught it
 compositeModel.View()
   bus views (progress, summary)
-  HintBarView   <- registered per wizard
   composite hint bar

Evidence

  • Before: TestEngine_MultiSelect_BackIndexInResultDoesNotPanic fails with panic: index out of range [1] with length 1.
    After: it passes.
  • Before: the new text input tests fail, and so does the paste test with its fix removed.
    After: they pass.
    • TestTextInputPrompt_ValidationErrorSurvivesNonKeyMessages: the error is still shown after a blink or resize message, and is cleared by typing.
    • TestTextInputPrompt_ShowsFullPlaceholder.
    • TestTextInputPrompt_PasteLongerThanPlaceholderIsNotClipped.
  • Also added:
    • TestMultiSelectModel_BackItem
    • TestEngine_BuildPromptModel_MultiSelectBackIsNotAValue
    • TestEngine_RewindOne_KeepsAnswerAsDefault
    • TestWizardLayoutHasNoExtraHintBar
    • TestBuildCreateFlowHasNoExtraHintBar

make build && make test && make lint && make fix.check all pass. I did not drive a real terminal on main. The mk8s branch showed these bugs live.

Merge Danger

Door: two-way. It is code only, with no data or API changes. Revert the PR to undo it.

Blast Radius: every interactive wizard and text prompt.

  • Back in multiselect: vm create and the serverless container scale wizard are the only multiselect users. Enter on Back now goes back.
  • Esc/Back pre-fill: steps you return to now show your previous answer. Only the step you land on keeps its answer, so steps after it are asked fresh.
  • Layout: settings theme and vm create in template mode now draw no hint bar of their own and no progress view, the same as before minus the duplicate.

🤖 Generated with Claude Code

… lost answers, double hint bar

- multiselect: "← Back" is an action row (no checkbox, skipped by select-all, Enter goes back); engine ignores out-of-range indices; stop the prompt program on abnormal exit
- textinput: clear validation error only when the value changes; show the full placeholder
- wizard: keep the previous answer as the prompt default after going back
- remove the duplicate HintBarView from vm, network, auth, registry, objectstorage and settings wizards

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant