refactor: extract ToolCallCard and ChatLobby components (#502)

* refactor: extract ToolCallCard and ChatLobby components

- Extract ToolCallCard.tsx (279 lines) for tool call UI rendering
- Extract ChatLobby.tsx (272 lines) for empty state with session history
- Reduce chat-message-display.tsx from 1760 to 1307 lines (-26%)

* fix: address PR review feedback

- Remove redundant key prop in ToolCallCard
- Make onDeleteSession optional and conditionally render delete button
- Extract shared types (DiagramOperation, ToolPartLike) to types.ts
This commit is contained in:
Dayuan Jiang
2026-01-04 12:04:06 +09:00
committed by GitHub
parent 814f448cb0
commit 24325c178f
4 changed files with 575 additions and 491 deletions

16
components/chat/types.ts Normal file
View File

@@ -0,0 +1,16 @@
export interface DiagramOperation {
operation: "update" | "add" | "delete"
cell_id: string
new_xml?: string
}
export interface ToolPartLike {
type: string
toolCallId: string
state?: string
input?: {
xml?: string
operations?: DiagramOperation[]
} & Record<string, unknown>
output?: string
}