8000 feat(send): Esc takes back the message waiting in Undo Send by fsoft72 · Pull Request #607 · hyprlab/hylki · GitHub
[go: up one dir, main page]

Skip to content

feat(send): Esc takes back the message waiting in Undo Send - #607

Open
fsoft72 wants to merge 2 commits into
hyprlab:mainfrom
fsoft72:pr/esc-undo-send
Open

fsoft72 wants to merge 2 commits into
hyprlab:mainfrom
fsoft72:pr/esc-undo-send

Conversation

@fsoft72
@fsoft72 fsoft72 commented Nov 6, 2026
Copy link
Copy Markdown
Contributor

What

While a message waits out its Undo Send delay, Esc now does the same as Undo.

  • With a message waiting, Esc (outside a text field) brings the most recent one back to its composer.
  • With none waiting, Esc keeps its old meaning: back to the message list.
  • A text field or composer keeps Esc for itself.

Why

Esc is the natural key to back out of a send, but it did nothing for it. Pressing it once also closed the Undo toast without undoing, so the message still went out.

How

  • AdwToastOverlay closes the toast on the first Esc before the window sees the key. The toast's dismissed signal now sends AppMsg::UndoSend. This is a no-op once the message was dispatched or undone, because both take it off the held list before dismissing the toast.
  • A new AppMsg::EscapeKey covers the case where Esc reaches the window instead of the toast: it undoes the latest held send, else falls back to Shortcut::BackToList. It is separate from BackToList because h, Left and u share that shortcut and should not undo a send.
  • docs/DOCUMENTATION.md (Undo Send) mentions the key.

Testing

cargo check passes. Tried by hand: one Esc during the countdown brings the message back to the composer.

🤖 Generated with Claude Code

hyprlab added a commit that referenced this pull request Nov 6, 2026
The toast overlay binds Escape, so one press closed the notice and the message still went. The key is now caught ahead of the overlay, which leaves the notice's close button hiding the notice only.

Co-Authored-By: Fabio Rotondo <2844375+fsoft72@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0