Skip to content

macOS: menu bar tray, link fix, macOS CI build; faster ci profile - #25

Merged
snekxs merged 3 commits into
mainfrom
macos-support
Oct 22, 2026
Merged

snekxs merged 3 commits into
mainfrom
macos-support

Conversation

@snekxs

@snekxs snekxs commented Oct 22, 2026 •

Copy link
Copy Markdown
Member
  • build.rs: only pass /STACK to MSVC targets (broke linking on macOS)
  • tray: macOS menu bar icon, shared with the Windows implementation
  • CI: macOS build workflow producing an ad-hoc-signed .dmg
  • CI: new 'ci' cargo profile (no LTO) used by PR/main builds

Note

Add macOS tray support, OpenMouse.dmg packaging, and faster ci build profile

  • Adds a macOS tray backend in tray.rs using the bundled logo as the tray icon and NSApplication hide/unhide for visibility. The Windows code moves into a platform submodule and the public tray API now covers Windows and macOS, with a no-op hide on other targets.
  • Adds make-macos-app.sh, which builds an ad-hoc-signed OpenMouse.app and OpenMouse.dmg from a supplied binary, version, and generated icon set.
  • Adds a macOS CI workflow (build-gpui-macos.yml) that runs GPUI tests, builds with the ci profile, packages the DMG, and uploads it as an artifact.
  • Adds a ci Cargo profile in Cargo.toml that keeps release settings but disables LTO and uses 16 codegen units for faster CI builds. Windows installers now embed the ci-profile GPUI executable while the installer itself stays on release.
  • Fixes build.rs to emit the 16 MiB /STACK linker argument only for MSVC targets, and removes the Windows-only guard on the login-launch tray hide in main.rs.
  • Behavioral Change: Windows installers now contain a ci-profile (no LTO) GPUI binary instead of a release-profile one.

Macroscope summarized 104f8b5.

Summary by CodeRabbit

  • New Features
    • macOS builds are now packaged as a downloadable disk image.
    • Tray support is now available on macOS, including options to hide and restore the app.
  • Bug Fixes
    • When tray support is available, the app now hides to the tray during startup on supported platforms.

- build.rs: only pass /STACK to MSVC targets (broke linking on macOS)
- tray: macOS menu bar icon, shared with the Windows implementation
- CI: macOS build workflow producing an ad-hoc-signed .dmg
- CI: new 'ci' cargo profile (no LTO) used by PR/main builds
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ff43f6ea-cf73-457e-a286-5c78d9f66fca
📥 Commits

Reviewing files that changed from the base of the PR and between 84ff507 and 104f8b5.

📒 Files selected for processing: 1
  • .github/scripts/make-macos-app.sh
+-------------------------------------------------+
| Code Wars Episode VI: Return of the Unit Tests. |
+-------------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bda7baf2-3a54-4ebd-9c86-9b17086fa3e4
📥 Commits

Reviewing files that changed from the base of the PR and between aba3f10 and 84ff507.

📒 Files selected for processing: 7
  • .github/scripts/make-macos-app.sh
  • .github/workflows/build-gpui-macos.yml
  • .github/workflows/build-gpui-windows.yml
  • gpui/Cargo.toml
  • gpui/build.rs
  • gpui/src/bin/main.rs
  • gpui/src/tray.rs
💤 Files with no reviewable changes: 1
  • gpui/src/bin/main.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The changes add macOS tray support and a macOS GPUI build and packaging workflow. They also add a CI build profile, update the Windows workflow to use it, and limit a linker argument to MSVC targets.

Changes: GPUI Platform Build

Layer / File(s) Summary
Cross-platform tray support
.github/scripts/make-macos-app.sh, gpui/Cargo.toml, gpui/build.rs, gpui/src/bin/main.rs, gpui/src/tray.rs
Tray behavior now supports macOS and Windows. Other platforms have a no-op hide. The stack linker argument is emitted only for MSVC targets.
CI build profiles and jobs
gpui/Cargo.toml, .github/workflows/build-gpui-macos.yml, .github/workflows/build-gpui-windows.yml
A release-derived ci profile is added. The macOS workflow tests and builds with it. The Windows app build uses it, and the release installer uses its executable.
macOS app packaging
.github/scripts/make-macos-app.sh, .github/workflows/build-gpui-macos.yml
The script creates an app bundle, generates its icon, writes Info.plist, applies an ad-hoc signature, and creates a compressed DMG. The workflow uploads the DMG.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as macOS GitHub Actions workflow
  participant Build as GPUI CI-profile build
  participant Script as macOS app packaging script
  participant Upload as Artifact upload
  Workflow->>Build: Run tests and build app
  Workflow->>Script: Pass binary, version, and output directory
  Script->>Script: Create app bundle and compressed DMG
  Workflow->>Upload: Upload OpenMouse.dmg
Loading
Merge Risk: ⚪ Minimal · up to 84ff5

The macOS packaging paths are valid, and no actionable merge-blocking risk remains after normal checks.

Security architecture risk: 🔵 Low · up to 84ff5

The changes remain bounded to desktop application behavior and downloadable test builds. No concrete security regression was identified. Build permission defaults, downstream use of the packages, and native window-operation failures remain incompletely established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The evidenced exposure is the local application lifecycle, its polling state, the hosted build job, and users who choose to execute its generated package. The tray path introduces no demonstrated remote entrypoint or additional credential authority.

Trust Boundaries and Controls

  • observed — Pull-request-controlled source is executed during dependency installation, testing, building, and packaging on a hosted runner. The workflow uses pull_request, not pull_request_target, and declares neither explicit token permissions nor secret inputs. Effective inherited permissions and repository policy are not established by this source.
  • inferred — The generated DMG should be understood as a workflow-scoped test package, not proof of an authenticated publisher. No inspected step promotes pull-request packages into a trusted release channel; downstream consumption remains outside the established evidence.

Resilience and Maintainability Implications

  • inferred — The installation fallback and serialized command consumer provide recovery paths without introducing a persistent reservation, migration, or authorization transition. Repeated Show commands target the same retained window; Quit terminates through the application context. Native visibility failures remain an observability limitation, not an established security failure.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 3 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main changes: macOS tray support, the linker fix, the macOS CI build, and the faster CI profile.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 3 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Comment thread .github/scripts/make-macos-app.sh Outdated
# substitute for a Developer ID signature and notarization.
codesign --force --deep --sign - "$app"

hdiutil create -volname "OpenMouse" -srcfolder "$app" -ov -format UDZO "$out/OpenMouse.dmg" >/dev/null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High scripts/make-macos-app.sh:50

The mounted DMG contains Contents/ at its root instead of an OpenMouse.app bundle, so users cannot drag the app into Applications or launch it from the image. hdiutil -srcfolder copies the source directory's contents to the volume root; stage the bundle inside a separate directory and use that directory as -srcfolder.

-hdiutil create -volname "OpenMouse" -srcfolder "$app" -ov -format UDZO "$out/OpenMouse.dmg" >/dev/null
+mkdir "$work/dmg-root"
+cp -R "$app" "$work/dmg-root/"
+hdiutil create -volname "OpenMouse" -srcfolder "$work/dmg-root" -ov -format UDZO "$out/OpenMouse.dmg" >/dev/null
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @.github/scripts/make-macos-app.sh around line 50:

The mounted DMG contains `Contents/` at its root instead of an `OpenMouse.app` bundle, so users cannot drag the app into Applications or launch it from the image. `hdiutil -srcfolder` copies the source directory's contents to the volume root; stage the bundle inside a separate directory and use that directory as `-srcfolder`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix it for me

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is being prepared.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make-macos-app.sh now copies the signed OpenMouse.app into a $work/dmg-root staging folder and builds the DMG from that folder, so OpenMouse.app sits at the root of the image. Before, -srcfolder "$app" put the bundle's contents at the root instead. The change is the suggested diff, applied verbatim; editor_check reported no errors, but the script hasn't been run on macOS.
Commit ad41e16 pushed to #26. When checks pass, it will merge automatically into this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't automatically merge #26 because the merge status is unstable.

@macroscopeapp

macroscopeapp Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — The PR adds production-facing macOS menu-bar tray support and changes existing close and auto-start behavior, while also introducing a new platform-specific runtime dependency. The CI and DMG packaging changes are contained, and the reported DMG layout issue is fixed in the reviewed head, but the new user-facing lifecycle behavior warrants human review.

Notes:

  • Your repo's Minimum Blocking Severity is Off, so correctness findings do not automatically block approval.
  • All code in this push has already been reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

(via snekxs): Put OpenMouse.app at the root of the macOS DMG
@snekxs
snekxs merged commit fd98d25 into main Oct 22, 2026
4 of 5 checks passed
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.

1 participant