fix(tui): y copies the whole queued prompt; a finished queue edit refocuses the composer

y copied the truncated display row. Saving or discarding a row edit left focus on
the queue pane, so the next Enter re-opened the edit instead of sending.
This commit is contained in:
雷电芽衣 committed 2026-09-29 13:43:56 -04:00
1 parent b840fff80c
commit 0e063e5b02
2 files changed
+56 -9

No files matched your search

@@ -322,6 +322,10 @@ impl ListItem for QueuedPromptEntry {
fn search_text(&self) -> &str {
&self.text
}
fn copy_text(&self) -> String {
self.text.clone()
}
}
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers, MouseEventKind};
@@ -999,6 +1003,13 @@ mod tests {
QueuedPrompt::plain(id, text, QueueEntryKind::Prompt)
}
#[test]
fn y_copies_the_full_multiline_prompt_not_the_display_row() {
let text = "first line of a long prompt\nsecond line\nthird line";
let entry = QueuedPromptEntry::new(&local_prompt(1, text), 1);
assert_eq!(ListItem::copy_text(&entry), text);
}
#[test]
fn reset_auto_show_edge_allows_requeue_after_external_hide() {
let mut pane = QueuePane::new();