Repository navigation
feat(app): end onboarding with a first capture - #21396
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7be5b4a4e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @override | ||
| Future<ServerConversation?> finish() async { | ||
| final response = await capture.finishCaptureWithResult(); | ||
| _started = false; |
There was a problem hiding this comment.
Fence a timed-out finish before allowing retry
When Process Now takes longer than the controller's 90-second deadline, Future.timeout returns control without cancelling this finish() future, so the UI enables Try Again and start() begins a new recording on the same IO instance. If the old request then completes, this assignment clears the new attempt's shared _started flag; pressing Back or Skip afterward makes cancel() return early and leaves the phone microphone recording after onboarding has been exited. Track finish/start state per attempt or prevent retry until the timed-out operation is fenced.
AGENTS.md reference: app/AGENTS.md:L106-L110
Useful? React with 👍 / 👎.
| _controller = TabController(length: kPageCount, vsync: this); | ||
| _controller!.addListener(() { | ||
| if (!mounted) return; | ||
| _stepTelemetry.enter(_controller!.index); |
There was a problem hiding this comment.
Mark acquisition-source skips before advancing
When the user presses the explicit Skip button on FoundOmiWidget, _skip() invokes the same goNext callback as a submitted source, so this new transition tracker exits acquisition_source while skipped is still false. Consequently every acquisition-survey skip is recorded as a completed, non-skipped step, corrupting the onboarding funnel this event was added to measure; pass a distinct skip callback or set the tracker flag before advancing.
Useful? React with 👍 / 👎.
| paired = !failed && | ||
| context.read<OnboardingProvider>().isConnected && | ||
| context.read<OnboardingProvider>().deviceType == DeviceType.omi; |
There was a problem hiding this comment.
Restrict the Omi pairing handoff to Omi devices
When a user selects any supported non-Omi device from the reused ConnectDevicePage, FoundDevices._devicesList permits the connection and its onboarding callback pops the pairing route, but this type check then silently rejects the successful connection. The generic page includes Apple Watch, Ray-Ban, and other device types, so those users are returned to the choice screen with no error despite having paired successfully; filter this handoff's device list to Omi devices or handle the other successful types explicitly.
Useful? React with 👍 / 👎.
| final process = _processInProgressConversationOverride ?? | ||
| () => processInProgressConversation(throwOnFailure: confirmedProcessing); | ||
| final request = process(); | ||
| _lastProcessRequest = request; |
There was a problem hiding this comment.
Keep the guided capture's Process Now request attempt-scoped
If another Process Now trigger starts while the guided Finish is awaiting its request—for example, a connected pendant's configured double-tap handler calls forceProcessingCurrentConversation()—this shared slot is overwritten by the later request. finishCaptureWithResult() reads the slot only after its coordinator dispatch completes, so it can return the later request's 404/null or conversation instead of the response for the guided phone capture, incorrectly showing Delayed/Empty or the wrong result. Return the request through the owning coordinator outcome or key it by capture/session generation.
AGENTS.md reference: app/AGENTS.md:L106-L110
Useful? React with 👍 / 👎.
| surface: ProductSurface.onboarding, | ||
| ); | ||
| } | ||
| _stepTelemetry; // Start timing the first visible step. |
There was a problem hiding this comment.
Initialize telemetry at the resumed onboarding step
For an already-signed-in user resuming incomplete onboarding, the wrapper constructs this tracker at its default auth index and only moves the TabController to _resumeStep() in the post-frame callback. That automatic move calls enter(), which emits an Onboarding Step Completed event for Auth even though no authentication occurred; every restart can therefore add another false Auth completion and distort step conversion and dwell metrics. Initialize or reset the tracker to the resolved starting index without emitting an exit.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 465eaa1060
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Completion belongs to the persisted wrapper route, even when invoked | ||
| // from a phone/Watch child. Replace that owner with Home, not the child. | ||
| final owner = ModalRoute.of(context); | ||
| if (owner != null) Navigator.of(context).popUntil((route) => route == owner); |
There was a problem hiding this comment.
Wait for completion persistence before popping the result
When a phone or Watch child invokes _complete(), this pops the child before the wrapper's asynchronous OnboardingSyncRuntime.enqueue(completed: true) has succeeded. If that enqueue returns false, the wrapper correctly remains in onboarding and shows an error, but the successful capture result or Watch instructions have already been discarded, leaving the user at the choice screen and forcing them to repeat the flow or skip rather than retry completion. Keep the child mounted until the completion callback reports success, or preserve a retryable completed state.
Useful? React with 👍 / 👎.
| final connected = await Navigator.of(context).push<bool>(omiPageRoute( | ||
| builder: (routeContext) => ConnectDevicePage( |
There was a problem hiding this comment.
Bypass pairing when the Omi is already connected
If Omi pairing succeeds but completion persistence fails, OnboardingProvider.isConnected remains true when the user returns to this choice screen. Pressing the Omi option again always pushes ConnectDevicePage, whose connected state hides both the device list and bottom actions, while onConnected is only fired by a new device tap; the user is therefore stranded on a “Pairing successful” page with no way to retry completion except backing out and choosing another path. Detect the already-connected Omi before pushing this route or expose a Continue action for that state.
Useful? React with 👍 / 👎.
| fontWeight: FontWeight.w600, fontFamily: Theme.of(context).textTheme.labelLarge?.fontFamily), | ||
| key: const Key('onboarding_complete_start'), | ||
| label: context.l10n.firstCaptureSkip, | ||
| onPressed: _routing ? null : _skip), |
There was a problem hiding this comment.
Disable Skip before emitting its completion events
On the capture-choice screen, _skip returns synchronously and never sets _routing, even though its onComplete callback starts an asynchronous persistence operation. OmiButton therefore does not enter its Future-backed loading state, so a normal double tap before enqueue completes calls _choose, emits OnboardingFirstCaptureSkipped, and invokes onSkipped twice; the wrapper's downstream _finishing guard prevents the second save but cannot undo the duplicate analytics events. Disable this action immediately or return the completion Future through the button callback.
Useful? React with 👍 / 👎.
| if (widget.onConnected != null) { | ||
| widget.onConnected!(); |
There was a problem hiding this comment.
Drop pairing completion after Connect is dismissed
If the user presses Back while a device connection is still running—especially during handleTap's two-second post-connect settle—the provider can later invoke this goNext closure after ConnectDevicePage has been disposed. The closure still calls onConnected, which performs Navigator.of(routeContext) on the deactivated route context; that throws into OnboardingProvider.handleTap's broad catch, which then marks DeviceProvider disconnected even though the hardware connection succeeded. Check this state's mounted status or otherwise invalidate the pending callback when the route is dismissed.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…capture Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c421e923a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "reviewProposalConflict": "Ceci a changé depuis la suggestion de Dream, donc rien n'a été appliqué.", | ||
| "itemLinkListTitle": "{count, plural, =0{Aucun élément} =1{1 élément} other{{count} éléments}}" | ||
| "itemLinkListTitle": "{count, plural, =0{Aucun élément} =1{1 élément} other{{count} éléments}}", | ||
| "firstCaptureTitle": "How will you capture?", |
There was a problem hiding this comment.
Supply locale-specific translations for the new copy
For every non-English ARB checked, including French here and Arabic, all new firstCapture* values are copied verbatim from English, so users selecting those locales see this entire mandatory onboarding step in English. Generate these keys with actual locale translations rather than English placeholders, as required by the app localization guide.
AGENTS.md reference: app/AGENTS.md:L119-L119
Useful? React with 👍 / 👎.
| }, | ||
| ), | ||
| OnboardingCompleteScreen( | ||
| onSkipped: () => _stepTelemetry.skipped = true, |
There was a problem hiding this comment.
Clear the skip marker before a non-skip retry
When Skip's OnboardingSyncRuntime.enqueue fails, the wrapper remains on index 9 but this flag is never cleared. If the user responds to the error by completing via Phone, Omi, or Watch, the eventual _stepTelemetry.exit() still emits skipped: true and exit_reason: skipped, misclassifying the successful retry; reset the marker when a non-skip path begins or when the completion save fails.
Useful? React with 👍 / 👎.
| static void info(BuildContext context, String message) => | ||
| _show(context, message, kind: OmiFeedbackKind.info, duration: OmiFeedbackTiming.info); | ||
| static void info(BuildContext context, String message) { | ||
| if (_infoOwners > 0) return; |
There was a problem hiding this comment.
Preserve the recording-interruption notice
While FirstCapturePage is mounted, it calls ownInfoFeedback(), so this process-wide guard suppresses every informational toast. In particular, a phone socket close calls AppSnackbar.showSnackbar with transcriptionPausedReconnecting in capture_controller.dart, but the guided controller remains in its recording phase and continues telling the user to keep talking; the user therefore receives no indication that transcription has paused. Suppress only the duplicate empty-recording notice or surface the interruption in the guided page.
Useful? React with 👍 / 👎.
…eriment (BasedHardware#21450) Brings in Nik's paywall A/B test (PaywallRouter, flag paywall-variant) and flag-gated web onboarding. Resolution: - openUpgradePaywall: Superwall pilot (when on) -> PaywallRouter arm -> plans sheet; logs Paywall Opened once; forceNative carries the web variant's fallback so it never loops. - Onboarding: the activation ending's paywall asks the router before the onboarding sheet; the experiment's end-of-onboarding placement is skipped when the ending already offered a plan, so nobody sees two paywalls in a row. Keeps the debug onboarding rerun and the web onboarding entry; the first-capture step telemetry stays removed (BasedHardware#21396 revert). - l10n: main's keys kept; the reverted first-capture strings dropped again; regenerated. - Flag registry re-rendered; onboarding-activation-flow notes name its PostHog flag/experiment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The final onboarding screen deferred value for days. In the measured new-mobile-signup cohort, 55% started a recording but only 37% received a conversation in week 1 (iOS 44%, Android 28%). Short phone tests with no transcript account for much of the gap. This change ends setup with a capture choice and an immediate phone-recording payoff.
Changes and evidence
Review corrections
Resume starts the tab controller and step tracker at the restored index, so no phantom auth completion fires.
has_omi_devicereflects successful pairing or a saved Omi, never a route tap.Short Finish shows a warning; Back confirms before stopping an owned recording.
Finish drops recording ownership immediately. Polling stops when its controller is disposed or its attempt changes.
Choice, recording, result and empty-result actions are pinned to the bottom safe area; scrollable content stays vertically balanced. Empty feedback has its own title.
The result restores the iOS 16+ App Shortcuts/Siri tip with the existing native availability gate.
The guided route temporarily owns informational feedback through OmiFeedback; generic capture explanations from feat(mobile): explain empty recordings and instrument onboarding funnel gaps #21398 are suppressed while this page is mounted, and normal info feedback resumes after it is disposed. Error and undo feedback remain available. Tests cover suppression and restoration.
Main including fix(onboarding): recover guided voice answers and show a grounded payoff #21401 was merged with a merge commit. Main’s generated files were taken and regenerated from the combined l10n and event catalogs. feat(mobile): explain empty recordings and instrument onboarding funnel gaps #21398 subsequently merged during validation and was also merged normally; its typed processing outcome feeds this lane’s exact response future, and guided feedback ownership suppresses generic notices.
Re-review: failed pairing stays on Connect with its in-page error and How to Pair action; only explicit Back/cancel returns to choices. A real-route widget test exercises the failure, opens its guide, and returns with Back.
Re-review: short-Finish confirmation no longer drives the underlying button spinner. Tests assert its label remains visible and processing starts only after confirmation.
Merged-outcome regression guard: the exact-result future is created only for guided Finish, so ordinary Process Now failures retain main’s handled-error path. A capture-coordinator replay failed before the guard and passes with it.
Screenshots
Light theme, 393×852 logical pixels at 3x. Production widgets, real SF Pro Display/Roboto fonts, local synthetic I/O. Files are under
.agent-artifacts/ui-evidence/onb-m-firstcapture/;evidence.jsonrecords the reproduction command and limitations.Additional reviewed states (delayed result and both confirmations):
016-mobile-ios-first-capture-delayed.png
017-mobile-android-first-capture-delayed.png
018-mobile-ios-first-capture-short-warning.png
019-mobile-android-first-capture-short-warning.png
020-mobile-ios-first-capture-back-confirmation.png
021-mobile-android-first-capture-back-confirmation.png
022-mobile-ios-first-capture-omi-failure.png
023-mobile-android-first-capture-omi-failure.png
Validation
flutter analyze: 93 existing findings; the full analyzer ratchet passes without baseline changes. No new diagnostics in lane files.TZ=UTC bash app/test.sh: green (5,374 tests passed; 16 existing skips; 138 protected opt-in spine tests passed). Latest integrated full-suite CI result is recorded below.make preflight, PR-body preflight: green (24 repository preflight checks and 5 PR-metadata checks).8c421e923a04d9ac529ee792f62a82bec361900e: Dart Analyze & Tests concluded FAILURE. Analyzer ratchet passed; the full Flutter suite reported 5 failures (5,493 passed, 16 skipped). All five failures reproduce locally in four unchanged test files:device_service_connection_failure_test.dart(launch timeout),apps_category_section_large_text_test.dart(two cases),settings/ai_app_generator_large_text_test.dart, andsettings/settings_search_header_stability_test.dart. The corresponding device/apps/settings feature code is unchanged by this lane. These failures remain unresolved; CI is not green. Settings fixes are outside this lane’s ownership./private/tmp/onb-m-firstcapture/; CI failure log:review-b-ci-dart-failure.log; local reproductions:review-b-ci-failures-local.log.Risks and limitations
Product invariants
Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 4351 -> 4376 | Expose the exact existing Process Now response to onboarding while preserving main’s typed outcomes and generic empty-recording feedback; capture orchestration remains in the existing coordinator.
Failure-Class: FC-protocol-status-mapped-to-wrong-cause
This activation flow uses existing capture/server contracts. Review regression: protocol pointer absence was incorrectly assigned the insufficient-speech cause; terminal-only classification and adjacent-status controls now guard it. No backend, flag, workflow, or production-data changes.
🤖 Generated with Claude Code