wails icon indicating copy to clipboard operation
wails copied to clipboard

Add application startup lifecycle events for responsive splash screens

Open taliesin-ai opened this issue 4 months ago โ€ข 2 comments

Problem

Service startup may take long enough that an application needs to display a responsive splash screen. Today services start before the native event loop, so a Wails window cannot render or remain interactive during that work.

Proposed lifecycle

  1. Enter the native platform event loop.
  2. Emit events.Common.ApplicationStarting once native window operations are available.
  3. Run the existing ServiceStartup methods sequentially on a background startup goroutine.
  4. Emit events.Common.ApplicationInitialized only after every service starts successfully.
  5. Release pending application windows.

This does not change the service API and does not introduce a special splash-window concept. Applications create hidden windows and decide which window to show from lifecycle listeners.

Acceptance criteria

  • The native UI event loop remains responsive during a blocking ServiceStartup.
  • ApplicationStarting listeners run before service startup begins.
  • ApplicationInitialized is emitted only after successful service startup.
  • Startup errors cancel and shut down already-started services without deadlock.
  • Hidden pre-created windows can be shown from ApplicationStarting.
  • Include a runnable v3/examples/splashscreen example.
  • Preserve sequential service startup and reverse-order shutdown.

Scope

This is a general v3 feature and is not proposed as a v3 beta blocker.

taliesin-ai avatar Jul 30 '26 04:07 taliesin-ai

๐Ÿ”— Related PRs

wailsapp/wails#3920 - [V3] Rework service.OnStartup to close application on error [merged] wailsapp/wails#4435 - fix: prevent crash when closing window with pending async calls [merged] wailsapp/wails#5192 - fix(linux): fix race conditions and deadlocks in event handling [merged] wailsapp/wails#5757 - fix(v3): guarantee event dispatch order under rapid Emit() bursts [open] wailsapp/wails#5828 - fix: dev frontend readiness [open]


๐Ÿ“ Issue Planner

Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

  • [ ] Create Plan

๐Ÿงช Issue enrichment is currently in open beta.

You can configure auto-planning by selecting labels in the issue_enrichment configuration.

To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

issue_enrichment:
  auto_enrich:
    enabled: false

๐Ÿ’ฌ Have feedback or questions? Drop into our discord!

coderabbitai[bot] avatar Jul 30 '26 04:07 coderabbitai[bot]

Hi there! Thanks for the suggestion. I'll leave this open for us to consider when planning future work.

taliesin-ai avatar Oct 15 '26 01:10 taliesin-ai