From bfe743b68bbce3bf3b4c4ea4756f7ef2a4436db0 Mon Sep 17 00:00:00 2001 From: pengx17 Date: Tue, 27 May 2025 03:29:10 +0000 Subject: [PATCH] fix(core): audio block actions not showing (#12527) ## Summary by CodeRabbit - **Style** - Updated audio block containers to remove borders and allow visible overflow, improving the appearance of audio attachments. - **Bug Fixes** - Ensured that the actions field is always present in audio transcription job results, defaulting to an empty string when not specified. --- .../blocksuite/attachment-viewer/audio/audio-block.css.ts | 8 +++++++- .../src/modules/media/entities/audio-transcription-job.ts | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/frontend/core/src/blocksuite/attachment-viewer/audio/audio-block.css.ts b/packages/frontend/core/src/blocksuite/attachment-viewer/audio/audio-block.css.ts index 132cc0fb37..6d3941787b 100644 --- a/packages/frontend/core/src/blocksuite/attachment-viewer/audio/audio-block.css.ts +++ b/packages/frontend/core/src/blocksuite/attachment-viewer/audio/audio-block.css.ts @@ -1,6 +1,6 @@ import { cssVar } from '@toeverything/theme'; import { cssVarV2 } from '@toeverything/theme/v2'; -import { style } from '@vanilla-extract/css'; +import { globalStyle, style } from '@vanilla-extract/css'; export const root = style({ display: 'flex', @@ -49,3 +49,9 @@ export const reloadButton = style({ export const reloadButtonIcon = style({ fontSize: 16, }); + +/** Render our own border for audio block */ +globalStyle(`.affine-attachment-container:has(${root})`, { + border: 'none', + overflow: 'visible', +}); diff --git a/packages/frontend/core/src/modules/media/entities/audio-transcription-job.ts b/packages/frontend/core/src/modules/media/entities/audio-transcription-job.ts index b119c971ea..8916d58fa5 100644 --- a/packages/frontend/core/src/modules/media/entities/audio-transcription-job.ts +++ b/packages/frontend/core/src/modules/media/entities/audio-transcription-job.ts @@ -244,6 +244,7 @@ export class AudioTranscriptionJob extends Entity<{ const result: TranscriptionResult = { summary: claimedJob.summary ?? '', title: claimedJob.title ?? '', + actions: claimedJob.actions ?? '', segments: claimedJob.transcription?.map(segment => ({ speaker: segment.speaker,