Commit 6ae3c47
committed
refactor(chat): split ChatPage into domain hooks under pages/chat
ChatPage.tsx (5937 lines) is now a 1772-line cross-domain wiring layer;
all logic moved verbatim into per-domain modules:
- queue/useChatTurnQueue: local queue, WebUI remote queue protocol,
snapshot publishing
- runtime/useSendChatTurn: the full send pipeline (overrides, large-paste
import, gateway bridge, title job, abort/error commit, agent/text turns)
- gateway/useGatewayRuntimeSnapshots + useGatewayBridgeReadiness +
useGatewayStatus: run mirroring, edit_resend rebase/hydration readiness,
connection status
- history/useSharedHistory + useBranchConversation
- workspace/useWorkspaceProjects (+Removal, +ProjectTerminals, +Overlays)
- runtime/useChatModelSelection, composer/useComposerDraftCache,
hooks/useNotifyToasts, hooks/useTauriFileDrop
- pure modules: composerDraftText, providerRuntimeConfig,
gatewayRuntimeStatusModel, workspaceProjectsModel, chatPageUtils;
tauriTunnelClient moved to lib/tunnels
- JSX extractions: WorkspaceOverlayHost (lazy Monaco defs move along),
ChatFileDropOverlay
Behavior-preserving: tsc clean, 1113 frontend tests green, mirror check
passes; verified by mechanical body-hash diff against the old file plus
multi-lens adversarial review (instance identity, escaping closures,
effect ordering, JSX prop parity).
Also un-ignores pages/chat/workspace/ from the bare `workspace` gitignore
rule so the new directory is actually tracked.1 parent 155d0eb commit 6ae3c47
26 files changed
Lines changed: 6053 additions & 4678 deletions
File tree
- crates/agent-gui/src
- lib/tunnels
- pages
- chat
- components
- composer
- gateway
- history
- hooks
- queue
- runtime
- workspace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments