Skip to content

feat: add first-launch onboarding window and reopen handler - #43

Open
bebricoOOOOOOf wants to merge 1 commit into
bysiber:mainfrom
bebricoOOOOOOf:feat/first-launch-welcome-window
Open

feat: add first-launch onboarding window and reopen handler#43
bebricoOOOOOOf wants to merge 1 commit into
bysiber:mainfrom
bebricoOOOOOOf:feat/first-launch-welcome-window

Conversation

@bebricoOOOOOOf

Copy link
Copy Markdown

Motivation & Problem

ClearDisk is configured as a menu-bar-only application (LSUIElement = true, activation policy .accessory). When users launch the app for the very first time from Finder, Launchpad, or Spotlight, no window appears and no icon is placed in the Dock.

On MacBooks with a notch or systems with crowded menu bars, the status item can easily be hidden behind the camera notch or lost among other icons, leading users to believe the app crashed or failed to launch. Furthermore, subsequent launches from Finder or Spotlight do nothing when the app is already running.

Proposed Changes

  1. First-Launch Welcome Window (WelcomeWindow.swift):

    • On first launch (tracked via UserDefaults), the app temporarily uses .regular activation policy and displays a centered, standalone Welcome window.
    • Displays a simulated macOS menu bar with a visual arrow pointing to the top-right corner where ClearDisk's disk space indicator lives.
    • Explains that ClearDisk operates quietly in the menu bar and provides advice for MacBooks with a camera notch.
    • Includes a "Got it! Go to Menu Bar" button that smoothly transitions the app to .accessory policy and reveals the status popover.
  2. Relaunch Handling (ClearDiskApp.swift):

    • Implemented applicationShouldHandleReopen(_:hasVisibleWindows:) in AppDelegate.
    • If the user relaunches ClearDisk from Finder or Spotlight while it is already running in the background, it reveals the menu bar popover instead of silently doing nothing.
  3. Translations (Localizable.strings):

    • Added Turkish translations for the new welcome/onboarding strings.
  4. Build Script Improvement (scripts/build_app.sh):

    • Staged code signing in a clean temporary directory to prevent com.apple.provenance extended attribute errors when building inside iCloud-synced directories (e.g. ~/Documents).

Verification

  • Tested clean first launch: Welcome window appears centered with full focus and Dock icon.
  • Tested clicking "Got it! Go to Menu Bar": transitions to menu bar accessory mode, dismisses Dock icon, and opens popover.
  • Tested subsequent relaunch via open /Applications/ClearDisk.app: popover opens reliably.
  • Built and signed release arm64 bundle cleanly with build_app.sh.

This change introduces a standalone onboarding window on first launch to guide users to the macOS menu bar, and handles app relaunch events:

- Show a standalone Welcome window centered on screen on the first launch on a device (tracked via UserDefaults).
- Display a simulated macOS menu bar with a visual pointer pointing to the status item (displaying live free disk space) so users know where ClearDisk lives.
- Provide advice for users with crowded menu bars or MacBooks with a camera notch.
- Provide a 'Got it! Go to Menu Bar' button that transitions the app to .accessory mode and opens the menu bar popover.
- Implement applicationShouldHandleReopen in AppDelegate to toggle the popover/interface whenever the app is reopened from Finder or Spotlight.
- Add Turkish translations for the onboarding strings.
- Stage code signing in a clean temporary directory in build_app.sh to avoid iCloud Drive com.apple.provenance detritus errors.
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