Skip to content

Commit f7d624d

Browse files
fix(cli): disable Freebuff chat logo sheen
1 parent 366311e commit f7d624d

3 files changed

Lines changed: 30 additions & 1 deletion

File tree

cli/src/components/chat-header.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { IS_FREEBUFF } from '../utils/constants'
88
import { openFileAtPath } from '../utils/open-file'
99
import { formatCwd } from '../utils/path-helpers'
1010
import { getLogoAccentColor, getLogoBlockColor } from '../utils/theme-system'
11+
import { shouldAnimateChatHeader } from '../utils/chat-header-animation'
1112
import { TerminalLink } from './terminal-link'
1213

1314
export const ChatHeader = memo(function ChatHeader({
@@ -23,7 +24,7 @@ export const ChatHeader = memo(function ChatHeader({
2324
const blockColor = getLogoBlockColor(theme.name)
2425
const accentColor = getLogoAccentColor(theme.name)
2526
const { applySheenToChar } = useSheenAnimation({
26-
enabled: animationEnabled,
27+
enabled: shouldAnimateChatHeader(animationEnabled, IS_FREEBUFF),
2728
logoColor: theme.foreground,
2829
accentColor,
2930
blockColor,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { describe, expect, it } from 'bun:test'
2+
3+
import { shouldAnimateChatHeader } from '../chat-header-animation'
4+
5+
describe('shouldAnimateChatHeader', () => {
6+
it('disables the sheen for the Freebuff chat header', () => {
7+
expect(shouldAnimateChatHeader(true, true)).toBe(false)
8+
})
9+
10+
it('keeps the Codebuff sheen when the header is active', () => {
11+
expect(shouldAnimateChatHeader(true, false)).toBe(true)
12+
})
13+
14+
it('does not animate an inactive header for either product', () => {
15+
expect(shouldAnimateChatHeader(false, true)).toBe(false)
16+
expect(shouldAnimateChatHeader(false, false)).toBe(false)
17+
})
18+
})
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* Freebuff's chat logo sheen can make the focused input appear to flicker.
3+
* Keep the animation for Codebuff while leaving the Freebuff chat header static.
4+
*/
5+
export function shouldAnimateChatHeader(
6+
animationEnabled: boolean,
7+
isFreebuff: boolean,
8+
): boolean {
9+
return animationEnabled && !isFreebuff
10+
}

0 commit comments

Comments
 (0)