Skip to content

feat(desktop): drag-to-grant helper for Screen Recording & Full Disk Access onboarding - #9742

Merged
Git-on-my-level merged 10 commits into
mainfrom
feat/desktop-drag-to-grant
Jul 14, 2026
Merged

Git-on-my-level merged 10 commits into
mainfrom
feat/desktop-drag-to-grant

Conversation

@skanderkaroui

@skanderkaroui skanderkaroui commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

What

Isolates the desktop drag-to-grant onboarding helper for macOS permissions into its own branch (cherry-picked clean off main, no unrelated folders/tasks/scheduler changes).

During onboarding, when a permission is denied Omi opens the relevant System Settings pane and presents a small drag-only overlay card: the user drags the app icon into the Screen Recording / Full Disk Access list to add and enable it in a single gesture.

Included behavior

  • Drag-to-grant helper overlay for the Screen Recording grant flow, presented from the request choke point (ScreenCaptureService).
  • Same mechanic reused for Full Disk Access.
  • Card anchored in the bottom quarter of the screen; icon hidden while its drag is in flight; idle up-nudge hint on icon + chevron.
  • Card auto-dismisses when the permission is granted/skipped or when the user closes System Settings.
  • Onboarding restart deferred from Screen Recording to Full Disk Access; Reopen prompt shown after the last restart-carrying permission.

Root cause / why

Not a bug fix — a UX improvement that removes the "find the toggle in a long Settings list" friction that caused users to stall during permission onboarding. The drag gesture adds and enables the app in one motion.

Product invariants

Path-matched (not intent-based) invariants touched by these files:

  • INV-CHAT-1 — matched via ChatToolExecutor.swift / OnboardingChatView.swift. No chat-continuity behavior changed; only the full_disk_access / screen_recording permission branches now trigger the drag helper.
  • INV-INT-1 — matched via CloudConnectorGuidanceOverlay.swift / connector automation paths. Integrations harness behavior unchanged; the overlay component is reused to render the drag card.

Neither invariant's guarded behavior changed, so no guard-test updates are required.

Verification

Cherry-picked the 9 drag-to-grant commits cleanly onto fresh origin/main; single conflict in ChatToolExecutor.swift (full_disk_access case) resolved to keep main's owner-authorization logic and add the drag helper. diff --stat vs main is desktop Swift + one changelog fragment + one e2e-coverage entry only — no backend/app leakage.

Built and tested on a Mac mini (Apple Silicon):

  • make preflight — 13/13 checks pass.
  • xcrun swift build -c debug --package-path Desktop — Build complete (exit 0).
  • OMI_SWIFT_TEST_SUITE_WORKERS=4 ./scripts/swift-test-suites.sh — 284/285 suites pass.

The one failing suite (ScreenRecordingPermissionPolicyTests.testDragPayloadIsAFileURL) is an OS artifact of the build box, not this change: the mini runs macOS 26.5, where a headless test process cannot own a named NSPasteboard (writeObjects/declareTypes return a 0 change-count for any file URL, verified with a standalone script independent of this code). CI runs on macos-15, where pasteboard ownership works and the test passes. The product path is unaffected — the running GUI app owns the pasteboard normally.

Changelog

desktop/macos/changelog/unreleased/20260713-screen-recording-drag-to-enable.json

Review in cubic

When Screen Recording is denied, every grant path (permission pages, onboarding
button, the AI request_permission tool where macOS opens Settings itself) now
presents a small overlay next to System Settings carrying the app icon. The
icon is a real AppKit dragging session writing the app bundle's file URL — the
same payload as dragging the app out of Finder — so dropping it into the
Screen & System Audio Recording list adds and enables the app in one gesture.
The drag image re-anchors under the cursor on every move event (mid-session
setDraggingFrame disables AppKit's own tracking) and shrinks as it enters the
Settings window. Remembers a successful grant (screenRecordingPreviouslyGranted)
so a later removal re-prompts instead of stranding the user on a bare toggle.

Verified: built omi-screen-drag named bundle, exercised the grant flow live
(Settings + overlay appear, icon tracks the cursor, drop enables the toggle);
ScreenRecordingPermissionPolicyTests 11/11 pass.
The overlay kept painting the app icon while the dragged copy followed the
cursor, so the icon looked duplicated instead of picked up. Skip drawing the
source icon during the dragging session and restore it on end/cancel.
…the screen

Centered on the Settings window horizontally, vertically centered within the
bottom quarter — below the list, so the card never covers the drop target.
Adds a placement unit test.
Rename ScreenRecordingGrantGuidance to PermissionDragGuidance (it was already
app-generic) and present the same drag card when the Full Disk Access pane is
opened — from the request_permission tool and the onboarding settings button.
Dropping the app into the FDA list adds and enables it in one gesture, same as
Screen Recording.
… Disk Access

Screen Recording no longer asks for a restart mid-flow; Full Disk Access (the
next step) now carries requiresRestart, so the user grants both permissions
and the app restarts once at the end — the restart applies both grants.
…kipped

The floating drag icon lingered after the user skipped or granted. Add
PermissionDragGuidance.dismiss() and call it from the skip confirmations
(chat + paged flows) and on permission-granted.
The resting card now gently drifts the app icon and chevron upward on a slow
autoreversing loop so it reads as 'drag me up into the list'. Respects
reduce-motion (static when set).
… permission

The paged permission step's requiresRestart flag was an unused stored prop.
Wire it: once the restart-carrying step (the second/last drag permission,
Full Disk Access) is granted, present a Reopen Omi prompt instead of silently
advancing — one restart applies every deferred grant. Also dismisses the drag
card at that point.
The drag card followed Settings when it opened but lingered (up to 60s) after
the user closed the window. Give the overlay a settingsWatchTask that owns the
whole lifecycle: re-anchor over the Settings window while it's open, and dismiss
the card the moment the window disappears. Cancelled on dismiss/re-present.
Removes the now-redundant reposition loop from PermissionDragGuidance.
@Git-on-my-level
Git-on-my-level merged commit d06f799 into main Jul 14, 2026
22 of 25 checks passed
@Git-on-my-level
Git-on-my-level deleted the feat/desktop-drag-to-grant branch July 14, 2026 22:03
Git-on-my-level added a commit that referenced this pull request Jul 20, 2026
#9847)

## Summary

Onboarding UX improvements + fixes for the macOS desktop app.

- **Navigation:** Back button on every step past the first + arrow-key
step nav (`OnboardingStepScaffold`, `OnboardingView`, all step views).
- **Floating-bar demo:** one-line prompt, keycaps light up while the
shortcut is physically held, white glow on the bar (reuses the voice
glow), removed the up-arrow.
- **Reach-error card:** actionable "Couldn't reach Omi — Error <code>"
card on the floating bar with Retry / Skip (UI + seam; not yet wired to
the live exhausted-retry path).
- **Memory-log import:** capture recency tiers
(`[recent]`/`[earlier]`/`[long-term]`) not just exact dates, matching
how ChatGPT/Claude actually export.
- **How-did-you-hear:** keep first-selection auto-advance.
- **Apple name (display side):** refresh the onboarding name when it
arrives async instead of freezing `"there"`; persist Apple first-auth
name server-side.
- Merges `feat/desktop-drag-to-grant` (#9742) and latest `main`.

## Product invariants affected

- INV-AUTH-1
- INV-CHAT-1
- INV-INT-1 (`CalendarReaderService`/`GmailReaderService` reader-service
surfaces pulled in via merged `main`)
- INV-MEM-1 (memory adapter test files touched by the frozen-clock fixes
merged with `main`)

## Verification

- `xcrun swift build -c debug` green after each change.
- Built + ran the named bundle `omi-onb-arrow` throughout; verified the
reach-error card via the `debug_reach_error` bridge action (in-process
PNG capture).

## Known follow-ups (not in this PR)

- **Apple name root cause is backend:** `POST /v1/auth/callback/apple`
drops Apple's `user` (name) form field, so the desktop display fix alone
won't populate the name for Apple sign-ups. Backend fix tracked
separately.
- Regression tests for the name refresh + reach-error.
- Wire the reach-error card to the real exhausted-retry path.

Failure-Class: none
Git-on-my-level added a commit that referenced this pull request Jul 22, 2026
…n redesign (#10340)

## Summary

Restores onboarding functionality that the Second Brain redesign
(#10218) dropped, re-implemented on top of the new conversational design
(no old UI brought back). Each fix is its own commit:

- **Auto-detect user name** (#9919) — seed the name field from the known
`givenName`, kick a backend name fetch, and adopt an async name arrival
(Apple sends the name only on first auth), so onboarding greets by name
instead of a generic placeholder. Also re-hydrates name/language/role
drafts on resume.
- **Clear onboarding state on sign-out** (#10108) —
`sbOnboardingResumeStep` + `onboardingRole` were added by the redesign
but left out of the shared clearing list, leaking the prior user's
resume step + role to the next account on the same Mac. Added both, plus
a regression test.
- **Drag-to-grant Full Disk Access** (#9742) — the drag-to-grant helper
was wired for Screen Recording but not FDA; now both use it.
- **Connector brand marks + Claude Code restart** (#10210 / #10205) —
connect rows show each connector's brand icon, and Claude Code shows a
restart prompt once connected so running sessions reload the new MCP
config.
- **Remove post-onboarding walkthrough** — the coach-mark tour that ran
after onboarding (spotlighting each nav pill) is deleted; a
just-onboarded user lands straight on Home.
- **Pin the drag-to-grant card under System Settings** — the permission
drag card was pinned to the screen's bottom quarter; it now anchors
directly beneath the live Settings window (flipping above it when
there's no room below) so it follows the window and never covers the
drop target.

## Verification

Build/manual verification pending — depends on #10334 (restores the
`Package.swift`/`Package.resolved` that a stray "fixture" commit gutted
on `main`, which currently breaks the desktop Swift build). This PR
carries no Package changes; once #10334 lands and this rebases, it
builds on the repaired manifest.

## Product invariants affected

- INV-INT-1

## Failure class (fixes)

Failure-Class: none


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/10340?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
BasedHardware#9847)

## Summary

Onboarding UX improvements + fixes for the macOS desktop app.

- **Navigation:** Back button on every step past the first + arrow-key
step nav (`OnboardingStepScaffold`, `OnboardingView`, all step views).
- **Floating-bar demo:** one-line prompt, keycaps light up while the
shortcut is physically held, white glow on the bar (reuses the voice
glow), removed the up-arrow.
- **Reach-error card:** actionable "Couldn't reach Omi — Error <code>"
card on the floating bar with Retry / Skip (UI + seam; not yet wired to
the live exhausted-retry path).
- **Memory-log import:** capture recency tiers
(`[recent]`/`[earlier]`/`[long-term]`) not just exact dates, matching
how ChatGPT/Claude actually export.
- **How-did-you-hear:** keep first-selection auto-advance.
- **Apple name (display side):** refresh the onboarding name when it
arrives async instead of freezing `"there"`; persist Apple first-auth
name server-side.
- Merges `feat/desktop-drag-to-grant` (BasedHardware#9742) and latest `main`.

## Product invariants affected

- INV-AUTH-1
- INV-CHAT-1
- INV-INT-1 (`CalendarReaderService`/`GmailReaderService` reader-service
surfaces pulled in via merged `main`)
- INV-MEM-1 (memory adapter test files touched by the frozen-clock fixes
merged with `main`)

## Verification

- `xcrun swift build -c debug` green after each change.
- Built + ran the named bundle `omi-onb-arrow` throughout; verified the
reach-error card via the `debug_reach_error` bridge action (in-process
PNG capture).

## Known follow-ups (not in this PR)

- **Apple name root cause is backend:** `POST /v1/auth/callback/apple`
drops Apple's `user` (name) form field, so the desktop display fix alone
won't populate the name for Apple sign-ups. Backend fix tracked
separately.
- Regression tests for the name refresh + reach-error.
- Wire the reach-error card to the real exhausted-retry path.

Failure-Class: none
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