Repository navigation
fix(app): say when only part of a conversation's audio was saved - #22085
Git-on-my-level merged 1 commit into
Conversation
A 5:49 phone conversation with a complete transcript and about 3 s of stored audio showed a waveform and -0:03 with nothing explaining it, which reads as a broken recording. Before playback moves, the player now says "0:03 of 5:49 audio saved" in the remaining-time slot when the saved audio is under 90% of the transcript span and at least 10 s short; the remaining time comes back once something has been heard and stays whenever the audio covers the conversation. The rule is one pure function (savedAudioIsPartial) with named thresholds; the label is a new string added to every locale through scripts/l10n.py. Fixes BasedHardware#19243
Git-on-my-level
left a comment
There was a problem hiding this comment.
Verdict: well-scoped, well-tested fix — the production logic is correct and cleanly isolated; leaving a positive signal here rather than a formal approval.
- app/lib/utils/audio/partial_audio_coverage.dart — new pure predicate savedAudioIsPartial with named thresholds (partialAudioMaxCoverage = 0.9, partialAudioMinShortfallSeconds = 10) and explicit NaN/infinite/zero guards. O(1), stateless, exactly the right shape for this rule.
- app/lib/widgets/conversation_bottom_bar.dart — _partialAudioLabel compares _totalDuration against conversation.getDurationInSeconds(); rendering uses statusLabel ?? (position == Duration.zero ? partialAudioLabel : null), so transport-failure labels keep precedence and the hint yields to remaining time as soon as playback moves. Precedence is correct.
- app/test/widgets/conversation_partial_audio_hint_test.dart — threshold unit cases (3s/349s partial; 341s/349s and 95s/100s not; zero/NaN not) plus widget tests asserting the exact label, that -0:03 is gone, that the clip still plays, and that full-coverage keeps -5:49. Good coverage of the regression.
- app/integration_test/visual_audit/scenarios/conversation_detail.dart — new conversation-detail-partial-audio audit scenario reproducing the #19243 shape (5:49 transcript, one 3s file).
- app/lib/l10n/app_en.arb + generated app_localizations*.dart + the ~50 locale .arb files — playbackPartialAudioSaved added with typed String placeholders and propagated everywhere; the summaryFailedBody trailing-comma edit in each .arb is just the mechanical JSON change needed to append the key.
- app/changelog/unreleased/20261018-player-partial-audio-saved.json — changelog fragment present, and the before/after PNGs under .agent-artifacts/ui-evidence/ follow the existing repo convention.
UX: this replaces a label that read as a broken recording with an explanation, only in the partial-audio case. Blast radius: the conversation player's status slot only — wrong values would mislabel, not break playback. Performance/cost: one comparison per build. Security: none.
USER IMPACT: when only part of a conversation's audio was saved, the player now says "0:03 of 5:49 audio saved" instead of a confusing short remaining time; playback itself is unchanged.
What I'd still want as a reviewer:
- A product sanity check on the two constants (90% coverage, 10s shortfall) — reasonable values, but they are hard-coded and define when the hint appears.
- Edge case: scrubbing back to exactly 0 after playback would re-show the hint (position returns to Duration.zero); confirm that's intended.
- A native-speaker spot-check of a few of the non-English strings — they read consistent, but a quick pass would help.
Leaving for human maintainer review for the merge decision and sign-off on the label wording.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
Fixes #19243
What
When a conversation's stored audio is far shorter than the conversation itself, the player now says so in the slot that otherwise shows remaining time:
0:03 of 5:49 audio saved. The hint shows until playback moves; after that the remaining time comes back, so scrubbing and listening read as before. Audio that covers the conversation keeps the-5:49remaining-time label throughout."Far shorter" means the saved audio is under 90% of the conversation's transcript span and at least 10 seconds short, so trimmed trailing silence and a transcript that outruns the last chunk by a few seconds do not trigger it. The rule lives in one small pure function (
savedAudioIsPartial) with its thresholds named.Why
A 5:49 phone conversation with a complete transcript and about 3 s of stored audio showed a waveform and
-0:03with no explanation, which reads as a broken recording or a playback bug. The server-side reason the audio is short is out of scope here; this only stops the player from presenting a short file as the whole recording.Before / after
Captured headlessly with
app/scripts/visual_audit.sh(scenarioconversation-detail-partial-audio, added in this PR).How it is tested
test/widgets/conversation_partial_audio_hint_test.dart:0:03 of 5:49 audio saved, no-0:03, and Play still present-5:49and no hintconversation_playback_sync_test.dartpartial-playlist case still sees-0:30once playback has movedReproduced on main first: the widget test fails there with
-0:03and no hint.New string
playbackPartialAudioSavedadded throughscripts/l10n.py addto every locale.Failure-Class: none