Skip to content

Commit 942ab09

Browse files
committed
refactor(cli): simplify architecture with auth store and MessageBlock
split - Create auth-store.ts for centralized authentication state management - Reduce Chat component props from 11 to 8 (remove auth prop drilling) - Split 900-line MessageBlock into 4 focused modules: - message-block.tsx (220 lines) - message orchestration - blocks/agent-body.tsx (280 lines) - agent rendering - blocks/blocks-renderer.tsx (280 lines) - block iteration - utils/block-tree.ts - shared block manipulation utilities - Extract block manipulation logic to reusable utilities - Eliminate 100+ lines of duplicate recursive block code All tests pass (231/231) and typechecks clean.
1 parent eda6427 commit 942ab09

File tree

12 files changed

+1511
-1215
lines changed

12 files changed

+1511
-1215
lines changed

cli/src/app.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,7 @@ export const App = ({
6060
})),
6161
)
6262

63-
const {
64-
isAuthenticated,
65-
setIsAuthenticated,
66-
setUser,
67-
handleLoginSuccess,
68-
logoutMutation,
69-
} = useAuthState({
63+
const { isAuthenticated, handleLoginSuccess, logout } = useAuthState({
7064
requireAuth,
7165
hasInvalidCredentials,
7266
inputRef,
@@ -221,12 +215,9 @@ export const App = ({
221215
loadedAgentsData={loadedAgentsData}
222216
validationErrors={validationErrors}
223217
fileTree={fileTree}
224-
inputRef={inputRef}
225-
setIsAuthenticated={setIsAuthenticated}
226-
setUser={setUser}
227-
logoutMutation={logoutMutation}
228218
continueChat={continueChat}
229219
continueChatId={continueChatId}
220+
logout={logout}
230221
/>
231222
)
232223
}

0 commit comments

Comments
 (0)