Skip to content

feat(mobile): explain empty recordings and instrument onboarding funnel gaps - #21398

Merged
Git-on-my-level merged 5 commits into
mainfrom
lane/onb-m-feedback-telemetry
Oct 13, 2026
Merged

Git-on-my-level merged 5 commits into
mainfrom
lane/onb-m-feedback-telemetry

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

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". tooShortDesc existed 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.

  • Home says "Not enough speech to make a conversation. Try talking for 30 seconds or more." only after a confirmed empty process body, or after a 404 that is still unanswered once the conversation-created path has had a chance to deliver. A phone stop does not explain by itself. A transport failure records null_result and does not use that sentence. A later non-discarded upsert clears the Home line and does not emit.
  • When the only known conversation was discarded, Home says "That recording was too short or empty to keep." The snackbar is once; Recording Produced No Conversation still emits once per capture after that.
  • Recording Produced No Conversation carries source (phone|omi|watch), duration_s, transcript_observed, and reason (empty_deleted|discarded|null_result). source comes from the session device / ConversationSource (apple_watch → watch). The telemetry string is only the phone-versus-pendant fallback.
  • Welcome emits Onboarding Welcome Shown and Onboarding Get Started Tapped. Google and Apple emit Sign In Started {provider} and Sign In Failed {provider, error_class}.
  • The permissions step emits Onboarding Permission Result {permission: notifications|location|background_activity, granted, permanently_denied, services_disabled} once per permission per decision. Location services off is services_disabled, not permanently_denied.
  • Connect emits Device Pairing Blocked {reason, android_sdk, ios_version}, Device Scan Empty {after_seconds}, and Device Connect Failed {error_class}. Android OmiBleManager.startScan reports no_adapter, bluetooth_off, nearby_devices_denied, and scanner_unavailable as distinct reasons. android_sdk is SDK_INT (0 on iOS); ios_version is 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.

Empty recording, iOS

Empty recording, Android

Discarded only, iOS

Discarded only, Android

Test plan

  • Session source versus telemetry fallback: app/test/services/capture/empty_recording_notice_test.dart
  • CaptureController: stop then a late conversation emits nothing; 404 after finalize emits nothing; Apple Watch empty body is source=watch; an already-shown discarded explanation still emits once; transport emits null_result without the too-short Home line: app/test/services/capture/empty_recording_controller_test.dart
  • Discarded-only claim and upsert clearing the Home line: app/test/providers/empty_recording_explanation_test.dart
  • Funnel events, services_disabled, and distinct no_adapter / scanner_unavailable reasons: app/test/utils/analytics/onboarding_funnel_analytics_test.dart. Registry consumer contracts/analytics/consumers/onboarding-activation-funnel.sql (python3 scripts/check_event_registry.py)
  • Sign-in class, permission dedupe (including location services off), pairing block, and connect error class: 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.dart
  • Existing Home empty state, process placeholder, and C7 registry batch still pass
  • Screenshot widget test loads SF Pro and MaterialIcons: app/test/widgets/empty_recording_message_render_test.dart
  • Reviewer: confirm Mobile App Checks runs Dart Analyze & Tests (not skipped)

Risks

  • A 404 that is still unanswered after one event-loop turn is treated as an empty delete. A conversation that arrives later clears the Home line, but the event may already have been emitted.
  • A transport failure emits null_result and does not show the too-short sentence. The user only sees the explanation after a confirmed empty body or an unanswered 404.
  • The discarded-only snackbar is once per device. Later discarded-only captures still emit Recording Produced No Conversation once per capture. A fetch that omits discarded rows will not announce if that row never arrives.
  • Device Pairing Blocked from native scan is reported only while a Connect scan is active. ios_version is the major version only.
  • Permission dedupe lives on the onboarding provider instance. Location services off and a later denial are separate decisions because services_disabled is part of the key. Background activity has no permanent-denial status, so permanently_denied is false for that permission.
  • tooShortDesc changed in English. Other locales keep their previous translation. discardedOnlyRecording is the English sentence in every locale.

Failure-Class: none

Product invariants affected

  • INV-CAP-1

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

Git-on-my-level and others added 3 commits October 13, 2026 19:32
…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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T13:54:30.971644Z b22cc3e New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment on lines +63 to +66
if (absence == ProcessAbsence.notFound || absence == ProcessAbsence.emptyBody) {
return EmptyRecordingReason.emptyDeleted;
}
return EmptyRecordingReason.nullResult;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread app/lib/l10n/app_es.arb
"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.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +241 to +245
_recordOnboardingPermission(
permission: OnboardingPermissionResultPermission.location,
granted: false,
permanentlyDenied: true,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines 3829 to +3830
externalActions.upsertConversation(conversation);
_deliveredExplanationGeneration = _captureExplanationGeneration;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +278 to +279
if (token == null) {
PlatformManager.instance.analytics.signInFailed(authProvider, error: StateError('token'));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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]>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +504 to +506
void _onNativeScanBlocked(String reason) {
if (!_reportNativeScanBlocks) return;
_emitPairingBlocked(pairingBlockFromNativeScan(reason));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines 199 to +202
if (credential != null && _hasFirebaseUser) {
await _signIn(onSignIn, credential: credential, authProvider: 'google');
} else {
PlatformManager.instance.analytics.signInFailed('google', cancelled: true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +574 to +579
child: NoConversationsHero(
message: switch (snapshot.homeEmptyExplanation) {
HomeEmptyExplanation.tooShort => context.l10n.tooShortDesc,
HomeEmptyExplanation.discardedOnly => context.l10n.discardedOnlyRecording,
HomeEmptyExplanation.none => null,
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +3901 to +3902
final claim = externalActions.claimDiscardedOnlyExplanation();
if (claim == DiscardedOnlyClaim.notDiscardedOnly) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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]>
@Git-on-my-level
Git-on-my-level merged commit 01c660f into main Oct 13, 2026
45 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/onb-m-feedback-telemetry branch October 13, 2026 14:50
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