fix(core): editor height incorrect (#3799)

This commit is contained in:
Alex Yang 2023-08-16 23:20:27 -05:00 committed by GitHub
parent d8d6620c5f
commit c3e465d644
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 13 deletions

View File

@ -177,12 +177,7 @@ const LayoutPanel = memo(function LayoutPanel(
}
} else {
return (
<PanelGroup
style={{
height: 'calc(100% - 52px)',
}}
direction={node.direction}
>
<PanelGroup direction={node.direction}>
<Panel
defaultSize={node.splitPercentage}
style={{
@ -219,6 +214,18 @@ export const PageDetailEditor = (props: PageDetailEditorProps) => {
const layout = useAtomValue(contentLayoutAtom);
if (layout === 'editor') {
return (
<Suspense>
<PanelGroup direction="horizontal">
<Panel>
<EditorWrapper {...props} />
</Panel>
</PanelGroup>
</Suspense>
);
}
return (
<>
<Suspense>

View File

@ -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'

View File

@ -104,6 +104,7 @@ export const WorkspaceCard = ({
</StyledWorkspaceInfo>
<StyledSettingLink
className="setting-entry"
data-testid="workspace-card-setting-button"
onClick={e => {
e.stopPropagation();
onSettingClick(meta.id);