mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Add a response target picker to /copy (#39997)
## What changed - Open a picker for `/copy` with the whole response plus each fenced code block and blockquote from the latest response. - Label code blocks by language, show content previews, and preserve source whitespace and nested quote Markdown when copying an individual target. - Keep the picker from disturbing terminal scrollback or queued input, retain clipboard leases, and avoid writing copied content to the session log. ## Testing - Add coverage for target extraction, picker navigation and cancellation, exact copied content, plan responses, queued input, scrollback preservation, clipboard failures, and session logging. GitOrigin-RevId: 77a35bc99f4f45932d39914f9a709b30fe8cd7c2
This commit is contained in:
1 parent
950dd184a1
commit
df6a54ee85
15 files changed
+766
-30
No files matched your search
@@ -174,14 +174,17 @@ impl ChatWidget {
|
||||
}
|
||||
|
||||
pub(super) fn on_plan_item_completed(&mut self, text: String) {
|
||||
let streamed_plan = self.transcript.plan_delta_buffer.trim().to_string();
|
||||
let plan_text = if text.trim().is_empty() {
|
||||
streamed_plan
|
||||
let (plan_text, source) = if text.trim().is_empty() {
|
||||
(
|
||||
self.transcript.plan_delta_buffer.trim().to_string(),
|
||||
self.transcript.plan_delta_buffer.clone(),
|
||||
)
|
||||
} else {
|
||||
text
|
||||
(text.clone(), text)
|
||||
};
|
||||
if !plan_text.trim().is_empty() {
|
||||
self.record_agent_markdown(&plan_text);
|
||||
self.transcript
|
||||
.record_agent_markdown(plan_text.clone(), source);
|
||||
self.transcript.latest_proposed_plan_markdown = Some(plan_text.clone());
|
||||
}
|
||||
// Plan commit ticks can hide the status row; remember whether we streamed plan output so
|
||||
@@ -331,7 +334,8 @@ impl ChatWidget {
|
||||
if matches!(item.phase, Some(MessagePhase::FinalAnswer) | None)
|
||||
&& !parsed.visible_markdown.is_empty()
|
||||
{
|
||||
self.record_agent_markdown(&parsed.visible_markdown);
|
||||
self.transcript
|
||||
.record_agent_markdown(parsed.visible_markdown.clone(), message);
|
||||
}
|
||||
if !from_replay
|
||||
&& let Some(cwd) = parsed.last_created_branch_cwd()
|
||||
|
||||
Reference in new issue
Block a user