fix(tui): validate empty input in SecretInput before triggering cancel#1668
Open
notgitika wants to merge 1 commit into
Open
fix(tui): validate empty input in SecretInput before triggering cancel#1668notgitika wants to merge 1 commit into
notgitika wants to merge 1 commit into
Conversation
Previously, pressing Enter with an empty value in SecretInput would call onCancel (which navigates back) even when customValidation rejected empty values. Now validation runs first, showing the error message instead of silently going back. Fixes #1618
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
Contributor
Package TarballHow to installgh release download pr-1668-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.21.1.tgz |
agentcore-cli-automation
approved these changes
Jun 29, 2026
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
Looks good to merge.
Verified the fix:
- Reordering
validateValuesocustomValidationruns before the!valueearly-return is necessary for the new empty-submit path to surface validation errors, and it doesn't change render behavior —showCheckmark/showInvalidMarkare still gated byhasInput, and the error block is still gated byshowError/showInvalidMark. - Existing behavior is preserved: empty Enter with no
customValidationstill falls through toonSkip/onCancel; schema-only validators (which returnundefinedfor empty) are unaffected. - The new test exercises the real component via
ink-testing-library(no excessive mocking) and asserts on both the side effects (callbacks not invoked) and rendered output. - No new feature surface, so no telemetry instrumentation needed.
Contributor
Coverage Report
|
vivdalal
approved these changes
Jun 30, 2026
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.
This PR fixes the "add credential" TUI flow going back to the previous step when pressing Enter with no API key input
Fixes #1618