Skip to content

feat: add first-launch onboarding page with macOS permissions guide#1

Merged
Micro66 merged 1 commit into
mainfrom
wegent-onboarding-page
Apr 17, 2026
Merged

feat: add first-launch onboarding page with macOS permissions guide#1
Micro66 merged 1 commit into
mainfrom
wegent-onboarding-page

Conversation

@qdaxb
Copy link
Copy Markdown
Contributor

@qdaxb qdaxb commented Apr 16, 2026

Summary

  • Onboarding trigger: On first launch (hasCompletedOnboarding === false), the app navigates to /onboarding instead of the main screen. The flag is persisted in globalStore (Valtio + JSON file).
  • Onboarding page (src/pages/Onboarding/index.tsx): Single-scroll page with three sections:
    1. Privacy & Open Source – WeCut logo, privacy statement, GitHub link.
    2. macOS Permissions (unlock condition for "Complete" button) – Cards for Accessibility, Screen Recording, and Full Disk Access, each showing live granted/not-granted status (polled every 1 s) and an "Authorize" button.
    3. Wegent Key (optional) – Informational card with a shortcut to open Preferences → Wegent tab.
  • "Complete" button is disabled (greyed out + tooltip) until all three permissions are granted. No "Skip" button.
  • i18n keys added for zh-CN, en-US, ja-JP, zh-TW under the onboarding namespace.
  • PREFERENCE_NAVIGATE event added to LISTEN_KEY; Preference window listens for it to jump to a specific tab.

Test plan

  • Fresh install (no store.json) → app opens /onboarding
  • Existing install with hasCompletedOnboarding: true → app goes directly to /
  • All three permission cards reflect real-time status correctly
  • "Authorize" buttons open the correct macOS system permission dialogs
  • Returning from System Settings updates the card within ~1 s
  • "Complete" button is disabled while any permission is missing; enabled when all three are granted
  • Clicking "Complete" sets hasCompletedOnboarding = true, saves store, navigates to /
  • "Go to Preferences" button opens Preference window on the Wegent tab
  • Dark/light mode renders correctly
  • All four locale files display correct text

- Add hasCompletedOnboarding flag to GlobalStore (types + store init)
- Register /onboarding route and auto-redirect on first launch in App.tsx
- Create Onboarding page with privacy declaration, 3-permission cards
  (Accessibility, Screen Recording, Full Disk Access), optional Wegent Key
  section, and sticky "Complete" button gated on all permissions granted
- Poll permission status every 1 s so UI refreshes when user returns from
  System Settings
- Add PREFERENCE_NAVIGATE event key; handle it in Preference to jump to a
  specific tab (used by Onboarding → Wegent tab shortcut)
- Add i18n keys for zh-CN, en-US, ja-JP, zh-TW
@Micro66 Micro66 merged commit be3898b into main Apr 17, 2026
0 of 2 checks passed
@qdaxb qdaxb deleted the wegent-onboarding-page branch April 22, 2026 09:45
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