mirror of
https://github.com/openai/codex.git
synced 2026-11-24 07:20:27 +00:00
adding full imagepath to tui (#15154)
adding full path to TUI so image is open-able in the TUI after being generated. LImited to VSCode Terminal for now.
This commit is contained in:
1 parent
69750a0b5a
commit
27977d6716
9 files changed
+63
-21
No files matched your search
@@ -37,6 +37,8 @@ use std::sync::atomic::Ordering;
|
||||
use std::time::Duration;
|
||||
use std::time::Instant;
|
||||
|
||||
use url::Url;
|
||||
|
||||
use self::realtime::PendingSteerCompareKey;
|
||||
use crate::app_event::RealtimeAudioDeviceKind;
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
@@ -2761,15 +2763,15 @@ impl ChatWidget {
|
||||
|
||||
fn on_image_generation_end(&mut self, event: ImageGenerationEndEvent) {
|
||||
self.flush_answer_stream_with_separator();
|
||||
let saved_to = event.saved_path.as_deref().and_then(|saved_path| {
|
||||
std::path::Path::new(saved_path)
|
||||
.parent()
|
||||
.map(|parent| parent.display().to_string())
|
||||
let saved_path = event.saved_path.map(|saved_path| {
|
||||
Url::from_file_path(Path::new(&saved_path))
|
||||
.map(|url| url.to_string())
|
||||
.unwrap_or(saved_path)
|
||||
});
|
||||
self.add_to_history(history_cell::new_image_generation_call(
|
||||
event.call_id,
|
||||
event.revised_prompt,
|
||||
saved_to,
|
||||
saved_path,
|
||||
));
|
||||
self.request_redraw();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user