feat(add): add --interactive guided prompt mode - #32
Merged
Conversation
Add an -i/--interactive flag that prompts for each field (date, hour, work item, duration, activity type from a list, comment) and runs them through the same AddValidator/submit path. The three previously-required flags become optional so the flag-less flow works; validation now guards a missing type instead of throwing.
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.
add --interactive: guided prompt mode
Adds an
-i/--interactiveflag toaddthat prompts for each field instead of requiring flags, reusing the prompt UX from theinteractivecommand.Behavior
09:00), work item, duration, activity type (picked from the cached list), and an optional comment.AddValidatorand submit path as the flag-based flow — one source of truth for validation.--dry-run(prompts, then previews without submitting).Supporting changes
--work-item,--length, and--typeare no longer markedRequiredby the parser (soadd --interactivealone parses); their presence is enforced byAddValidator.ValidationUtils.ValidTypeis now null-safe, so a missing--typein the flag-based flow fails validation with a clear message instead of throwing.Tests (98 total, +3)
ValidTypenull/empty cases.AddValidatorrejects a missing activity type.addwith no flags now reports the three validation errors gracefully (no parser error, no crash).Note
The interactive prompts themselves need a real TTY (the activity-type
SelectionPromptuses arrow keys), so the prompt flow was not exercised headlessly; it falls through to the covered validate/submit path.Closes #25