Edit queued messages with Vim history-up (#38907)

## What changed

- When the composer is empty in Vim normal mode, make the configured history-up binding restore the latest queued follow-up for editing.
- Remove the restored message from the queue so submitting the edited version replaces it instead of creating a duplicate.
- Preserve normal history navigation when the composer has text or a popup is active, and honor remapped Vim bindings.

## Testing

- Add TUI tests covering repeated edit-and-requeue cycles and a remapped history-up binding.

GitOrigin-RevId: 0b04dd964d3fc6fdcd10712aa4d5fd81cbbd2255
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-08-16 21:48:41 +00:00
1 parent 6c108912ee
commit 2bc43d516e
4 files changed
+108 -2

No files matched your search

@@ -44,6 +44,11 @@
//! - Persistent cross-session history (text-only; no element ranges or attachments).
//! - Local in-session history (full text + text elements + local/remote image attachments).
//!
//! Before composer history handles Vim-normal history-up, `ChatWidget` restores the latest queued
//! follow-up when the composer is empty and no popup is active. It removes the message from the
//! queue before placing it in the composer, so editing and requeuing it replaces the prior
//! revision instead of creating duplicates.
//!
//! When recalling a local entry, the composer rehydrates text elements and both attachment kinds
//! (local image paths + remote image URLs).
//! When recalling a persistent entry, only the text is restored.
+5 -1
View File
@@ -1222,8 +1222,12 @@ impl BottomPane {
popup_consts::standard_popup_hint_line_for_keymap(&self.keymap.list)
}
pub(crate) fn runtime_keymap(&self) -> &RuntimeKeymap {
&self.keymap
}
pub(crate) fn list_keymap(&self) -> crate::keymap::ListKeymap {
self.keymap.list.clone()
self.runtime_keymap().list.clone()
}
/// Replace one or more active views whose IDs are in `view_ids` with a