Skip to content

chore(desktop): remove the retired onboarding wizard views - #12652

Merged
Git-on-my-level merged 3 commits into
mainfrom
chore/remove-legacy-onboarding-views
Sep 4, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
chore/remove-legacy-onboarding-views

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

Summary

The macOS desktop still shipped ~7,200 lines of retired step-wizard onboarding (OnboardingView and its step views). Nothing live mounts that wizard: DesktopHomeView presents SBOnboardingView, and we are keeping that flow (including the three-doors demo). This PR deletes the unmounted SwiftUI views and their dedicated tests.

Two types lived in those files but still have live callers, so they were extracted rather than deleted:

  • OnboardingChatPersistence — used by SBOnboardingModel, OnboardingPagedIntroCoordinator, OnboardingRerunPolicy, AuthService, AppState, and ChatToolExecutor to persist mid-onboarding state across restarts and sign-out.
  • AnimatedGIFView — used by PermissionsPage and BrowserExtensionSetup.

The screenshot-export harness no longer constructs OnboardingView. Comments in ChatToolExecutor and FloatingControlBarWindow no longer name the deleted chat view. Tests that inspected the deleted files were trimmed; ShortcutSettingsTests now persist presets through the live SBOnboardingModel.pickShortcut API.

Failure class

Failure-Class: none

Product invariants affected

scripts/pr-preflight --suggest reported none; the full --pr-body-file run required INV-CHAT-1 because ChatToolExecutor.swift and FloatingControlBarWindow.swift match that glob.

Path-glob check of the files this PR touches:

  • INV-UI-1 matches desktop/macos/Desktop/Sources/**. Its PR rule opts out of naming; the brand ratchet still applies. This change only deletes UI and extracts existing chrome — it does not add purple.
  • INV-CHAT-1 matches ChatToolExecutor.swift and FloatingControlBarWindow.swift. Both edits are comments only. The live onboarding entry point (DesktopHomeView → SBOnboardingView) and the chat write path are unchanged.

Every deletion is a file whose SwiftUI type had no live mount. Shared helpers that still have live referents were kept (OnboardingFlow, OnboardingPromptSuggestions / PostOnboardingPromptSuggestions, OnboardingAnswerWriteGate, OnboardingImportEvidenceService, OnboardingMemoryLogImportService, OnboardingWebResearchService, OnboardingPagedIntroCoordinator, OnboardingGlassChrome, PermissionDragGuidance, OnboardingRerunPolicy).

Verification

  • scripts/pr-preflight --pr-body-file PR-BODY.md — passed, 22 checks (same manifest the pre-push hook runs). First pass failed desktop-swiftlint on omi_inline_userdefaults_key in the extracted OnboardingChatPersistence.clear() (inline "onboardingACPSessionId" / "onboardingChatMessages"). Fixed by adding those keys to DefaultsKey and calling removeObject(forKey: .…). Did not touch the SwiftLint baseline and did not add swiftlint:disable.
  • cd desktop/macos && xcrun swift build -c debug --package-path Desktop — passed (after extracting the two live types that first failed to compile).
  • python3 desktop/macos/scripts/check_desktop_test_quality.py — passed; ratcheted SOURCE_INSPECTION_SITE_BASELINE 147 → 146.
  • python3 desktop/macos/scripts/desktop-flow-lint.py — desktop-flow-lint OK (74 flows, 188 registered actions).
  • desktop/macos/scripts/swift-format-wrapper.sh lint on every changed Swift file — clean.
  • xcrun swift test --package-path Desktop --filter 'OnboardingFlowTests|GoalGenerationServiceTests|AgentVMWarmupAdoptionTests|ShortcutSettingsTests|OnboardingPermissionToolTests|OnboardingPersistenceClearingTests|OnboardingGlassChromeTests|OnboardingRerunPolicyTests' — 78 tests, 0 failures.
  • xcrun swift test --package-path Desktop (unfiltered) — compiled and ran hundreds of suites with 0 XCTest failures, then the xctest process aborted with signal 6 during FloatingBarUsageLimiterTests (not touched by this PR).
  • desktop/macos/scripts/swift-test-suites.sh — 745 suites in isolation. One failure: HubEscalationTests.testPublicWebPromptIsSpeakableAndExcludesPrivateToolContext (XCTAssertTrue at HubEscalationTests.swift:87).
  • HubEscalation A/B: same filter on a throwaway worktree detached at clean origin/main 15eca77b622ee5ed84d3542a46a4027993f69896 (fix(desktop): PTT on a second display responds to the first press (#12646)). Identical failure: XCTAssertTrue at HubEscalationTests.swift:87 in testPublicWebPromptIsSpeakableAndExcludesPrivateToolContext. This branch did not cause it.
  • FloatingBarUsageLimiterTests A/B: the same origin/main SHA ran FloatingBarUsageLimiterTests to completion — 18 tests, 0 failures, no signal-6 abort. The abort was only seen in an unfiltered full-package run on this branch; this PR does not touch limiter sources. Cheap check does not reproduce it on origin/main.
  • desktop/macos/scripts/run-swift-ci.sh --select-toolchain — failed: Xcode 16.4 is not installed at /Applications/Xcode_16.4.app. Local swift build therefore cannot see the strict-concurrency errors CI rejects.
  • Named-bundle first-run walkthrough was not run: this PR does not change the live onboarding path.

Line-count exceptions

None. New code went into new files (OnboardingChatPersistence.swift, AnimatedGIFView.swift).

Line delta vs this branch's merge-base (git diff --stat 8cf10a60f131...HEAD): 37 files, 127 insertions, 7573 deletions.

git diff --stat origin/main as requested: 52 files, 182 insertions, 8796 deletions. That mix is not this PR: COMMON.md forbade rebasing, and this worktree is now 2 commits ahead / 4 behind origin/main.

🤖 Generated with Claude Code

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 37 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@Git-on-my-level
Git-on-my-level force-pushed the chore/remove-legacy-onboarding-views branch from afd7ea3 to b5b366b Compare September 3, 2026 17:16
Git-on-my-level and others added 3 commits September 4, 2026 04:18
The live first-run path is SBOnboardingView. These SwiftUI step views have been unmounted since the Second Brain redesign; keep the shared persistence helper and GIF view that still have live callers.

Co-Authored-By: Claude Opus 5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
…DefaultsKey

Pinned SwiftLint rejects inline forKey: string literals. The two keys were already being cleared; this just names them in DefaultsKey so the gate stays green without a baseline bump or disable.

Co-Authored-By: Claude Opus 5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
- ViewExporter: standaloneViewCount 17 -> 14 to match the registry after
  dropping 12-onboarding; runBatch iterates 0..<count so stale indices
  spawned failing unknown-14/15/16 exports
- AnimatedGIFView: reload the GIF in updateNSView via a coordinator when
  gifName changes, so a reused representable never shows a stale image
- OnboardingChatPersistence: route the remaining keys through DefaultsKey
  (compile-checked, omi_inline_userdefaults_key gate) and drop the four
  members whose only caller was the retired wizard view
  (save/loadExplorationState, isExplorationCompleted, isToolCompleted);
  clear() still wipes every legacy key from disk

Verified: xcrun swiftc -parse clean on all changed files; registry/count
asserted equal (14); removed members have zero repo-wide references.
@Git-on-my-level
Git-on-my-level force-pushed the chore/remove-legacy-onboarding-views branch from b5b366b to 9a16cca Compare September 3, 2026 21:51
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Addressed all four Cubic review threads in 9a16cca (rebased onto current main):

  • ViewExporter standaloneViewCount (thread 1, conf 9): count was 17 while the registry holds 14 entries after dropping 12-onboarding; runBatch iterates 0..<count, so indices 14–16 spawned failing unknown-N exports. Set to 14 with a comment tying it to the registry length.
  • AnimatedGIFView stale GIF (thread 2, conf 7): updateNSView now reloads the image when gifName changes (coordinator tracks the loaded name), so a reused representable can't show the previous GIF even without the caller's .id(gifName).
  • OnboardingChatPersistence keys through DefaultsKey (thread 3, conf 7): all five keys are now compile-checked enum cases with typed accessors, satisfying the omi_inline_userdefaults_key gate convention. (The prior head already moved the two clear() legacy keys; this completes the set.)
  • Dead members (thread 4, conf 8): removed save/loadExplorationState, isExplorationCompleted, and isToolCompleted — their only caller was the retired wizard view. clear() still wipes every legacy key from disk so old installs don't leak state across accounts.

Verification: full app target compiled clean as part of the bounded pre-push gate (which also ran flow-lint, swift-format, SwiftLint baseline, changelog, and diff-hygiene checks); xcrun swiftc -typecheck clean on the changed sources; registry/count equality asserted (14); removed members confirmed to have zero repo-wide references. All four threads resolved; desktop Swift checks are running on the new head.

@Git-on-my-level
Git-on-my-level merged commit 05b3f78 into main Sep 4, 2026
30 of 36 checks passed
@Git-on-my-level
Git-on-my-level deleted the chore/remove-legacy-onboarding-views branch September 4, 2026 07:00
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