Repository navigation
fix: make incoming audio recordings playable inline - #196787
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherChat 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]
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +136, Tests +332, Docs +19, Other +3. Total +490 across 15 files. Added test files: 2. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 11, 2026, 7:39 PM ET / November 12, 2026, 00:39 UTC (Revision 2). |
…ming-audio-preview-20261110
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* 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]>
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
Mobile
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
24819901d92ee379b5b36a957276d3b3657d7b79to 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 head9f014f952e9afc111904245409c6b93bd772a75d. 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.