Skip to content

feat(add): add --interactive guided prompt mode - #32

Merged
jonas1307 merged 1 commit into
mainfrom
feat/add-interactive
Jul 25, 2026
Merged

feat(add): add --interactive guided prompt mode#32
jonas1307 merged 1 commit into
mainfrom
feat/add-interactive

Conversation

@jonas1307

Copy link
Copy Markdown
Owner

add --interactive: guided prompt mode

Adds an -i/--interactive flag to add that prompts for each field instead of requiring flags, reusing the prompt UX from the interactive command.

Behavior

  • Prompts for date (default today), start hour (default 09:00), work item, duration, activity type (picked from the cached list), and an optional comment.
  • The collected values run through the same AddValidator and submit path as the flag-based flow — one source of truth for validation.
  • Works with --dry-run (prompts, then previews without submitting).

Supporting changes

  • --work-item, --length, and --type are no longer marked Required by the parser (so add --interactive alone parses); their presence is enforced by AddValidator.
  • ValidationUtils.ValidType is now null-safe, so a missing --type in the flag-based flow fails validation with a clear message instead of throwing.

Tests (98 total, +3)

  • ValidType null/empty cases.
  • AddValidator rejects a missing activity type.
  • Verified via smoke test: add with 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 SelectionPrompt uses arrow keys), so the prompt flow was not exercised headlessly; it falls through to the covered validate/submit path.

Closes #25

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.
@jonas1307
jonas1307 merged commit 2cefc7e into main Jul 25, 2026
1 check passed
@jonas1307
jonas1307 deleted the feat/add-interactive branch July 25, 2026 04:39
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.

add --interactive: guided prompt mode

1 participant