MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / App

Function App

cli/src/app.tsx:48–318  ·  view source on GitHub ↗
({
  initialPrompt,
  agentId,
  requireAuth,
  hasInvalidCredentials,
  fileTree,
  continueChat,
  continueChatId,
  initialMode,
  showProjectPicker,
  onProjectChange,
}: AppProps)

Source from the content-addressed store, hash-verified

46}
47
48export const App = ({
49 initialPrompt,
50 agentId,
51 requireAuth,
52 hasInvalidCredentials,
53 fileTree,
54 continueChat,
55 continueChatId,
56 initialMode,
57 showProjectPicker,
58 onProjectChange,
59}: AppProps) => {
60 const { contentMaxWidth, terminalWidth } = useTerminalDimensions()
61 const theme = useTheme()
62
63 // Sheen animation state for the logo
64 const [sheenPosition, setSheenPosition] = useState(0)
65 const blockColor = getLogoBlockColor(theme.name)
66 const accentColor = getLogoAccentColor(theme.name)
67 const { applySheenToChar } = useSheenAnimation({
68 logoColor: theme.foreground,
69 accentColor,
70 blockColor,
71 terminalWidth,
72 sheenPosition,
73 setSheenPosition,
74 })
75
76 const { component: logoComponent } = useLogo({
77 availableWidth: contentMaxWidth,
78 accentColor,
79 blockColor,
80 applySheenToChar,
81 })
82
83 const inputRef = useRef<MultilineInputHandle | null>(null)
84 const {
85 setInputFocused,
86 setIsFocusSupported,
87 resetChatStore,
88 activeTopBanner,
89 setActiveTopBanner,
90 closeTopBanner,
91 } = useChatStore(
92 useShallow((store) => ({
93 setInputFocused: store.setInputFocused,
94 setIsFocusSupported: store.setIsFocusSupported,
95 resetChatStore: store.reset,
96 activeTopBanner: store.activeTopBanner,
97 setActiveTopBanner: store.setActiveTopBanner,
98 closeTopBanner: store.closeTopBanner,
99 })),
100 )
101
102 // Wrap in useCallback to prevent re-subscribing on every render
103 const handleSupportDetected = useCallback(() => {
104 setIsFocusSupported(true)
105 }, [setIsFocusSupported])

Callers

nothing calls this directly

Calls 15

useTerminalDimensionsFunction · 0.90
useThemeFunction · 0.90
getLogoBlockColorFunction · 0.90
getLogoAccentColorFunction · 0.90
useSheenAnimationFunction · 0.90
useLogoFunction · 0.90
useTerminalFocusFunction · 0.90
useAuthQueryFunction · 0.90
useAuthStateFunction · 0.90
getProjectRootFunction · 0.90
findGitRootFunction · 0.90
formatCwdFunction · 0.90

Tested by

no test coverage detected