refactor(chat): extract XState actors into chat-machine.actors.ts

- Split chat state machine actors (chatInit, sendMessageHttp, loadMoreHistory, chatWebSocket) into a dedicated module
- Add comprehensive console logging across the chat state machine for full trace debugging
- Comment out margin on text bubble CSS for layout adjustment
- Add debug logging to chat input bar send handler
- Clean up redundant comments in auth-screen component
This commit is contained in:
2026-06-12 11:20:19 +08:00
parent 6394c8ba7b
commit 38f060bbd8
7 changed files with 583 additions and 253 deletions
@@ -42,6 +42,13 @@ export function ChatInputBar({ disabled = false }: ChatInputBarProps) {
const handleSend = () => {
if (!hasContent) return;
console.log("[chat-input-bar] handleSend", {
contentLength: input.length,
contentPreview: input.slice(0, 50),
hasContent,
disabled,
isFocused,
});
dispatch({ type: "ChatSendMessage", content: input });
setInput("");
textareaRef.current?.focus();
@@ -18,7 +18,7 @@
color: var(--color-text-foreground, #000);
border-top-left-radius: 0;
/* 气泡在头像侧的外侧留白 */
margin-left: var(--spacing-4, 16px);
/* margin-left: var(--spacing-4, 16px); */
}
.bubbleUser {
@@ -30,5 +30,5 @@
color: #fff;
border-top-right-radius: 0;
/* 气泡在头像侧的外侧留白 */
margin-right: var(--spacing-4, 16px);
/* margin-right: var(--spacing-4, 16px); */
}