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

+3
View File
@@ -5665,6 +5665,7 @@ async fn render_clear_ui_header_after_long_transcript_for_snapshot() -> String {
let user_cell = |text: &str| -> Arc<dyn HistoryCell> {
Arc::new(UserHistoryCell {
spoken: false,
message: text.to_string(),
text_elements: Vec::new(),
local_image_paths: Vec::new(),
@@ -7096,6 +7097,7 @@ async fn backtrack_selection_preserves_selected_prompt_and_requests_branch() {
remote_image_urls: Vec<String>|
-> Arc<dyn HistoryCell> {
Arc::new(UserHistoryCell {
spoken: false,
message: text.to_string(),
text_elements,
local_image_paths,
@@ -9107,6 +9109,7 @@ async fn clear_only_ui_reset_preserves_chat_session_state() {
app.chat_widget
.apply_external_edit("draft prompt".to_string());
app.transcript_cells = vec![Arc::new(UserHistoryCell {
spoken: false,
message: "old message".to_string(),
text_elements: Vec::new(),
local_image_paths: Vec::new(),