fix(mac): remove broken relaunch-as-admin on macOS#91
Conversation
The osascript-based elevation flow doesn't work reliably on macOS. Hide the admin banner, relaunch buttons, and remove the backend relaunch code path for darwin. Elevation-skipped notices still appear so users know some categories were skipped. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8aa7f20eed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }, []) | ||
|
|
||
| // On macOS the relaunch-as-admin flow doesn't work properly — hide the banner entirely | ||
| if (platform === 'darwin') return null |
There was a problem hiding this comment.
Guard macOS relaunch UI on resolved platform only
platform === 'darwin' is checked immediately, but usePlatformLoader() starts with a hardcoded 'win32' default and suppresses platformInfo errors (catch(() => {}) in src/renderer/src/hooks/usePlatform.ts), so on macOS this banner can still render with a relaunch button before/without real platform resolution. After this commit, clicking that button invokes elevation:relaunch, which now has no darwin handler in src/main/ipc/index.ts, so users get a silent no-op instead of elevation. Consider hiding relaunch controls until platform is positively known (or returning an explicit unsupported error from IPC).
Useful? React with 👍 / 👎.
What does this PR do?
Removes the "Relaunch as Admin" functionality on macOS. The admin banner is hidden entirely, relaunch buttons are removed from the cleaner page and clean summary, and the osascript elevation backend code is removed.
Why?
The osascript-based
do shell script ... with administrator privilegesflow doesn't work reliably on macOS — it causes issues with the app lifecycle and LaunchServices. Rather than ship a broken UX, we hide the elevation UI on macOS. Elevation-skipped notices still appear so users know some categories were skipped due to permissions.How to test
npm testpasses (1892 tests)Checklist
npm testpassesnpm run buildsucceeds