-
Notifications
You must be signed in to change notification settings - Fork 38
fix: surface 422 validation error messages from HEY API #365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,6 +237,11 @@ func (p *dateTimePicker) handleKey(msg tea.KeyPressMsg) tea.Cmd { | |
| p.shiftDate(days) | ||
| return nil | ||
| } | ||
| // "-" cannot appear in a YYYY-MM-DD date, so swallow it here | ||
| // instead of letting it through to the text input (hey-cli#368) | ||
| if msg.String() == "-" { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The change also removes the down-arrow date decrement, which is outside the PR's stated scope (only stopping Prompt for AI agents |
||
| return nil | ||
| } | ||
| var cmd tea.Cmd | ||
| p.dateInput, cmd = p.dateInput.Update(msg) | ||
| return cmd | ||
|
|
@@ -263,13 +268,10 @@ func dateStep(msg tea.KeyPressMsg) (days int, stepped bool) { | |
| case tea.KeyUp: | ||
| return 1, true | ||
| case tea.KeyDown: | ||
| return -1, true | ||
| } | ||
| switch msg.String() { | ||
| case "+", "=": | ||
| return 1, true | ||
| case "-": | ||
| return -1, true | ||
| } | ||
| return 0, false | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: The
dateStepdoc comment still says "a + or a - cannot appear in YYYY-MM-DD, so typing one is only ever a step," but-is no longer handled indateStep— it is now swallowed by the newmsg.String() == "-"branch inhandleKey. Update the comment so it doesn't claim-is a step indateStep.Prompt for AI agents