Skip to content

fix(mac): remove broken relaunch-as-admin on macOS#91

Merged
dbfx merged 1 commit intomainfrom
dbfx/mac-hide-admin-relaunch
Mar 27, 2026
Merged

fix(mac): remove broken relaunch-as-admin on macOS#91
dbfx merged 1 commit intomainfrom
dbfx/mac-hide-admin-relaunch

Conversation

@dbfx
Copy link
Copy Markdown
Contributor

@dbfx dbfx commented Mar 27, 2026

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 privileges flow 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

  1. Run the app on macOS — confirm the admin banner no longer appears
  2. Run a scan that skips categories due to permissions — confirm the skipped notice appears but without a "Relaunch as Admin" button
  3. Verify the relaunch button still works on Windows and Linux
  4. npm test passes (1892 tests)

Checklist

  • Tested on my platform (Windows / macOS / Linux)
  • npm test passes
  • npm run build succeeds
  • Commit messages follow Conventional Commits

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>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@dbfx dbfx merged commit d84843f into main Mar 27, 2026
8 checks passed
@dbfx dbfx deleted the dbfx/mac-hide-admin-relaunch branch March 27, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant