refactor(chat): remove unused ChatScreenVisible and ChatScreenInvisible events
The screen-lifecycle events were dead code: the transitions in chat-machine (idle <-> ready) had no caller behavior tied to them, and the dispatches in chat-screen.tsx were the only senders. Drop the union members, both state transitions, and the mount-effect dispatches. The idle state remains declared as initial but is no longer reachable at runtime; can be refactored in a follow-up. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -251,7 +251,6 @@ export const chatMachine = setup({
|
||||
idle: {
|
||||
on: {
|
||||
ChatInit: "initializing",
|
||||
ChatScreenVisible: "ready",
|
||||
ChatLoadMoreHistory: "loadingMoreHistory",
|
||||
ChatSendMessage: {
|
||||
guard: ({ event }) => event.content.trim().length > 0,
|
||||
@@ -308,7 +307,9 @@ export const chatMachine = setup({
|
||||
actions: "appendUserImage",
|
||||
},
|
||||
ChatLoadMoreHistory: "loadingMoreHistory",
|
||||
ChatScreenInvisible: "idle",
|
||||
ChatAuthStatusChanged: {
|
||||
actions: "refreshAuthStatus",
|
||||
},
|
||||
ChatAISentenceReceived: {
|
||||
actions: "appendOrUpdateAISentence",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user