Commit 200025b
authored
🤖 perf: exit splash screen immediately after workspace.create() (#1146)
Switch to the workspace view as soon as `workspace.create()` succeeds,
rather than waiting for `sendMessage()` to complete.
## What changed
**Before:**
```
setIsSending(true)
await waitForGeneration()
await workspace.create(...)
await workspace.sendMessage(...) ← blocked here
onWorkspaceCreated(metadata)
setIsSending(false) ← splash exits
```
**After:**
```
setIsSending(true)
await waitForGeneration()
await workspace.create(...)
onWorkspaceCreated(metadata) ← switch immediately
setIsSending(false) ← splash exits
void workspace.sendMessage(...) ← fire-and-forget
```
## Why this is safe
1. **Stream errors handled by workspace UI**: Once switched to the
workspace view, the chat UI listens to `stream-error` events and
displays them inline
2. **`sendMessage` returns quickly**: The RPC just kicks off the stream
in the background via `processStreamWithCleanup()` and returns
3. **No race conditions**: Preferences are synced before switching, and
the workspace store is updated atomically
This reduces perceived latency by eliminating the `sendMessage` RPC
round-trip from the splash screen duration.
---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking:
`high`_1 parent 5e4cab3 commit 200025b
1 file changed
+15
-19
lines changedLines changed: 15 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
196 | 195 | | |
197 | 196 | | |
198 | 197 | | |
199 | | - | |
200 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
201 | 213 | | |
202 | 214 | | |
203 | 215 | | |
| |||
206 | 218 | | |
207 | 219 | | |
208 | 220 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | 221 | | |
226 | 222 | | |
227 | 223 | | |
| |||
0 commit comments