There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
fix: note should hide collapse button in presentation mode (#11292)
doouding18cb4199fa19
diff --git a/blocksuite/affine/blocks/block-note/src/note-edgeless-block.ts b/blocksuite/affine/blocks/block-note/src/note-edgeless-block.tsindex 4c50a35a2c..1b46a338fe 100644--- a/blocksuite/affine/blocks/block-note/src/note-edgeless-block.ts+++ b/blocksuite/affine/blocks/block-note/src/note-edgeless-block.ts@@ -216,6 +216,8 @@ export class EdgelessNoteBlockComponent extends toGfxBlockComponent(const { borderRadius } = edgeless.style;const { collapse = false, collapsedHeight, scale = 1 } = edgeless;+ const { tool } = this.gfx;+const bound = Bound.deserialize(xywh);const height = bound.h / scale;@@ -280,7 +282,9 @@ export class EdgelessNoteBlockComponent extends toGfxBlockComponent(.editing=${this._editing}></edgeless-note-mask>- ${isCollapsable && (!this.model.isPageBlock() || !hasHeader)+ ${isCollapsable &&+ tool.currentToolName$.value !== 'frameNavigator' &&+ (!this.model.isPageBlock() || !hasHeader)? html`<divclass="${classMap({[styles.collapseButton]: true,diff --git a/tests/blocksuite/e2e/edgeless/presentation.spec.ts b/tests/blocksuite/e2e/edgeless/presentation.spec.tsindex 182cfe05a7..0da3e31784 100644--- a/tests/blocksuite/e2e/edgeless/presentation.spec.ts+++ b/tests/blocksuite/e2e/edgeless/presentation.spec.ts@@ -9,8 +9,11 @@ import {edgelessCommonSetup,enterPresentationMode,locatorPresentationToolbarButton,+ resizeElementByHandle,+ selectNoteInEdgeless,setEdgelessTool,Shape,+ switchEditorMode,toggleFramePanel,} from '../utils/actions/edgeless.js';import {@@ -19,7 +22,11 @@ import {pressEscape,selectAllBlocksByKeyboard,} from '../utils/actions/keyboard.js';-import { waitNextFrame } from '../utils/actions/misc.js';+import {+ enterPlaygroundRoom,+ initEmptyEdgelessState,+ waitNextFrame,+} from '../utils/actions/misc.js';import { test } from '../utils/playwright.js';test.describe('presentation', () => {@@ -246,4 +253,22 @@ test.describe('presentation', () => {await expect(frameItems.nth(6)).toHaveText('Frame 3');await expect(frameItems.nth(7)).toHaveText('Frame 4');});++ test('note should hide the collapse button when enter presentation mode', async ({+ page,+ }) => {+ await enterPlaygroundRoom(page);+ const { noteId } = await initEmptyEdgelessState(page);+ await switchEditorMode(page);++ await selectNoteInEdgeless(page, noteId);+ await resizeElementByHandle(page, { x: 0, y: 70 }, 'bottom-right');++ await createFrame(page, [100, 100], [100, 200]);++ await enterPresentationMode(page);++ const collapseButton = page.getByTestId('edgeless-note-collapse-button');+ await expect(collapseButton).not.toBeVisible();+ });});