Repository navigation
fix: prevent escape from offering to clear an empty input box - #1437
awhite0030 wants to merge 10 commits into
Conversation
nc-review: comments — 1 important, 2 nits@awhite0030 — a few things worth a look, none blocking. The change correctly guards 🟠 important · Five badge SVGs are modified in this PR for no reason related to the bug fix:
These are unrelated, regenerable assets produced by ⚪ nit · The new test only asserts the negative case ( ⚪ nit · The new dep is 🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with |
Description
Brief description of what this PR does
Type of Change
Changeset
pnpm changeset) describing this change for the changelogDocs-only or internal chores need no changeset (or run
pnpm changeset --emptyto note that intentionally).Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist
Root cause: Pressing Escape always showed a "Press escape again to clear" hint even when the input was completely empty and there were no attachments, as there was no check for
input.lengthorattachments.lengthinhandleEscape.Fix: Updated
handleEscapeinsource/components/user-input.tsxto conditionally checkinput.length > 0 || attachments.length > 0before callingsetShowClearMessage(true). Added a test case insource/components/user-input.spec.tsxto verify this behavior.Validation: Ran
pnpm run build,pnpm test:format,pnpm test:lint,pnpm test:types, andpnpm test:knip, which all passed. Ranpnpm test:avain the background and verified all user-input tests passed successfully.Fixes #1430
Fixes #1430