mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 10:02:23 +00:00
Fix spacer after hidden thinking block, add contributor link to CHANGELOG
This commit is contained in:
parent
a29cd80acf
commit
4a3e553260
2 changed files with 9 additions and 2 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
### Added
|
### 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))
|
- **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) by [@markusylisiurunen](https://github.com/markusylisiurunen))
|
||||||
|
|
||||||
## [0.12.10] - 2025-12-04
|
## [0.12.10] - 2025-12-04
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,15 +41,22 @@ export class AssistantMessageComponent extends Container {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render content in order
|
// Render content in order
|
||||||
for (const content of message.content) {
|
for (let i = 0; i < message.content.length; i++) {
|
||||||
|
const content = message.content[i];
|
||||||
if (content.type === "text" && content.text.trim()) {
|
if (content.type === "text" && content.text.trim()) {
|
||||||
// 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()) {
|
} else if (content.type === "thinking" && content.thinking.trim()) {
|
||||||
|
// Check if there's text content after this thinking block
|
||||||
|
const hasTextAfter = message.content.slice(i + 1).some((c) => c.type === "text" && c.text.trim());
|
||||||
|
|
||||||
if (this.hideThinkingBlock) {
|
if (this.hideThinkingBlock) {
|
||||||
// Show static "Thinking..." label when hidden
|
// Show static "Thinking..." label when hidden
|
||||||
this.contentContainer.addChild(new Text(theme.fg("muted", "Thinking..."), 1, 0));
|
this.contentContainer.addChild(new Text(theme.fg("muted", "Thinking..."), 1, 0));
|
||||||
|
if (hasTextAfter) {
|
||||||
|
this.contentContainer.addChild(new Spacer(1));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Thinking traces in muted color, italic
|
// Thinking traces in muted color, italic
|
||||||
// Use Markdown component with default text style for consistent styling
|
// Use Markdown component with default text style for consistent styling
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue