add ctrl+t shortcut to toggle llm thinking block visibility

This commit is contained in:
Markus Ylisiurunen 2025-12-05 09:48:35 +02:00
parent 590db4b6cf
commit a29cd80acf
3 changed files with 20 additions and 10 deletions

View file

@ -2,6 +2,10 @@
## [Unreleased] ## [Unreleased]
### Added
- **Thinking Block Toggle**: Added `Ctrl+T` shortcut to toggle visibility of LLM thinking blocks. When toggled off, shows a static "Thinking..." label instead of full content. Useful for reducing visual clutter during long conversations. ([#113](https://github.com/badlogic/pi-mono/pull/113))
## [0.12.10] - 2025-12-04 ## [0.12.10] - 2025-12-04
### Added ### Added

View file

@ -684,6 +684,7 @@ Change queue mode with `/queue` command. Setting is saved in `~/.pi/agent/settin
- **Shift+Tab**: Cycle thinking level (for reasoning-capable models) - **Shift+Tab**: Cycle thinking level (for reasoning-capable models)
- **Ctrl+P**: Cycle models (use `--models` to scope) - **Ctrl+P**: Cycle models (use `--models` to scope)
- **Ctrl+O**: Toggle tool output expansion (collapsed ↔ full output) - **Ctrl+O**: Toggle tool output expansion (collapsed ↔ full output)
- **Ctrl+T**: Toggle thinking block visibility (shows full content ↔ static "Thinking..." label)
## Project Context Files ## Project Context Files

View file

@ -46,16 +46,21 @@ export class AssistantMessageComponent extends Container {
// Assistant text messages with no background - trim the text // Assistant text messages with no background - trim the text
// Set paddingY=0 to avoid extra spacing before tool executions // Set paddingY=0 to avoid extra spacing before tool executions
this.contentContainer.addChild(new Markdown(content.text.trim(), 1, 0, getMarkdownTheme())); this.contentContainer.addChild(new Markdown(content.text.trim(), 1, 0, getMarkdownTheme()));
} else if (content.type === "thinking" && content.thinking.trim() && !this.hideThinkingBlock) { } else if (content.type === "thinking" && content.thinking.trim()) {
// Thinking traces in muted color, italic if (this.hideThinkingBlock) {
// Use Markdown component with default text style for consistent styling // Show static "Thinking..." label when hidden
this.contentContainer.addChild( this.contentContainer.addChild(new Text(theme.fg("muted", "Thinking..."), 1, 0));
new Markdown(content.thinking.trim(), 1, 0, getMarkdownTheme(), { } else {
color: (text: string) => theme.fg("muted", text), // Thinking traces in muted color, italic
italic: true, // Use Markdown component with default text style for consistent styling
}), this.contentContainer.addChild(
); new Markdown(content.thinking.trim(), 1, 0, getMarkdownTheme(), {
this.contentContainer.addChild(new Spacer(1)); color: (text: string) => theme.fg("muted", text),
italic: true,
}),
);
this.contentContainer.addChild(new Spacer(1));
}
} }
} }