Allow /copy to copy status output and individual fields (#43055)

## Why

`/copy` only offered the last assistant response and its code blocks or quotes, leaving `/status` output unavailable in the copy picker.

## What changed

After `/status`, offer the whole status as plain text, the model, the full directory path, and the thread name and session ID when present. Preserve the displayed status fields across repeated copies and include refreshed rate limits in whole-status copies.

Return to assistant-response copying after a later user message, assistant response, or command other than `/copy`. Rename the picker to “Copy to clipboard”.

## Testing

Add snapshots and regression tests covering status text and field selection, missing fields, full directory paths, repeated copying, refreshed limits, and returning to response copying after subsequent turns and commands, including queued commands.

GitOrigin-RevId: 9424cdca9753c834971992ca29494161957b50c4
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-09-05 16:43:40 +00:00
1 parent 89208f09f8
commit 52e73e3a54
12 files changed
+367 -79

No files matched your search

@@ -53,6 +53,7 @@ impl ChatWidget {
}
pub(super) fn handle_service_tier_command_dispatch(&mut self, command: ServiceTierCommand) {
self.transcript.last_status_copy_targets = None;
if self.active_side_conversation {
self.add_error_message(format!(
"'/{}' is unavailable in side conversations. {SIDE_SLASH_COMMAND_UNAVAILABLE_HINT}",
@@ -145,6 +146,9 @@ impl ChatWidget {
}
pub(super) fn dispatch_command(&mut self, cmd: SlashCommand) {
if cmd != SlashCommand::Copy {
self.transcript.last_status_copy_targets = None;
}
if !self.ensure_slash_command_allowed_in_side_conversation(cmd) {
return;
}
@@ -596,6 +600,9 @@ impl ChatWidget {
args: String,
text_elements: Vec<TextElement>,
) {
if cmd != SlashCommand::Copy {
self.transcript.last_status_copy_targets = None;
}
if !self.ensure_slash_command_allowed_in_side_conversation(cmd) {
return;
}
@@ -710,6 +717,9 @@ impl ChatWidget {
cmd: SlashCommand,
prepared: PreparedSlashCommandArgs,
) {
if cmd != SlashCommand::Copy {
self.transcript.last_status_copy_targets = None;
}
let PreparedSlashCommandArgs {
args,
text_elements,