Skip to content

Add application startup lifecycle events for responsive splash screens #5847

Description

@taliesin-ai

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions