Skip to content

Commit a5d8a2d

Browse files
committed
Account for no mode toggle in freebuff
1 parent ba19c69 commit a5d8a2d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cli/src/hooks/use-chat-input.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef } from 'react'
22
import stringWidth from 'string-width'
33

44
import { useChatStore } from '../state/chat-store'
5+
import { IS_FREEBUFF } from '../utils/constants'
56

67
import type { InputValue } from '../types/store'
78
import type { AgentMode } from '../utils/constants'
@@ -33,8 +34,9 @@ export const useChatInput = ({
3334
const inputMode = useChatStore((state) => state.inputMode)
3435

3536
// Estimate the collapsed toggle width as rendered by AgentModeToggle.
36-
// In bash mode, compact height, or narrow width, we don't show the toggle, so no width needed.
37-
const estimatedToggleWidth = inputMode !== 'default' || isCompactHeight || isNarrowWidth
37+
// In Freebuff, the toggle is always hidden, so never reserve width for it.
38+
// In non-Freebuff: hide in bash mode, compact height, or narrow width.
39+
const estimatedToggleWidth = IS_FREEBUFF || inputMode !== 'default' || isCompactHeight || isNarrowWidth
3840
? 0
3941
: stringWidth(`< ${agentMode}`) + 6 // 2 padding + 2 borders + 2 gap
4042

0 commit comments

Comments
 (0)