From b9a9b9d5d087a830af9347afd7c26ac3d318d25d Mon Sep 17 00:00:00 2001 From: L-Sun Date: Mon, 16 Dec 2024 10:14:07 +0000 Subject: [PATCH] fix(blocks): the width of the card view is not fully filled (#8988) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close [BS-1777](https://linear.app/affine-design/issue/BS-1777/card在切换为full-width后没有responsively适配) --- .../affine/block-embed/src/embed-linked-doc-block/styles.ts | 2 +- .../min-width-limit-for-embed-block-drag.json | 2 +- .../min-width-limit-for-embed-block-link-to-card-min-width.json | 2 +- .../min-width-limit-for-embed-block-link-to-card.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/affine/block-embed/src/embed-linked-doc-block/styles.ts b/packages/affine/block-embed/src/embed-linked-doc-block/styles.ts index 00eb04464555..2491fc727203 100644 --- a/packages/affine/block-embed/src/embed-linked-doc-block/styles.ts +++ b/packages/affine/block-embed/src/embed-linked-doc-block/styles.ts @@ -185,7 +185,7 @@ export const styles = css` } .affine-embed-linked-doc-block:not(.in-canvas) { - max-width: 100%; + width: 100%; min-width: calc(min(${EMBED_CARD_MIN_WIDTH}px, 100%)); } diff --git a/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-drag.json b/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-drag.json index 7ad3af897b5c..55022534215b 100644 --- a/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-drag.json +++ b/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-drag.json @@ -25,7 +25,7 @@ "flavour": "affine:edgeless-text", "version": 1, "props": { - "xywh": "[-25,-25,799.0093994140625,154]", + "xywh": "[-25,-25,497,154]", "index": "a1", "lockedBySelf": false, "color": "--affine-palette-line-blue", diff --git a/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-link-to-card-min-width.json b/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-link-to-card-min-width.json index 5f17d3a9b6c3..c61263f404b1 100644 --- a/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-link-to-card-min-width.json +++ b/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-link-to-card-min-width.json @@ -25,7 +25,7 @@ "flavour": "affine:edgeless-text", "version": 1, "props": { - "xywh": "[-25,-25,452.4000244140625,154]", + "xywh": "[-25,-25,452,154]", "index": "a1", "lockedBySelf": false, "color": "--affine-palette-line-blue", diff --git a/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-link-to-card.json b/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-link-to-card.json index 2a3c31a05d26..f659f908863f 100644 --- a/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-link-to-card.json +++ b/tests/snapshots/edgeless/edgeless-text.spec.ts/min-width-limit-for-embed-block-link-to-card.json @@ -25,7 +25,7 @@ "flavour": "affine:edgeless-text", "version": 1, "props": { - "xywh": "[-25,-25,754,154]", + "xywh": "[-25,-25,452,154]", "index": "a1", "lockedBySelf": false, "color": "--affine-palette-line-blue",