From c3e465d64483fb0653d6c2e0b4fd9edf02e4f440 Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Wed, 16 Aug 2023 23:20:27 -0500 Subject: [PATCH] fix(core): editor height incorrect (#3799) --- .../src/components/page-detail-editor.tsx | 19 ++++++++++----- apps/electron/e2e/basic.spec.ts | 24 +++++++++++++------ .../components/card/workspace-card/index.tsx | 1 + 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/apps/core/src/components/page-detail-editor.tsx b/apps/core/src/components/page-detail-editor.tsx index a57d0d5899..9da27036dc 100644 --- a/apps/core/src/components/page-detail-editor.tsx +++ b/apps/core/src/components/page-detail-editor.tsx @@ -177,12 +177,7 @@ const LayoutPanel = memo(function LayoutPanel( } } else { return ( - + { const layout = useAtomValue(contentLayoutAtom); + if (layout === 'editor') { + return ( + + + + + + + + ); + } + return ( <> diff --git a/apps/electron/e2e/basic.spec.ts b/apps/electron/e2e/basic.spec.ts index ab9cf30ce3..b6cb233e17 100644 --- a/apps/electron/e2e/basic.spec.ts +++ b/apps/electron/e2e/basic.spec.ts @@ -117,7 +117,7 @@ test('affine cloud disabled', async ({ page }) => { }); await page.waitForSelector('v-line'); await page.getByTestId('current-workspace').click(); - await page.getByTestId('sign-in-button').click(); + await page.getByTestId('cloud-signin-button').click(); await page.getByTestId('disable-affine-cloud-modal').waitFor({ state: 'visible', }); @@ -153,13 +153,23 @@ test('windows only check', async ({ page }) => { test('delete workspace', async ({ page }) => { await page.getByTestId('current-workspace').click(); - await page.getByTestId('add-or-new-workspace').click(); await page.getByTestId('new-workspace').click(); - await page.getByTestId('create-workspace-default-location-button').click(); - await page.getByTestId('create-workspace-input').type('Delete Me'); - await page.getByTestId('create-workspace-create-button').click(); - await page.getByTestId('create-workspace-continue-button').click(); - await page.getByTestId('slider-bar-workspace-setting-button').click(); + await page.getByTestId('create-workspace-default-location-button').click({ + delay: 100, + }); + await page.getByTestId('create-workspace-input').type('Delete Me', { + delay: 100, + }); + await page.getByTestId('create-workspace-create-button').click({ + delay: 100, + }); + await page.getByTestId('create-workspace-continue-button').click({ + delay: 100, + }); + await page.waitForTimeout(1000); + await page.getByTestId('current-workspace').click(); + await page.getByTestId('workspace-card').nth(1).hover(); + await page.getByTestId('workspace-card-setting-button').nth(1).click(); await page.getByTestId('current-workspace-label').click(); expect(await page.getByTestId('workspace-name-input').inputValue()).toBe( 'Delete Me' diff --git a/packages/component/src/components/card/workspace-card/index.tsx b/packages/component/src/components/card/workspace-card/index.tsx index c0c3bf632d..e769809c9f 100644 --- a/packages/component/src/components/card/workspace-card/index.tsx +++ b/packages/component/src/components/card/workspace-card/index.tsx @@ -104,6 +104,7 @@ export const WorkspaceCard = ({ { e.stopPropagation(); onSettingClick(meta.id);