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:
Benjamin Carlsson authored and copyberry committed 2026-09-08 03:15:37 +00:00
1 parent 4e93cf9b4e
commit 3caf9f9586
21 files changed
+461 -20

No files matched your search

@@ -39,6 +39,7 @@ fn prepare_eligible_recap(app: &mut App, thread_id: ThreadId) {
app.transcript_cells
.push(Arc::new(crate::history_cell::UserHistoryCell {
message: "Finish the recap implementation".to_string(),
spoken: false,
text_elements: Vec::new(),
local_image_paths: Vec::new(),
remote_image_urls: Vec::new(),
@@ -200,6 +201,7 @@ async fn manual_recap_works_when_auto_recap_disabled() -> Result<()> {
app.transcript_cells
.push(Arc::new(crate::history_cell::UserHistoryCell {
message: "Summarize this conversation".to_string(),
spoken: false,
text_elements: Vec::new(),
local_image_paths: Vec::new(),
remote_image_urls: Vec::new(),
@@ -379,6 +381,7 @@ async fn recap_generation_uses_remote_workspace_cwd() -> Result<()> {
app.transcript_cells
.push(Arc::new(crate::history_cell::UserHistoryCell {
message: "Finish the recap implementation".to_string(),
spoken: false,
text_elements: Vec::new(),
local_image_paths: Vec::new(),
remote_image_urls: Vec::new(),
@@ -53,6 +53,7 @@ async fn startup_warnings_preserve_stream_repair_and_backtrack_selection() -> Re
text_elements: Vec::new(),
local_image_paths: Vec::new(),
remote_image_urls: Vec::new(),
spoken: false,
})];
app.transcript_reflow.mark_resize_requested_during_stream();
insert_warnings(&mut app, &mut tui, &["First warning"]);
@@ -42,6 +42,7 @@ async fn transcript_flag_off_preserves_viewer_and_backtracking() -> Result<()> {
text_elements: Vec::new(),
local_image_paths: Vec::new(),
remote_image_urls: Vec::new(),
spoken: false,
}) as Arc<dyn HistoryCell>
})
.to_vec();