({
initialPrompt,
agentId,
requireAuth,
hasInvalidCredentials,
fileTree,
continueChat,
continueChatId,
initialMode,
showProjectPicker,
onProjectChange,
}: AppProps)
| 46 | } |
| 47 | |
| 48 | export 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]) |
nothing calls this directly
no test coverage detected