Conversation
- Add show_tool_outputs field to TranscriptRenderer (default: false) - Add 'o' key binding to toggle tool outputs visibility in transcript mode - Render tool outputs dimmed when shown - Update footer to show tool outputs toggle state - Add hint about Ctrl+O in conversation summary Co-Authored-By: Paws <noreply@pawscode.dev>
There was a problem hiding this comment.
Pull request overview
This PR adds a toggle feature for displaying tool outputs in the transcript view, complementing the existing thinking toggle functionality.
Changes:
- Added a user hint in the UI to inform users about the transcript mode keyboard shortcut (Ctrl+O)
- Implemented a new
show_tool_outputstoggle feature in the transcript renderer with 'o' key binding - Extended the transcript renderer to display tool result outputs (text, images, and AI results) when enabled
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
crates/paws_main/src/ui.rs |
Added hint message to guide users to transcript mode using Ctrl+O |
crates/paws_main/src/transcript.rs |
Added show_tool_outputs field, 'o' key toggle handler, tool output rendering logic, and updated help text |
Comments suppressed due to low confidence (1)
crates/paws_main/src/transcript.rs:705
- The code in this block is duplicated from the 't' key handler above (lines 662-683). Consider extracting the common re-rendering logic into a helper method to reduce duplication and improve maintainability. The only difference between these two blocks is which flag is being toggled.
KeyCode::Char('o') => {
// Toggle tool outputs visibility
show_tool_outputs = !show_tool_outputs;
// Re-render content with new tool outputs visibility
lines = self.render_content_with_options(
&conversation,
show_thinking,
show_tool_outputs,
);
let header = self.render_header(&conversation);
lines.splice(0..0, header);
lines.push(String::new());
lines.extend(self.render_summary(&conversation));
// Adjust scroll offset if needed
let content_height = height.saturating_sub(1) as usize;
if lines.len() > content_height {
scroll_offset = scroll_offset
.min(lines.len().saturating_sub(content_height));
} else {
scroll_offset = 0;
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| show_tool_outputs: false, | ||
| } |
There was a problem hiding this comment.
Consider adding a public setter method similar to show_thinking to allow programmatic control of the show_tool_outputs flag. This would maintain consistency with the existing API pattern for the show_thinking field.
| ContextMessage::Tool(tool_result) => { | ||
| // Render tool results to show tool outputs in place (only if enabled) | ||
| if show_tool_outputs { | ||
| lines.push(format!("{}: {}", "Tool Result".dimmed(), tool_result.name)); | ||
| for value in &tool_result.output.values { | ||
| match value { | ||
| ToolValue::Text(text) => { | ||
| for line in text.lines() { | ||
| lines.push(line.dimmed().to_string()); | ||
| } | ||
| } | ||
| ToolValue::Image(image) => { | ||
| lines.push( | ||
| format!("[Image: {}]", image.mime_type()) | ||
| .dimmed() | ||
| .to_string(), | ||
| ); | ||
| } | ||
| ToolValue::AI { value, conversation_id } => { | ||
| lines.push( | ||
| format!("AI Result ({conversation_id}):") | ||
| .dimmed() | ||
| .to_string(), | ||
| ); | ||
| for line in value.lines() { | ||
| lines.push(line.dimmed().to_string()); | ||
| } | ||
| } | ||
| ToolValue::Empty => {} | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Consider checking tool_result.output.is_error and displaying error outputs with a different style (e.g., red text) instead of dimmed text to make tool errors more visible to users.
No description provided.