Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Problem

E2E tests are flaky because app.firstWindow() grabs the splash screen instead of the main window. The test expects the "Projects" navigation to be visible, but that only exists in the main window.

Solution

Skip splash screen when CMUX_E2E=1. E2E tests don't need startup feedback and need deterministic window ordering.

Testing

E2E tests should now pass consistently.

Generated with cmux

The splash screen was being shown in E2E mode, causing app.firstWindow()
to grab the splash window instead of the main window. This made the
"Projects" navigation check fail.

Fix: Skip splash screen when CMUX_E2E=1
@ammario ammario merged commit 7758a94 into main Oct 13, 2025
7 checks passed
@ammario ammario deleted the fix-e2e-splash-screen branch October 13, 2025 20:03
ammar-agent added a commit that referenced this pull request Oct 13, 2025
## Problem
- Splash screen sometimes showed white flash during startup
- No user-visible error messages when startup fails
- Users see black screen with no feedback if app fails to start

## Solution

### 1. Fix White Flash
Added `backgroundColor: '#1f1f1f'` to splash window configuration to match
the splash HTML background color (hsl(0 0% 12%)). This eliminates any white
flash if HTML loads slowly.

### 2. Comprehensive Error Handling
Wrapped entire `app.whenReady()` in try/catch to handle all startup failures:
- Close splash screen on error
- Show error dialog with full error message and stack trace
- Quit app gracefully after showing error
- Ensures users always see startup failures instead of silent black screen

### 3. Update Documentation
- Corrected service load time comment (~100ms, not ~6-13s)
- Added note that spinner may freeze briefly during service loading
- This is acceptable since splash still provides visual feedback

## Impact
- ✅ No white flash - consistent dark background from first frame
- ✅ Better error UX - users see what went wrong during startup
- ✅ More accurate documentation of startup timing

## Related
- Builds on PR #226 (initial splash screen)
- Complements PR #230 (E2E test fixes)
- See issue #231 for future tree-shaking optimization

The backgroundColor fix and error handling are simple, reliable improvements
that don't add complexity. Future performance gains should come from loading
less code (tree-shaking) rather than moving work to worker threads.
ammar-agent added a commit that referenced this pull request Oct 13, 2025
## Problem
- Splash screen sometimes showed white flash during startup
- No user-visible error messages when startup fails
- Users see black screen with no feedback if app fails to start

## Solution

### 1. Fix White Flash
Added `backgroundColor: '#1f1f1f'` to splash window configuration to match
the splash HTML background color (hsl(0 0% 12%)). This eliminates any white
flash if HTML loads slowly.

### 2. Comprehensive Error Handling
Wrapped entire `app.whenReady()` in try/catch to handle all startup failures:
- Close splash screen on error
- Show error dialog with full error message and stack trace
- Quit app gracefully after showing error
- Ensures users always see startup failures instead of silent black screen

### 3. Update Documentation
- Corrected service load time comment (~100ms, not ~6-13s)
- Added note that spinner may freeze briefly during service loading
- This is acceptable since splash still provides visual feedback

## Impact
- ✅ No white flash - consistent dark background from first frame
- ✅ Better error UX - users see what went wrong during startup
- ✅ More accurate documentation of startup timing

## Related
- Builds on PR #226 (initial splash screen)
- Complements PR #230 (E2E test fixes)
- See issue #231 for future tree-shaking optimization

The backgroundColor fix and error handling are simple, reliable improvements
that don't add complexity. Future performance gains should come from loading
less code (tree-shaking) rather than moving work to worker threads.
ammar-agent added a commit that referenced this pull request Oct 13, 2025
## Problem
- Splash screen sometimes showed white flash during startup
- No user-visible error messages when startup fails
- Users see black screen with no feedback if app fails to start

## Solution

### 1. Fix White Flash
Added `backgroundColor: '#1f1f1f'` to splash window configuration to match
the splash HTML background color (hsl(0 0% 12%)). This eliminates any white
flash if HTML loads slowly.

### 2. Comprehensive Error Handling
Wrapped entire `app.whenReady()` in try/catch to handle all startup failures:
- Close splash screen on error
- Show error dialog with full error message and stack trace
- Quit app gracefully after showing error
- Ensures users always see startup failures instead of silent black screen

### 3. Update Documentation
- Corrected service load time comment (~100ms, not ~6-13s)
- Added note that spinner may freeze briefly during service loading
- This is acceptable since splash still provides visual feedback

## Impact
- ✅ No white flash - consistent dark background from first frame
- ✅ Better error UX - users see what went wrong during startup
- ✅ More accurate documentation of startup timing

## Related
- Builds on PR #226 (initial splash screen)
- Complements PR #230 (E2E test fixes)
- See issue #231 for future tree-shaking optimization

The backgroundColor fix and error handling are simple, reliable improvements
that don't add complexity. Future performance gains should come from loading
less code (tree-shaking) rather than moving work to worker threads.
github-merge-queue bot pushed a commit that referenced this pull request Oct 13, 2025
)

## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants