mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Style spoken prompts and link workspace files in voice transcripts (#43676)
## What changed - Render spoken user prompts with a bold red chevron, preserving its color during live transcript animation. Trim leading whitespace for display while retaining the raw transcript text. - Underline and link file references such as `src/lib.rs:42` in spoken assistant transcripts using terminal hyperlinks. Preserve existing links and support Windows-style relative separators. - Restrict generated file links to existing files with allowed extensions inside the workspace, rejecting hidden paths, traversal, and symlink escapes. ## Testing Add rendering and transcript tests for the spoken marker, raw text preservation, file links, Unicode column offsets, and Windows-style paths, plus validation tests for rejected file destinations. GitOrigin-RevId: 5fa180aa606acdc579a916441520602cb2bf3655
This commit is contained in:
1 parent
4e93cf9b4e
commit
3caf9f9586
21 files changed
+461
-20
No files matched your search
@@ -1500,20 +1500,12 @@ impl ChatWidget {
|
||||
|
||||
fn realtime_transcript_history_cell(&self, role: &str, text: &str) -> Box<dyn HistoryCell> {
|
||||
if role == "user" {
|
||||
Box::new(history_cell::new_user_prompt(
|
||||
text.to_string(),
|
||||
Vec::new(),
|
||||
Vec::new(),
|
||||
Vec::new(),
|
||||
))
|
||||
Box::new(history_cell::new_spoken_user_prompt(text.to_string()))
|
||||
} else {
|
||||
Box::new(
|
||||
history_cell::AgentMarkdownCell::new_with_inline_visualizations(
|
||||
text.to_string(),
|
||||
&self.config.cwd,
|
||||
/*inline_visualization_context*/ None,
|
||||
),
|
||||
)
|
||||
Box::new(history_cell::AgentMarkdownCell::new_spoken(
|
||||
text.to_string(),
|
||||
&self.config.cwd,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user