Skip to content

fix: make incoming audio recordings playable inline - #196787

Merged
vincentkoc merged 3 commits into
mainfrom
fix/incoming-audio-preview-20261110
Nov 12, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
fix/incoming-audio-preview-20261110

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Incoming audio clips without a voice-note flag appear as download-only file cards instead of playable recordings. Opening a conversation also eagerly downloads audio for waveform decoration or native playback preparation.

User Impact

Users can play completed incoming recordings inline, including ordinary audio files. Waveform preparation starts on playback rather than when a message becomes visible, Apple clients load audio on Play, and touch controls and long filenames fit better.

This does not implement listening while someone is still recording, partial-recording transport, or live audio from external chat apps. Talk mode remains the live-conversation path.

Why This Change Was Made

Reuse the existing audio player for all incoming audio, defer bounded waveform preparation until playback, and preserve the current playback source while the waveform is prepared. Apple previews defer media loading until Play and cancel obsolete requests when the attachment leaves the view. The shared Apple playback owner rejects a delayed automatic start after a newer Play or Pause action, so a slow attachment cannot interrupt the recording chosen later. Existing media access, Talk checks, failure recovery, and context-copy behavior are preserved.

Evidence

Desktop

Before After
Incoming audio shown as a download-only file card Incoming audio with inline Play and seek controls

Mobile

Before After
Mobile incoming audio file card Mobile incoming audio player

These are actual Chromium screenshots of a synthetic two-second silent WAV without a voice-note flag, at 1100px and 390px. The fixture reproduces the old explicit card presentation for “before” and exercises the incoming-attachment route for “after.” It contains no private messages or recordings. This is component-level browser proof, not an authenticated chat session or native-device capture.

Verification

  • Integrated main 24819901d92ee379b5b36a957276d3b3657d7b79 to include the upstream identity-reconnect, composer-menu, and requester-routing E2E fixture fixes. The audio change remains the same, including upstream typography normalization.

  • Focused player, incoming-audio routing, and bounded waveform-cache tests: 33 passed. Final player rerun after mechanical cleanup: 24 passed; this is a repeat subset, not 24 additional cases.

  • Chromium browser fixture: 2 passed, at 390px and 1100px. Verified duration, Play advancing current time, Pause, seek, and no horizontal card overflow.

  • Final UI typecheck (pnpm tsgo:ui): passed after the final mechanical cleanup. This checks production UI types; test files are excluded by its configuration.

  • Targeted lint: passed, with two pre-existing Solid reactivity warnings on the unchanged props.render(action) line. Formatting, CSS lint, and diff whitespace checks passed.

  • Native string baseline regeneration: entries=4689 changed=false.

  • Apple playback: 13 Swift Testing tests passed on macOS with Swift 6.4.2, using the production coordinator, video-player class, media types, and test files in an isolated package. Covers delayed-A/fast-B, direct and remote actions, native AVPlayer pause/resume, waiting for media, and natural completion. Disabling admission makes four regressions fail; disabling the native rate observer makes native pause/resume regressions fail. This is focused native playback proof, not a full OpenClawKit build.

  • Changed audio/video sources passed Swift syntax parsing. The final native follow-up does not change the previously verified UI source.

  • Final CSS budget comparison passed: 328,850 gzip bytes against the unchanged 328,859-byte ceiling, and 1,712,009 raw bytes against 1,712,885. The 160-line test allocation and CSS lint pass. Fresh AutoReview and independent review passed feature tree 01140258cb601782dec33517312265fed7003f1e; fresh P0–P2 AutoReview also passed the integrated published head 9f014f952e9afc111904245409c6b93bd772a75d. These are source reviews, not runtime tests.

  • On the integrated head, 29 focused audio unit tests and the previously failing speed-selection unit test pass. Fresh browser reruns could not start because the local Chromium runtime lacks libnspr4.so; earlier browser proof is retained, with current-head CI supplying broader validation.

Limitations

Full Apple/Android builds and device testing are unverified. Authenticated end-to-end chat and external-channel delivery were not tested. The original 390px browser run verifies narrow layout; a subsequent real Chromium CSS comparison verifies fine/coarse pointers, 390/1100px widths, file/voice-note players and range/waveform controls (16 combinations). Coarse controls remain 44px with no overflow, and all before/after screenshot pairs are byte-identical.

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android app: web-ui App: web-ui size: L labels Nov 10, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR enables inline playback for unflagged incoming audio, defers waveform and Apple audio loading until Play, and improves touch controls.

Example: An incoming two-second Demo recording.wav has no voice-note flag.

  • Before: The Control UI shows a download-only attachment card.
  • After: The conversation shows Play, seek, time, and mute controls.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The source change is coherent and the previous budget blockers are addressed, but available execution evidence remains below the required application boundary.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Completed incoming recordings can appear as download-only files, and opening a conversation prepares audio before the user chooses Play.
Reason: The maintainer-authored direction provides useful playback through existing components without adding configuration or a public API.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses distinct incoming-audio and loading behavior still present on main; the earlier budget findings are addressed, and no discrete correctness defect was found.

Priority: P2
Reviewed head: 9f014f952e9afc111904245409c6b93bd772a75d

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Missing shipped-app evidence covers incoming playback and deferred waveform requests in Control UI, Apple lazy loading and supersession, and native touch layout; the browser regression is not shown failing on the base.
Agent review details

How this fits together

Chat attachment renderers consume media metadata and resolved sources, then use the existing browser or native playback owners to load and coordinate audio.

flowchart LR
A[Incoming audio attachment] --> B[Attachment renderer]
B --> C[Inline audio preview]
C --> D[User presses Play]
D --> E[Existing media source owner]
E --> F[Coordinated playback]
F --> G[Bounded waveform preparation]
Loading

Technical review

Best possible solution:

Use the existing attachment and playback owners to provide on-demand inline audio while preserving source recovery and newer playback intent.

Do we have a high-confidence way to reproduce the issue?

Current-main source directly shows unflagged incoming audio choosing card presentation and Apple audio loading when its view task starts.

Is this the best way to solve the issue?

The patch fixes those decisions at their existing owners, and its shared playback-intent check handles the delayed-load failure introduced by loading on Play.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b029a471858e.

Provenance checked

  • Incoming audio presentation changes intended behavior with a stated reason (fix(ui): simplify voice notes and recommendation cards #154339: Voice notes received compact inline controls while ordinary audio retained metadata and expansion; later Solid migrations carried that distinction forward.)
  • Viewport-triggered waveform preparation changes intended behavior with a stated reason (e9c32f4: The presentation refactor preserved visible-only preparation and existing media-source ownership; this PR explicitly moves optional preparation to playback.)
  • Apple audio loading and playback coordination changes intended behavior with a stated reason (afae681: Native inline players centralized interruption and playback ownership; this PR retains that owner while deferring loading until Play.)
  • Audio styling and Android controls keeps the original intent (feat(android): inline audio/video players with Media3 #115916: Existing inline controls provide native playback within chat; touch sizing and filename truncation preserve that interaction.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +136, Tests +332, Docs +19, Other +3. Total +490 across 15 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 8 315 179 +136
Tests 5 394 62 +332
Docs 1 21 2 +19
Config 0 0 0 0
Generated 0 0 0 0
Other 1 3 0 +3
Total 15 733 243 +490

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: This improves a bounded chat playback workflow and avoids eager audio preparation without affecting message delivery or persisted user state.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-10T18:21:50.695Z sha 80de37c :: needs changes before merge. :: [P2] Keep the added audio styles within the CSS budget | [P2] Account for the added regression tests in the test-line budget

Reviewed November 11, 2026, 7:39 PM ET / November 12, 2026, 00:39 UTC (Revision 2).

@clawsweeper clawsweeper Bot removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 11, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026
@vincentkoc
vincentkoc merged commit 4947e40 into main Nov 12, 2026
114 checks passed
@vincentkoc
vincentkoc deleted the fix/incoming-audio-preview-20261110 branch November 12, 2026 00:55
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 12, 2026
* fix: make incoming audio recordings playable inline

* fix: fit inline audio controls within UI budgets

* Merge commit 'c73dcc6dc20ee7f45fce0971c4861de267754b50' into fix/incoming-audio-preview-20261110

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android app: web-ui App: web-ui docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant