Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions e2e/design-v2-mobile.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { test, expect } from '@playwright/test';

/**
* Design v2 at a phone width. Under 960px the editor column and the help rail
* stack, and the editor still has to leave room to read and edit the template.
*/
test.use({
storageState: { cookies: [], origins: [] },
viewport: { width: 390, height: 844 },
});

test.describe('Design v2 at mobile widths', () => {
test('the Text step editor keeps a usable height', async ({ page }) => {
await page.goto('/');

await page.getByRole('button', { name: 'Got it' }).click();
await page.getByRole('button', { name: /Start building/ }).click();
await page.getByRole('button', { name: 'Start with Consulting Agreement' }).click();

const editor = page.getByRole('region', { name: 'Text' }).locator('.monaco-editor');
await expect(editor).toBeVisible({ timeout: 30000 });

const box = await editor.boundingBox();
expect(box?.height ?? 0).toBeGreaterThanOrEqual(200);
});
});
11 changes: 11 additions & 0 deletions src/components/designV2/DesignV2Layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,17 @@ html[data-theme="dark"] .nd-sim-pane-ok .nd-sim-tabs .ant-tabs-nav { background:
.nd-view-logic .nd-logic-editor { display: flex; flex: none; width: 100%; height: clamp(260px, 45vh, 380px); min-height: 260px; padding: 0; overflow: hidden; }
.nd-view-logic .nd-logic-editor .editorwrapper { flex: 1; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.nd-view-logic .nd-help-rail { max-height: none; overflow: visible; }
/*
* The Text step stacks the same way: its editor card is a flex child of a
* column the help rail shares, so on a phone it shrinks to a few pixels.
* Let the body scroll and give the editor a height of its own, as above.
*/
.nd-body-content:has(.nd-view-text) { overflow-y: auto; }
.nd-view-text { min-height: 0; overflow: visible; }
.nd-view-text .nd-editor-column { flex: none; min-height: auto; overflow: visible; }
.nd-view-text .nd-editor-card { flex: none; }
.nd-view-text .nd-editor-card-body-editor { flex: none; height: clamp(260px, 45vh, 380px); }
.nd-view-text .nd-help-rail { max-height: none; overflow: visible; }
}
/* Phones: the chip list takes a row of its own so each chip can wrap inside the card. */
@media (max-width: 600px) {
Expand Down
Loading