Keep backtrack Esc hint gated on empty composer (#5076)

## Summary
- only prime backtrack and show the ESC hint when the composer is empty
- keep the composer-side ESC hint unchanged when drafts or attachments
exist and cover it with a regression test

Fixes #5030

------
https://chatgpt.com/codex/tasks/task_i_68e95ba59cd8832caec8e72ae2efeb55
This commit is contained in:
Jeremy Rose
2025-10-15 13:57:50 -07:00
committed by GitHub
parent 0016346dfb
commit 9b53a306e3
3 changed files with 48 additions and 15 deletions

View File

@@ -427,8 +427,9 @@ impl App {
tui.frame_requester().schedule_frame();
}
// Esc primes/advances backtracking only in normal (not working) mode
// with an empty composer. In any other state, forward Esc so the
// active UI (e.g. status indicator, modals, popups) handles it.
// with the composer focused and empty. In any other state, forward
// Esc so the active UI (e.g. status indicator, modals, popups)
// handles it.
KeyEvent {
code: KeyCode::Esc,
kind: KeyEventKind::Press | KeyEventKind::Repeat,