Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

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

Simple, reliable improvements without added complexity.

Generated with cmux

@ammar-agent ammar-agent force-pushed the faster-startup-and-lowercase branch from e0cbebe to 98dbb1c Compare October 13, 2025 20:13
@chatgpt-codex-connector
Copy link

💡 Codex Review

cmux/package.json

Lines 1 to 4 in e0cbebe

{
"name": "cmux",
"version": "0.1.0",
"description": "cmux - coder multiplexer",

P1 Badge Avoid unintended version downgrade

The patch changes the project version from 0.2.0 to 0.1.0. The repo history shows 0.2.0 as the latest tag, so publishing from this branch would create artifacts that look older than the current release and may confuse semver‑based tooling or downstream scripts that assume versions are monotonic. Unless you’re intentionally rolling back a release, the version should stay at or above 0.2.0.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

## 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 ammar-agent force-pushed the faster-startup-and-lowercase branch from 98dbb1c to 28ac668 Compare October 13, 2025 20:16
@ammar-agent
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

@ammario ammario added this pull request to the merge queue Oct 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 13, 2025
@ammario ammario enabled auto-merge October 13, 2025 21:03
@ammario ammario added this pull request to the merge queue Oct 13, 2025
Merged via the queue into main with commit 83852f8 Oct 13, 2025
6 of 7 checks passed
@ammario ammario deleted the faster-startup-and-lowercase branch October 13, 2025 21:17
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