opencode
opencode copied to clipboard
perf: show window immediately during desktop startup
Summary
Previously the desktop app window was only created after the sidecar server was ready (up to 7 seconds). Users saw nothing during this time. Now the window appears immediately with a loading screen.
Changes
Rust (lib.rs)
- Create window synchronously in
setup()instead of inside async spawn - Add
serverReady = falseto initialization script - Dispatch
opencode:server-readyevent when server is ready
TypeScript (app.tsx)
- Add
DesktopServerGatecomponent that shows loading screen - Listen for
opencode:server-readyevent to hide loading - Show animated logo with "Starting server..." text
Before/After
| Before | After |
|---|---|
| Blank screen for 0-7s | Window appears instantly |
| No feedback | Shows loading animation |
| Feels broken/slow | Feels responsive |
Testing
- Launch desktop app
- Should see loading screen immediately
- Loading screen disappears when server is ready