Skip to content

Prompt macOS users to install Lantern in Applications - #9066

Open
atavism wants to merge 1 commit into
mainfrom
atavism/issue-3825
Open

atavism wants to merge 1 commit into
mainfrom
atavism/issue-3825

Conversation

@atavism

@atavism atavism commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Check Lantern’s installation path before Radiance or the system extension starts. If the app is outside /Applications, prompt the user to install it there before continuing.

  • Offer Move and Relaunch, with background copying and a progress indicator.
  • Show Finder instructions when quarantine or an existing installation prevents automatic copying.
  • Preserve the original app and existing installations.

Resolves https://github.com/getlantern/engineering/issues/3825

Summary by CodeRabbit

  • New Features

    • Added automatic macOS installation to the Applications folder when launching the app.
    • Added progress, replacement, manual recovery, and Finder guidance for installation scenarios.
    • Added localized installation prompts with placeholder support and fallback translations.
  • Bug Fixes

    • Prevented existing installations from being overwritten and ensured failed or interrupted installations are cleaned up safely.
  • Tests

    • Added comprehensive coverage for installation, localization, symlink handling, failures, and background operations.

Copilot AI lite review requested due to automatic review settings September 16, 2026 11:53
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 13512c65-3153-4d93-b862-81dc7c966cd9

📥 Commits

Reviewing files that changed from the base of the PR and between 14defc5 and 88092d0.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • .github/workflows/swift-compile-check.yml
  • assets/locales/en.po
  • macos/Runner.xcodeproj/project.pbxproj
  • macos/Runner/AppInstallation.swift
  • macos/Runner/main.swift
  • macos/RunnerTests/AppInstallationTests.swift
  • pubspec.yaml
  • scripts/macos/generate_installation_strings.dart

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


📝 Walkthrough

Walkthrough

The macOS runner now checks whether the app is installed under /Applications, offers automatic or manual installation, copies bundles atomically, generates localized installation resources, and runs the check in release builds. Tests cover installation, cleanup, concurrency, localization, and quarantine handling.

Changes

macOS installation flow

Layer / File(s) Summary
Installation localization pipeline
assets/locales/en.po, scripts/macos/generate_installation_strings.dart, pubspec.yaml, macos/Runner.xcodeproj/project.pbxproj
Adds installation messages, placeholder-safe locale fallback handling, Apple locale conversion, and an Xcode build phase that generates AppInstallation.strings resources.
Installation mechanics and preflight UI
macos/Runner/AppInstallation.swift, macos/RunnerTests/AppInstallationTests.swift
Adds /Applications detection, quarantine handling, staged atomic copying, background installation, localized alerts, relaunch handling, recovery actions, and comprehensive XCTest coverage.
Native target and release startup integration
macos/Runner.xcodeproj/project.pbxproj, macos/Runner/main.swift
Registers the installer and tests in the Xcode targets and runs the installation preflight before release application startup.

Swift compile workflow documentation

Layer / File(s) Summary
Native check workflow comment
.github/workflows/swift-compile-check.yml
Updates the comment to state that every pull request receives an explicit skipped or completed native check.

Priority: ⬆️ High

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature · Severity of issue fixed: High

Sequence Diagram(s)

sequenceDiagram
  participant main.swift
  participant AppInstallationPreflight
  participant AppInstallation
  participant NSWorkspace
  main.swift->>AppInstallationPreflight: run()
  AppInstallationPreflight->>AppInstallation: installInBackground()
  AppInstallation->>AppInstallation: copy and atomically publish bundle
  AppInstallation-->>AppInstallationPreflight: return installation result
  AppInstallationPreflight->>NSWorkspace: launch installed app
Loading

Suggested reviewers: jigar-f

Merge Risk: ⚪ Minimal · up to 88092

The installation preflight, relaunch flow, and localized resources appear mergeable with normal checks.

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The installation code, generated strings, build integration, dependency, and tests support #3825. The .github/workflows/swift-compile-check.yml change only updates a workflow comment about PR filter… Remove the unrelated workflow-comment change from this pull request, or provide a direct implementation link to #3825.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 3 files. (5 skipped: 5… Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive The PR implements the main requirement in #3825. Release builds run AppInstallationPreflight before NSApplicationMain, block apps outside /Applications, provide automatic and Finder recovery, an… Provide reviewable evidence of the current SSE retry behavior and tests, or make the required retry suppression and user-facing authorization handling changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main user-facing change: prompting macOS users to move Lantern to Applications. It is concise and specific.
Full details: Linked Issues check

Explanation

The PR implements the main requirement in #3825. Release builds run AppInstallationPreflight before NSApplicationMain, block apps outside /Applications, provide automatic and Finder recovery, and add Swift tests. The summary provides no evidence that persistent SSE authorization failures are no longer retried. Existing SSE behavior is not available for review, so compliance with that proposed coding requirement cannot be established.

Full details: Out of Scope Changes check

Explanation

The installation code, generated strings, build integration, dependency, and tests support #3825. The .github/workflows/swift-compile-check.yml change only updates a workflow comment about PR filtering. The summary shows no connection between that comment and the macOS installation safeguard.

Full details: Docstring Coverage

Explanation

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

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch atavism/issue-3825

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

Check the installation path before native app startup. Offer background copying and relaunch for eligible apps, with Finder instructions for quarantine, existing installations, and copy failures.

Generate native dialog strings from the existing translation catalogs and cover installation safeguards with Swift unit tests.

Refs getlantern/engineering#3825.

Copilot AI left a comment

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.

🔵 Needs a closer look

Release-only preflight paths need coverage before approval.

Pull request overview

Adds a macOS installation preflight requiring Lantern to run from /Applications, with background copying, relaunch support, Finder fallback, localization, and tests.

Changes:

  • Added installation and preflight UI logic.
  • Added localized strings and generation tooling.
  • Added native tests and Xcode build integration.
  • Updated dependency and CI configuration.

Review note: Release-only preflight branches are not exercised by the current Debug-only test workflow.

File summaries
File Description
scripts/macos/generate_installation_strings.dart Generates native localized strings
pubspec.yaml Adds gettext parser dependency
pubspec.lock Locks the dependency
macos/RunnerTests/AppInstallationTests.swift Tests installation behavior
macos/Runner/main.swift Runs the preflight before app startup
macos/Runner/AppInstallation.swift Implements installation logic and preflight UI
macos/Runner.xcodeproj/project.pbxproj Wires sources, tests, localization, and build phases
assets/locales/en.po Adds English installation messages
.github/workflows/swift-compile-check.yml Updates CI workflow documentation
Review details

Suppressed comments (1)

macos/Runner/AppInstallation.swift:131

  • Because main.swift excludes this preflight in DEBUG and make macos-unit-tests runs only the Debug configuration, CI never exercises these release-only branches (including the Finder/destination routing and Move and Relaunch path). A regression could ship while all of the new filesystem tests pass; add a release-mode launch smoke test or inject the alert/workspace dependencies so these branches can be tested.
    guard !installation.isInstalled else { return true }

    let app = NSApplication.shared
    app.setActivationPolicy(.regular)
    app.activate(ignoringOtherApps: true)
  • Files reviewed: 8/9 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants