[Bug] Escape offers to "clear" an already-empty input box
Description
Pressing Escape always shows a "Press escape again to clear" hint, even when the composer is already empty with no attachments there's nothing to clear.
Parent: #907
Steps to Reproduce
- Start Nanocoder with a fresh, empty composer.
- Press Escape once.
Expected Behavior
Nothing happens, or at least no hint about clearing appears, since there's no content to clear.
Actual Behavior
"Press escape again to clear" appears under the empty composer regardless.
Recording
Root Cause
source/components/user-input.tsx:648-668, handleEscape:
const handleEscape = useCallback(() => {
if (showCompletions) { ... return; }
if (isFileAutocompleteMode) { ... return; }
if (showClearMessage) {
resetInput();
...
} else {
setShowClearMessage(true);
}
}, [...]);
No branch checks whether input (or attachments) is actually non-empty before calling setShowClearMessage(true).
Suggested Fix
Skip showing the clear-hint (and just no-op) when the input is already empty and there are no attachments.
Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate
- [x] I can reproduce this issue consistently
- [x] This issue occurs on the latest
main
hi @akramcodez, could you assign this to me?
Picking this up - a fix will follow shortly.