Repository navigation
feat(mobile): explain empty recordings and instrument onboarding funnel gaps - #21398
Conversation
…el gaps A short phone recording that the server drops, and a discarded-only home list, now tell the user why nothing was kept. Welcome, sign-in, permission, and pairing failures emit closed analytics events so the next funnel read can split people who opened Connect and never paired. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
The UI evidence contract needs numbered platform filenames and a manifest, and the store notes need an unreleased fragment for the new empty-recording explanation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
The regenerated BleFlutterApi bindings included trailing spaces that diff hygiene rejects. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Cursor <[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: 9df7317936
ℹ️ 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".
| if (absence == ProcessAbsence.notFound || absence == ProcessAbsence.emptyBody) { | ||
| return EmptyRecordingReason.emptyDeleted; | ||
| } | ||
| return EmptyRecordingReason.nullResult; |
There was a problem hiding this comment.
Keep 404 and transport failures out of the empty path
When processing returns 404, the existing API comment says the WebSocket auto-finalize path already finalized the conversation; when it returns no HTTP response, the outcome is a retryable transport failure. Mapping the former to emptyDeleted and the latter to nullResult sends both through _announceNoConversation, removes the processing placeholder, and tells the user the recording lacked speech—even though a successful conversation may still arrive or the request simply failed. Only a confirmed successful empty response should enter this UI path; preserve an error/retry state for transport and the already-finalized race.
AGENTS.md reference: app/AGENTS.md:L108-L109
Useful? React with 👍 / 👎.
| "connectionErrorDesc": "Fallo al conectar con el servidor.", | ||
| "invalidRecordingMultipleSpeakers": "Grabación inválida", | ||
| "multipleSpeakersDesc": "Parece haber múltiples hablantes.", | ||
| "discardedOnlyRecording": "That recording was too short or empty to keep.", |
There was a problem hiding this comment.
Supply localized text for the new recording message
The new key was populated with the English sentence in every non-English ARB file, so users of all 48 supported non-English locales now see an English explanation inside an otherwise localized Home screen. Provide actual per-locale translations through the repository's localization script rather than copying the template value across locales.
AGENTS.md reference: app/AGENTS.md:L116-L120
Useful? React with 👍 / 👎.
| _recordOnboardingPermission( | ||
| permission: OnboardingPermissionResultPermission.location, | ||
| granted: false, | ||
| permanentlyDenied: true, | ||
| ); |
There was a problem hiding this comment.
Report disabled location services separately from denial
When the device-wide location service is switched off, this branch records permanently_denied: true without checking the app's permission status. A user may still have granted permission and only need to re-enable the system service, so the onboarding funnel will incorrectly attribute these recoverable service-off cases to permanent permission denial; derive this field from Permission.locationWhenInUse.status or use a separate blocked reason.
Useful? React with 👍 / 👎.
|
|
||
| bool isLoadingConversations = false; | ||
| bool showDiscardedConversations = false; | ||
| HomeEmptyExplanation homeEmptyExplanation = HomeEmptyExplanation.none; |
There was a problem hiding this comment.
Reset the empty explanation when clearing user state
After an account triggers this state and signs out, clearAllUserState invokes ConversationProvider.clearUserData(), but that method does not reset the newly added homeEmptyExplanation field. The provider survives the route replacement, so a subsequently signed-in account with an empty conversation list can see the previous account's recording explanation until a real conversation arrives; clear this field as part of the existing account-state teardown.
Useful? React with 👍 / 👎.
| externalActions.upsertConversation(conversation); | ||
| _deliveredExplanationGeneration = _captureExplanationGeneration; |
There was a problem hiding this comment.
Clear the empty explanation when a conversation arrives
A short phone stop can set and persist homeEmptyExplanation before processing finishes, but when processing subsequently returns a valid non-discarded conversation this path only upserts the row. The row temporarily hides the empty hero, while the stale explanation remains stored and resurfaces if that conversation is later deleted or another successful empty refresh occurs; invoke the newly added clearEmptyRecordingExplanation() action when delivering a kept conversation.
Useful? React with 👍 / 👎.
| if (token == null) { | ||
| PlatformManager.instance.analytics.signInFailed(authProvider, error: StateError('token')); |
There was a problem hiding this comment.
Preserve the token failure class in sign-in telemetry
AuthService.getIdToken() collapses transient refresh, terminal credential, missing-user, and missing-token outcomes to null, and this synthetic StateError consequently classifies every one of them as unknown. For example, a network refresh failure can never populate the new network error class, making the funnel unable to distinguish the failures it was introduced to diagnose; propagate the typed token result or record the classification before it is collapsed.
Useful? React with 👍 / 👎.
A phone stop and a process 404 can both still become a conversation. Explain only a confirmed empty body, or a 404 that stays unanswered after the conversation-created path, and count Apple Watch from the session device. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b22cc3ef33
ℹ️ 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".
| } | ||
|
|
||
| externalActions.upsertConversation(conversation); | ||
| _deliveredExplanationGeneration = _captureExplanationGeneration; |
There was a problem hiding this comment.
Bind conversation delivery to the originating capture
When capture A's ConversationEvent arrives after capture B has started, this assigns the conversation to B's current generation because the callback carries no captured generation or session token. B's later empty outcome is then suppressed by _conversationDeliveredForCurrentCapture; similarly, a delayed empty result for A can be announced against B. Preserve the originating generation across the process/WebSocket callback and reject or attribute stale completions accordingly.
AGENTS.md reference: app/AGENTS.md:L108-L108
Useful? React with 👍 / 👎.
| void _onNativeScanBlocked(String reason) { | ||
| if (!_reportNativeScanBlocks) return; | ||
| _emitPairingBlocked(pairingBlockFromNativeScan(reason)); |
There was a problem hiding this comment.
Suppress the empty-scan event when native scanning is blocked
When Android reports no_adapter, scanner_unavailable, or a readiness race such as Bluetooth being switched off, this records the blocked reason but leaves the 10-second empty-scan timer active. NativeBluetoothDiscoverer still completes after its timeout with no devices, so the same attempt subsequently emits Device Scan Empty, incorrectly counting a scan that never started as both blocked and empty. Cancel or mark the empty timer in this callback.
Useful? React with 👍 / 👎.
| if (credential != null && _hasFirebaseUser) { | ||
| await _signIn(onSignIn, credential: credential, authProvider: 'google'); | ||
| } else { | ||
| PlatformManager.instance.analytics.signInFailed('google', cancelled: true); |
There was a problem hiding this comment.
Preserve failures hidden behind null OAuth credentials
For web-auth flows—including Apple sign-in on Android—authenticateWithProvider catches timeouts, launch failures, token-exchange failures, and network errors and returns null. This branch now classifies every such failure as cancelled, so the new funnel reports genuine service and configuration failures as user cancellations. Return a typed outcome or preserve the caught failure class instead of treating every null credential as cancellation; the Apple branch has the same issue.
Useful? React with 👍 / 👎.
| isClicked = false; // Allow clicks again after finishing the operation | ||
| connectingToDeviceId = null; // Reset the connecting device | ||
| deviceProvider?.setIsConnected(false); | ||
| PlatformManager.instance.analytics.deviceConnectFailed(classifyDeviceConnectError(e)); |
There was a problem hiding this comment.
Preserve the underlying connection failure before classification
For the normal BLE connection path, DeviceService.ensureConnection catches every DeviceConnectionException and returns null, after which handleTap throws the synthetic StateError('Device initialization did not complete'). The new classifier handles any StateError as initialization_failed before examining its text, so actual timeouts, Bluetooth-off errors, permission failures, and not-found failures from this path all populate the wrong funnel bucket. Preserve a typed failure from ensureConnection or classify it before it is collapsed.
Useful? React with 👍 / 👎.
| child: NoConversationsHero( | ||
| message: switch (snapshot.homeEmptyExplanation) { | ||
| HomeEmptyExplanation.tooShort => context.l10n.tooShortDesc, | ||
| HomeEmptyExplanation.discardedOnly => context.l10n.discardedOnlyRecording, | ||
| HomeEmptyExplanation.none => null, | ||
| }, |
There was a problem hiding this comment.
Reconcile explanatory Home copy with the UI contract
When either explanation is active, this now renders and announces guidance in the Home empty state, but app/docs/ux-contract.md:284 explicitly requires Empty Home to display only its icon and title and says the reserved guidance must not be displayed or announced. Since this feature intentionally changes that behavior, update the contract and its guard expectations alongside the implementation (or present the explanation outside the empty hero) so future UI work is not enforcing the opposite rule.
AGENTS.md reference: app/AGENTS.md:L3-L4
Useful? React with 👍 / 👎.
| final claim = externalActions.claimDiscardedOnlyExplanation(); | ||
| if (claim == DiscardedOnlyClaim.notDiscardedOnly) return; |
There was a problem hiding this comment.
Emit discarded outcomes independently of the Home empty state
When a discarded conversation arrives for a user who already has any kept conversation, or who enabled Show Discarded, claimDiscardedOnlyExplanation returns notDiscardedOnly and this early return skips Recording Produced No Conversation entirely. The new event therefore undercounts discarded recordings based on unrelated conversation history and a UI preference. Use the claim only to decide whether to show the Home copy or snackbar, while still emitting the discarded outcome.
Useful? React with 👍 / 👎.
The replay controller only receives processInProgressOutcome, and the unused optional parameter failed the analyzer ratchet. Co-authored-by: Cursor <[email protected]>
Summary
New mobile signups from 2026-09-13 through 2026-10-12 (n≈4,380) finish onboarding at 92% on iOS and 86% on Android, then stall. Within 7 days, Recording Started is 55% and Memory Created is only 37% (iOS 44% / Android 28%). About 60% of that recording-to-conversation gap is a phone-mic stop under 30 seconds with no transcript: the server deletes the empty session, the app removes the placeholder, and Home says "No conversations yet".
tooShortDescexisted with no call site. Device Paired is 36% on iOS and 14% on Android. 585 people opened Connect and never paired; Android 11 had 330 signups and 1 pair, and the scan path returned quietly before Dart could tell why.This change tells the user when a recording did not become a conversation, and it records the welcome, sign-in, permission, and pairing outcomes the funnel could not see. Phone capture, including Apple Watch, stays a first-class path. There is no A/B flag.
null_resultand does not use that sentence. A later non-discarded upsert clears the Home line and does not emit.Recording Produced No Conversationstill emits once per capture after that.Recording Produced No Conversationcarriessource(phone|omi|watch),duration_s,transcript_observed, andreason(empty_deleted|discarded|null_result).sourcecomes from the session device /ConversationSource(apple_watch→ watch). The telemetry string is only the phone-versus-pendant fallback.Onboarding Welcome ShownandOnboarding Get Started Tapped. Google and Apple emitSign In Started{provider} andSign In Failed{provider, error_class}.Onboarding Permission Result{permission: notifications|location|background_activity, granted, permanently_denied, services_disabled} once per permission per decision. Location services off isservices_disabled, notpermanently_denied.Device Pairing Blocked{reason, android_sdk, ios_version},Device Scan Empty{after_seconds}, andDevice Connect Failed{error_class}. AndroidOmiBleManager.startScanreportsno_adapter,bluetooth_off,nearby_devices_denied, andscanner_unavailableas distinct reasons.android_sdkis SDK_INT (0 on iOS);ios_versionis the major iOS version (0 on Android).Screenshots
Light theme, 393×852 @3x. Text is SF Pro loaded for the test font families. The empty state does not branch on platform, so the iOS and Android pairs match.
Test plan
app/test/services/capture/empty_recording_notice_test.dartsource=watch; an already-shown discarded explanation still emits once; transport emitsnull_resultwithout the too-short Home line:app/test/services/capture/empty_recording_controller_test.dartapp/test/providers/empty_recording_explanation_test.dartservices_disabled, and distinctno_adapter/scanner_unavailablereasons:app/test/utils/analytics/onboarding_funnel_analytics_test.dart. Registry consumercontracts/analytics/consumers/onboarding-activation-funnel.sql(python3 scripts/check_event_registry.py)app/test/utils/auth/sign_in_failure_test.dart,app/test/pages/onboarding/onboarding_permission_decision_test.dart,app/test/services/devices/pairing_failure_test.dartapp/test/widgets/empty_recording_message_render_test.dartRisks
null_resultand does not show the too-short sentence. The user only sees the explanation after a confirmed empty body or an unanswered 404.Recording Produced No Conversationonce per capture. A fetch that omits discarded rows will not announce if that row never arrives.Device Pairing Blockedfrom native scan is reported only while a Connect scan is active.ios_versionis the major version only.services_disabledis part of the key. Background activity has no permanent-denial status, sopermanently_deniedis false for that permission.tooShortDescchanged in English. Other locales keep their previous translation.discardedOnlyRecordingis the English sentence in every locale.Failure-Class: none
Product invariants affected
This does not pause a pendant uplink or drop pendant frames. The explanation runs after a confirmed empty process result, and pendant or watch stops still wait for that result.
Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 4239 -> 4351 | empty-recording explanation has to sit next to the existing process and stop path
Line-Count-Exception: app/lib/providers/conversation_provider.dart | 2052 -> 2098 | home empty explanation is stored with the conversation list that already hides discarded rows
Line-Count-Exception: app/lib/utils/analytics/analytics_manager.dart | 3059 -> 3131 | new funnel events go through the existing typed analytics methods
Line-Count-Exception: app/lib/backend/preferences.dart | 1505 -> 1514 | persist the one-time discarded explanation and the home empty reason
🤖 Generated with Claude Code