Skip to content

fix(desktop): restore a main window on macOS activation with hidden WPP workers #80

Closed

Description

@trmosala

Description

The macOS activation handler checks all BrowserWindows, including hidden WPP workers and the login window, before restoring the UI. With no main windows but a live worker, clicking the Dock icon does nothing.

Priority: medium. Reviewed CookieMonster CM-Split-v2 at dafdcd4171466050c984d524ca0d1a09d31f100e; links use the identical remote V2 source on Ubuntu 26.04.1 x64, Bun 1.4.2.

Steps to reproduce and evidence

Rechecked the current lifecycle handler: it restores only when BrowserWindow.getAllWindows().length is zero. WPP workers are hidden BrowserWindows that can remain alive for hours. The failure follows directly from those paths; macOS behavior has not been exercised on this Linux box.

Acceptance criteria and verification

  • Determine activation from the main-window registry rather than the total native-window count.
  • Restore/focus a usable main window while preserving WPP worker and login lifecycles.
  • Add a hidden-worker/no-main-window regression and validate a packaged build on macOS.

Source and related work

packages/desktop/src/main/lifecycle/index.ts, packages/desktop/src/main/windows/index.ts.

WPP worker source: https://github.com/trmosala/CM-WPP-Bits/blob/2e470e8190c319f47c86dfb83af829eb869908bf/src/session.ts.

Activity

  1. trmosala commented on Oct 21, 2026

    @trmosala
    OwnerAuthor

    Merged into CM-Split-v2 as 290d7d6353c0c7a4a356af780b5687f2dcfe5cfc through PR #96. Its tree exactly matches reviewed source 68ab9205709350385471eb2d383b3cff3c18e678.

    Implemented in PR #96, reviewed source 68ab9205709350385471eb2d383b3cff3c18e678.

    Activation now consults the main-window registry and restores a usable main UI while preserving hidden WPP workers. The hidden-worker/no-main-window regression is retained. The corrected packaged check sends the actual native reopen event. Its final Mac run was cancelled, so the corrected packaged behavior remains unverified until the deferred final pass.

    Final verification is deferred at the user's explicit request to finish and close the implementation issues before one final test pass. This closure records implementation completion, not a claim that the final combined/platform checks have passed. Any failure in that pass will be recorded against the relevant issue.

  2. trmosala commented on Oct 21, 2026

    @trmosala
    OwnerAuthor

    Final packaged qualification passed on merged source 290d7d6353c0c7a4a356af780b5687f2dcfe5cfc: macOS arm64 run 39533190446.

    The signed/notarized/stapled installer passed mounted validation. The real packaged app received native activation after reopening, restored a visible main window, and preserved the hidden worker. Its explicit result reports nativeActivation, mainWindowRestored and hiddenWorkerPreserved as true. The verified installer was uploaded as a workflow artifact; release publication was skipped.

    This completes the Mac activation qualification deferred at implementation closure. It does not assert that genuine signed-in WPP model capture has passed. The installed Linux app was not changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions