Skip to content

feat: back-navigation for the free-text input dialog (InputRequest.AllowBack)#9

Merged
ThatRendle merged 5 commits into
mainfrom
change/back-nav-input
May 31, 2026
Merged

feat: back-navigation for the free-text input dialog (InputRequest.AllowBack)#9
ThatRendle merged 5 commits into
mainfrom
change/back-nav-input

Conversation

@ThatRendle
Copy link
Copy Markdown
Contributor

Why

InputRequest was the only awaitable-dialog request type still missing AllowBackSelectRequest, ChoiceRequest, and MultiSelectRequest all expose it (multi-select shipped in rc.3). This blocked wizard flows that interleave text entry with selection: a consumer could let the user step back through select/choice steps, but the flow hit a dead end on any InputAsync step.

What changed

  • InputRequest.AllowBack (opt-in, default false) on the primary ctor and the Line? / string? / IReadOnlyList<string>? convenience overloads. The params-tail overloads keep their signature (params must be last) and document that they can't carry it — mirrors MultiSelectRequest.
  • InputDialog raises OverlayCloseKind.Back when AllowBack=true and Backspace is pressed while the buffer is currently empty — gated on live buffer length, not edit history, so typing then deleting back to empty still arms Back. Backspace with text present deletes normally; Ctrl+Backspace never triggers Back; [ stays a literal character (deliberately not a Back key for free-text input).
  • Threaded AllowBack through Terminal.InputAsync. OpenModalAsync already maps OverlayCloseKind.Back → DialogOutcome.Back, so no plumbing below the dialog.
  • Refreshed the now-accurate DialogOutcome.Back XML docs to enumerate all four producers and each trigger.
  • Bumped Dcli and Dcli.Testing to 0.2.0-rc.4 (lockstep, per prior packaging sections).

The unifying family rule: Backspace when there's nothing left to delete → Back.

Spec

Modifies the fixed-region Awaitable modal dialogs requirement (synced to openspec/specs/fixed-region/spec.md) and adds four Input scenarios. Change archived at openspec/changes/archive/2026-05-31-back-nav-input/.

Verification

  • dotnet build — 0 warnings / 0 errors (warnings-as-errors)
  • dotnet test866 passing (10 new: §2.1 ctor defaults/settable, §2.2–2.6 dialog behaviour incl. the type→delete→empty discrimination guard)
  • dotnet format --verify-no-changes — clean
  • openspec validate --strict — valid
  • dcli.0.2.0-rc.4.nupkg packs cleanly

Backward compatible: AllowBack defaults to false everywhere; existing callers recompile unchanged. No human-in-the-loop terminal verification implicated (pure decoded-key handling).

🤖 Generated with Claude Code

ThatRendle and others added 5 commits May 31, 2026 13:25
Propose InputRequest.AllowBack with Backspace-on-empty Back trigger,
modifying the fixed-region "Awaitable modal dialogs" requirement.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
- 1.1 Add bool AllowBack=false to InputRequest primary ctor and the
  Line?/string?/IReadOnlyList<string>? convenience overloads (params-tail
  overloads documented as unable to carry it)
- 1.2 Thread allowBack through InputDialog ctor and Terminal.InputAsync
- 1.3 Backspace-on-empty raises OverlayCloseKind.Back when AllowBack=true;
  Backspace with text deletes normally; Ctrl+Backspace unaffected
- 1.4 Refresh DialogOutcome.Back XML docs to list all four producers/triggers

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ty (section 2)

- 2.1 InputRequest.AllowBack default false + settable on each non-params overload
- 2.2 AllowBack + empty + Backspace → Back, empty value
- 2.3 type-then-delete-to-empty then Backspace → Back (current-emptiness, not _userEdited)
- 2.4 Backspace with text deletes one char, dialog stays open
- 2.5 AllowBack=false Backspace-on-empty is a no-op
- 2.6 '[' inserts literally, no Back binding for input

Co-Authored-By: Claude Opus 4.8 <[email protected]>
- 3.1 Bump Dcli and Dcli.Testing to 0.2.0-rc.4 (lockstep, per prior packaging sections)
- 3.2 Gates green: build (0/0), test (866), format clean, openspec validate --strict;
  dcli.0.2.0-rc.4.nupkg packs cleanly

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Sync the "Awaitable modal dialogs" MODIFIED requirement (InputRequest.AllowBack
+ Backspace-on-empty Back trigger and scenarios) into the main fixed-region spec,
and move the change to openspec/changes/archive/2026-05-31-back-nav-input/.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@ThatRendle ThatRendle merged commit 40da6b1 into main May 31, 2026
3 checks passed
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