File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { IS_FREEBUFF } from '../utils/constants'
88import { openFileAtPath } from '../utils/open-file'
99import { formatCwd } from '../utils/path-helpers'
1010import { getLogoAccentColor , getLogoBlockColor } from '../utils/theme-system'
11+ import { shouldAnimateChatHeader } from '../utils/chat-header-animation'
1112import { TerminalLink } from './terminal-link'
1213
1314export 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,
Original file line number Diff line number Diff line change 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+ } )
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments