feat(tui): add Alt+S input stash/recall hotkey (#1438)#1572
Conversation
|
Thanks for picking this up — the shape is right and the diff is small. Three things I'd want fixed before merging, plus a couple of small notes. 1. Doesn't match the issue spec — current input silently disappears (blocker) #1438 says: "if message has been stashed, exchange stash and input". The PR doesn't exchange — when the input is non-empty and the stash already has content, the current input is dropped and replaced by the stash: } else { // input.length > 0
if (stashRef.current) {
setInput(stashRef.current); // current input is lost
stashRef.current = "";
...This is the deviation noted in your PR description ("current input is replaced by the stash"). It means an accidental Alt+S in the middle of a half-typed message destroys the message without any recovery path. The point of a stash register is that one extra Alt+S brings it back. Please make it a true swap: const recalled = stashRef.current;
stashRef.current = input;
setInput(recalled);2. No gating — fires under modals and while busy The handler is placed above
Copy the same guard block that Ctrl+O and the Space-toggle-undo blocks above it use. 3.
Smaller notes
Leaving this open — push a fixup and I'll take another look. |
Empty input + stash exists → recall into input, clear stash. Empty input + no stash → "Nothing to stash" hint. Non-empty input + stash exists → true exchange. Non-empty input + no stash → stash input, clear buffer. Gated behind busy + modal guard. No dead i18n keys.
|
done |
|
Thanks — fixup looks right, swap + gating + dead key all addressed. Merging. |
What
Adds Alt+S hotkey to stash and recall the composer input buffer. Press once to save the current
input, press again on an empty line to recall it. If there's already stashed text, the current input
is replaced by the stash.
Why
Quick temp register — save a half-written message or thought for later without losing it. Closes
#1438.
How to verify
npm run dev(ornpm run build && node dist/cli/index.js)Checklist
npm run verifypasses locally (lint + typecheck + tests — 3 pre-existing web-tools failures,same as main)
Co-Authored-By: Claudetrailer in commitsCHANGELOG.md— release notes are maintainer-written at release time