(terminalColumns: number, speaking: boolean)
| 165 | // Narrow terminals: 0 — REPL.tsx stacks the one-liner on its own row |
| 166 | // (above input in fullscreen, below in scrollback), so no reservation. |
| 167 | export function companionReservedColumns(terminalColumns: number, speaking: boolean): number { |
| 168 | if (!feature('BUDDY')) return 0; |
| 169 | const companion = getCompanion(); |
| 170 | if (!companion || getGlobalConfig().companionMuted) return 0; |
| 171 | if (terminalColumns < MIN_COLS_FOR_FULL_SPRITE) return 0; |
| 172 | const nameWidth = stringWidth(companion.name); |
| 173 | const bubble = speaking && !isFullscreenActive() ? BUBBLE_WIDTH : 0; |
| 174 | return spriteColWidth(nameWidth) + SPRITE_PADDING_X + bubble; |
| 175 | } |
| 176 | export function CompanionSprite(): React.ReactNode { |
| 177 | const reaction = useAppState(s => s.companionReaction); |
| 178 | const petAt = useAppState(s => s.companionPetAt); |
no test coverage detected