mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 09:21:24 +08:00
fix: note should hide collapse button in presentation mode (#11292)
Fixes [BS-1003](https://linear.app/affine-design/issue/BS-1003/ppt-演示状态下-note-会显示折叠箭头)
This commit is contained in:
@@ -216,6 +216,8 @@ export class EdgelessNoteBlockComponent extends toGfxBlockComponent(
|
|||||||
const { borderRadius } = edgeless.style;
|
const { borderRadius } = edgeless.style;
|
||||||
const { collapse = false, collapsedHeight, scale = 1 } = edgeless;
|
const { collapse = false, collapsedHeight, scale = 1 } = edgeless;
|
||||||
|
|
||||||
|
const { tool } = this.gfx;
|
||||||
|
|
||||||
const bound = Bound.deserialize(xywh);
|
const bound = Bound.deserialize(xywh);
|
||||||
const height = bound.h / scale;
|
const height = bound.h / scale;
|
||||||
|
|
||||||
@@ -280,7 +282,9 @@ export class EdgelessNoteBlockComponent extends toGfxBlockComponent(
|
|||||||
.editing=${this._editing}
|
.editing=${this._editing}
|
||||||
></edgeless-note-mask>
|
></edgeless-note-mask>
|
||||||
|
|
||||||
${isCollapsable && (!this.model.isPageBlock() || !hasHeader)
|
${isCollapsable &&
|
||||||
|
tool.currentToolName$.value !== 'frameNavigator' &&
|
||||||
|
(!this.model.isPageBlock() || !hasHeader)
|
||||||
? html`<div
|
? html`<div
|
||||||
class="${classMap({
|
class="${classMap({
|
||||||
[styles.collapseButton]: true,
|
[styles.collapseButton]: true,
|
||||||
|
|||||||
@@ -9,8 +9,11 @@ import {
|
|||||||
edgelessCommonSetup,
|
edgelessCommonSetup,
|
||||||
enterPresentationMode,
|
enterPresentationMode,
|
||||||
locatorPresentationToolbarButton,
|
locatorPresentationToolbarButton,
|
||||||
|
resizeElementByHandle,
|
||||||
|
selectNoteInEdgeless,
|
||||||
setEdgelessTool,
|
setEdgelessTool,
|
||||||
Shape,
|
Shape,
|
||||||
|
switchEditorMode,
|
||||||
toggleFramePanel,
|
toggleFramePanel,
|
||||||
} from '../utils/actions/edgeless.js';
|
} from '../utils/actions/edgeless.js';
|
||||||
import {
|
import {
|
||||||
@@ -19,7 +22,11 @@ import {
|
|||||||
pressEscape,
|
pressEscape,
|
||||||
selectAllBlocksByKeyboard,
|
selectAllBlocksByKeyboard,
|
||||||
} from '../utils/actions/keyboard.js';
|
} 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';
|
import { test } from '../utils/playwright.js';
|
||||||
|
|
||||||
test.describe('presentation', () => {
|
test.describe('presentation', () => {
|
||||||
@@ -246,4 +253,22 @@ test.describe('presentation', () => {
|
|||||||
await expect(frameItems.nth(6)).toHaveText('Frame 3');
|
await expect(frameItems.nth(6)).toHaveText('Frame 3');
|
||||||
await expect(frameItems.nth(7)).toHaveText('Frame 4');
|
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();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user