fix: audio waveform clipping in horizontal card view (#14789)

Fixes #13399

### Issue
When viewing an audio attachment card in horizontal view, the waveform 
was being clipped and not fully visible. In vertical view it displayed 
correctly.

### Fix
- `audio-waveform` and `progressContainer` flex children were missing 
  `minWidth: 0` and `flex: 1`, causing container overflow
- `.affine-attachment-container` had a fixed height with `overflow:
hidden`
  that cut off the waveform row

### Screenshot Verification
**Before**
<img width="1661" height="935" alt="image"
src="https://github.com/user-attachments/assets/b2f0908b-94fe-4869-bdfb-cc6a757e703d"
/>

**After**
<img width="750" height="182" alt="image"
src="https://github.com/user-attachments/assets/63caac69-f37b-4894-80de-806b691581c8"
/>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

**New Features**
- Introduced audio embed card functionality allowing users to embed and
display audio content directly in documents with standardized dimensions
and improved responsive layout styling for better visual presentation
and integration.

**Improvements**
- Enhanced styling and layout handling for audio player components to
ensure proper display and optimal rendering in various container sizes
and space constraints.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Xuan4781
2026-04-05 05:35:39 -04:00
committed by GitHub
parent 3219b82827
commit aa48c1c18b
5 changed files with 8 additions and 1 deletions

View File

@@ -19,7 +19,8 @@ export type EmbedCardStyle =
| 'html'
| 'syncedDoc'
| 'pdf'
| 'citation';
| 'citation'
| 'audio';
export const LinkPreviewDataSchema = z.object({
description: z.string().nullable(),

View File

@@ -33,6 +33,7 @@ export const EMBED_CARD_WIDTH: Record<EmbedCardStyle, number> = {
syncedDoc: SYNCED_DEFAULT_WIDTH,
pdf: 537 + 24 + 2,
citation: 752,
audio: 116,
};
export const EMBED_CARD_HEIGHT: Record<EmbedCardStyle, number> = {
@@ -48,6 +49,7 @@ export const EMBED_CARD_HEIGHT: Record<EmbedCardStyle, number> = {
syncedDoc: 455,
pdf: 759 + 46 + 24 + 2,
citation: 52,
audio: 116,
};
export const EMBED_BLOCK_FLAVOUR_LIST = [

View File

@@ -123,6 +123,7 @@ export const progressContainer = style({
display: 'flex',
alignItems: 'center',
gap: 8,
minWidth: 0,
});
export const progressBar = style({

View File

@@ -9,4 +9,6 @@ export const root = style({
position: 'relative',
overflow: 'hidden',
maxWidth: 2000, // since we have at least 1000 samples, the max width is 2000
minWidth: 0,
flex: 1,
});

View File

@@ -54,4 +54,5 @@ export const reloadButtonIcon = style({
globalStyle(`.affine-attachment-container:has(${root})`, {
border: 'none',
overflow: 'visible',
height: 'fit-content !important',
});