From b1a36beafbb93c7d5a4d7c73387fe1099d8e7170 Mon Sep 17 00:00:00 2001 From: kenny lopez Date: Tue, 1 Sep 2026 16:55:50 +0100 Subject: [PATCH] Hide downloads for voice notes Signed-off-by: kenny lopez --- .../messages/ui/AudioMessageAttachment.tsx | 6 +++- desktop/tests/e2e/voice-note.spec.ts | 33 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/desktop/src/features/messages/ui/AudioMessageAttachment.tsx b/desktop/src/features/messages/ui/AudioMessageAttachment.tsx index 8a585ce41bc..52853865bf0 100644 --- a/desktop/src/features/messages/ui/AudioMessageAttachment.tsx +++ b/desktop/src/features/messages/ui/AudioMessageAttachment.tsx @@ -5,6 +5,7 @@ import { toast } from "sonner"; import { formatVoiceNoteDuration, + isVoiceNoteAttachment, nextVoiceNotePlaybackRate, resolveAudioAttachment, summarizeWaveform, @@ -51,7 +52,10 @@ export function renderAudioMessageAttachment( ) { const attachment = resolveAudioAttachment(entry, href, label); return attachment ? ( - + ) : null; } diff --git a/desktop/tests/e2e/voice-note.spec.ts b/desktop/tests/e2e/voice-note.spec.ts index 7e83b021dbb..dd8ebc8ff27 100644 --- a/desktop/tests/e2e/voice-note.spec.ts +++ b/desktop/tests/e2e/voice-note.spec.ts @@ -431,6 +431,39 @@ test("generic audio retains the relay-native download action", async ({ }); }); +test("voice notes omit the relay-native download action", async ({ page }) => { + const audioUrl = `http://localhost:3000/media/${"e".repeat(64)}.mp4`; + await page.goto("/"); + await page.getByTestId("channel-general").click(); + await waitForMockLiveSubscription(page, "general"); + await page.evaluate( + ({ href }) => { + const emit = window.__BUZZ_E2E_EMIT_MOCK_MESSAGE__; + if (!emit) throw new Error("Mock message emitter is unavailable."); + emit({ + channelName: "general", + content: `[voice-note-123.mp4](${href})`, + extraTags: [ + [ + "imeta", + `url ${href}`, + "m video/mp4", + "duration 9.4", + "filename voice-note-123.mp4", + ], + ], + }); + }, + { href: audioUrl }, + ); + + const card = page.getByTestId("audio-message-attachment").last(); + await expect(card).toBeVisible(); + await expect( + card.getByRole("button", { name: "Download voice-note-123.mp4" }), + ).toHaveCount(0); +}); + test("hard-caps audio work and cancels active and queued loads on unmount", async ({ page, }) => {