Repository navigation
feat(cases): add multiline text buffer with editor/undo and bidirectional step navigation - #21
Merged
Merged
Conversation
…onal step navigation - Implement promptMultilineBuffer with accidental-Enter protection, line numbering, and commands: - :u / :undo - pops the last line entered - :p / :show / :list - displays the current buffer with line numbers - :e / :edit - opens an external editor ($EDITOR/nano/vim/notepad) - :c / :clear - clears the entire buffer - :b / :back / :cancel - retreats to the previous wizard field or step - . or :done - finishes multiline input - Refactor RunCaseWizard into a state machine loop tracking step and startField - Support seamless bidirectional navigation across wizard steps (Step 1-5): - Backtracking from Step 4 lands on Step 3 field 4 (Description) - Backtracking from Step 3 lands on Step 2 field 4 (Entitlement) - Backtracking from Step 5 Review returns to Step 4 Contact details - Add interactive multiline note composition for 'cases comment <case-number>' when note is omitted, with buffer preview and safety confirmation before API submission - Detect interactive TTY in 'cases create' when run with no flags to prompt launching the wizard - Add unit tests for buffer commands, clear/cancel, step back-navigation, comment usage, and non-TTY execution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhances the interactive Support Case Wizard (
myf5 cases create) and case commenting (myf5 cases comment) with a robust multiline text buffer, in-buffer commands (undo, preview, external editor, clear, back), and seamless bidirectional step navigation across all wizard steps.Key Changes
Multiline Text Buffer (
promptMultilineBuffer):.) on a line or:done.[1] >,[2] >, etc. for clear orientation.:u/:undo: Pops and removes the last entered line from the buffer.:p/:show/:list: Displays the current buffer contents formatted with line numbers.:e/:edit: Spawns the user's preferred external editor ($EDITOR,nano,vim, ornotepad) with current buffer contents, seamlessly re-reading edits on exit.:c/:clear: Clears the multiline buffer.:b/:back/:cancel: Exits buffer and returns to the previous field or wizard step.:h/:help/?: Displays buffer command help.Bidirectional Step & Field Navigation:
RunCaseWizardinto a state machine loop trackingstepandstartField.bin Step 5 (Review & Submission) returns to Step 4 to allow editing contact details.Interactive Multiline Commenting:
myf5 cases comment <case-number>is invoked without a note argument in an interactive terminal, launches the multiline buffer for composing notes.Submit this comment to case <case-number>? [y/N]) before making any API request.TTY Auto-Detection for Case Creation:
myf5 cases createwithout flags in a terminal detects interactive TTY and promptsNo case parameters specified. Launch interactive Support Case Wizard? [Y/n]:. Non-interactive calls cleanly print usage.Testing & Security:
:u,:p,:c,:b,:done), bidirectional step transitions, non-TTY execution, and comment usage.go test -v -race ./..., and OAS validator.