Add keyboard copy selection to the owned transcript (#50434)

## What changed

- Make `/copy` select the latest completed response directly in the owned transcript. Navigate user messages, code blocks, and blockquotes with arrow keys or `j`/`k`, use `g`/`G` to jump to the ends, and press Enter to copy or Escape to close.
- Highlight selected blocks and keep surrounding context visible during navigation and resizing. Preserve source payloads for code and quotes, including rendered Mermaid diagrams and fenced Markdown tables.
- Pause queued submissions until copy mode closes, and report clipboard results in the transcript footer.

## Testing

Add tests for copy routing, keyboard navigation, highlighting and resize behavior, source whitespace and line endings, clipboard completion, and queued-input resumption.

GitOrigin-RevId: bd4f58ec17568f95d0e91014e5ddba33ca8bd57c
This commit is contained in:
Benjamin Carlsson
2026-10-02 21:42:23 +00:00
committed by copyberry
parent 66561d0301
commit c536ffcb18
38 changed files with 1712 additions and 65 deletions
@@ -49,6 +49,7 @@ pub(super) struct InputQueueState {
/// fresh user turn instead of restoring them into the composer.
pub(super) submit_pending_steers_after_interrupt: bool,
pub(super) suppress_queue_autosend: bool,
pub(super) transcript_copy: std::sync::Weak<crate::copy_input_guard::CopyInputGuard>,
/// Hold submissions while a usage failure or backend-directed model fallback is resolved.
pub(super) rate_limit_recovery_pending: bool,
/// Pause for user recovery (for example an image or permission failure), independent of delivery.
@@ -56,6 +57,10 @@ pub(super) struct InputQueueState {
}
impl InputQueueState {
pub(super) fn submissions_paused(&self) -> bool {
self.suppress_queue_autosend || self.transcript_copy.strong_count() > 0
}
pub(super) fn has_unconfirmed_messages(&self) -> bool {
self.queued_user_messages
.iter()