Commit 83852f8
🤖 Fix splash screen white flash and improve startup error handling (#232)
## Problem
While the splash screen from PR #226 provides instant visual feedback,
two issues remain:
1. **White flash** - Splash window sometimes shows white background
briefly before HTML loads
2. **Silent startup failures** - If the app fails to start, users see
nothing (no window, no error)
## Solution
### Fix White Flash
Set `backgroundColor: '#1f1f1f'` on splash window to match the HTML
background color. This ensures consistent dark background even if HTML
hasn't rendered yet.
### Comprehensive Error Handling
Wrap entire `app.whenReady()` in try/catch to handle all startup
failures:
- Close splash screen if startup fails
- Show error dialog with full error message and stack trace
- Quit app gracefully after showing error
- Users always see what went wrong instead of silent black screen
### Documentation Updates
- Corrected service load time (~100ms, not ~6-13s) in code comments
- Added note that spinner may freeze briefly during service loading
- This is acceptable since splash still provides visual feedback
## Testing
- ✅ TypeScript checks pass
- ✅ ESLint passes (only pre-existing warnings)
- ✅ Manual testing confirms no white flash
- ✅ Error handling tested by introducing deliberate startup error
## Impact
- ✅ No white flash - consistent dark background from first frame
- ✅ Better error UX - users see what went wrong during startup
- ✅ More accurate documentation
## Related
- Builds on PR #226 (splash screen)
- Complements PR #230 (E2E test fixes)
- See issue #231 for future tree-shaking optimization
Simple, reliable improvements without added complexity.
_Generated with `cmux`_
---------
Co-authored-by: Ammar Bandukwala <ammar@ammar.io>1 parent d6d8368 commit 83852f8
1 file changed
+56
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
| |||
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
269 | | - | |
270 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
| |||
278 | 280 | | |
279 | 281 | | |
280 | 282 | | |
281 | | - | |
| 283 | + | |
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
| |||
368 | 370 | | |
369 | 371 | | |
370 | 372 | | |
371 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
372 | 387 | | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
378 | 410 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | 411 | | |
383 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
384 | 415 | | |
385 | | - | |
| 416 | + | |
386 | 417 | | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
408 | 429 | | |
409 | | - | |
410 | 430 | | |
411 | 431 | | |
412 | 432 | | |
| |||
0 commit comments