Skip to content

fix(app): say when only part of a conversation's audio was saved - #22085

Merged
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
sauranshbhardwaj:fix/19243-partial-audio-hint
Oct 18, 2026
Merged

Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
sauranshbhardwaj:fix/19243-partial-audio-hint

Conversation

@sauranshbhardwaj

@sauranshbhardwaj sauranshbhardwaj commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

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:49 remaining-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:03 with 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 (scenario conversation-detail-partial-audio, added in this PR).

Before (main) After
Before: -0:03 with no explanation After: 0:03 of 5:49 audio saved

How it is tested

test/widgets/conversation_partial_audio_hint_test.dart:

  • unit cases for the threshold (3 s of 5:49 is partial; 341 s of 349 s and 95 s of 100 s are not; nothing saved or nothing spoken is not)
  • widget: a 5:49 transcript with one 3 s file renders 0:03 of 5:49 audio saved, no -0:03, and Play still present
  • widget: full-length audio keeps -5:49 and no hint
  • the existing conversation_playback_sync_test.dart partial-playlist case still sees -0:30 once playback has moved

Reproduced on main first: the widget test fails there with -0:03 and no hint.

New string playbackPartialAudioSaved added through scripts/l10n.py add to every locale.

Failure-Class: none

View guided diff

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 Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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:

  1. 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.
  2. Edge case: scrubbing back to exactly 0 after playback would re-show the hint (position returns to Duration.zero); confirm that's intended.
  3. 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.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution flutter flutter work labels Oct 18, 2026
@Git-on-my-level
Git-on-my-level merged commit a3b26d7 into BasedHardware:main Oct 18, 2026
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conversation player: no hint when only part of a conversation's audio was saved

2 participants