diff --git a/src/features/tech-log/presentation/styles/studio-editor.css b/src/features/tech-log/presentation/styles/studio-editor.css index 1ec37de..b7dcec1 100644 --- a/src/features/tech-log/presentation/styles/studio-editor.css +++ b/src/features/tech-log/presentation/styles/studio-editor.css @@ -1867,6 +1867,11 @@ .studio-app .studio-asset-kind-field--compact { display: flex; } +/* The block gutter (drag handle, block actions) sits in the page's side + margin, outside the reading column. It must not be wider than that margin + or the whole page scrolls sideways: the side margin is 38px or more from + 936px up, 24px below that (single-surface .studio-main is 100% - 48px) and + 14px at 760px and below (100% - 28px). See the two media rules below. */ .studio-app .studio-block-editor { position: relative; margin: 0 -38px; @@ -1890,6 +1895,18 @@ border-radius: 5px; } +@media (max-width: 935px) { + .studio-app .studio-block-editor { + margin-inline: -24px; + padding-inline: 24px; + } + + .studio-app .studio-authoring-block { + grid-template-columns: 20px minmax(0, 1fr) auto; + margin-inline: -24px -6px; + } +} + .studio-app .studio-authoring-block:hover, .studio-app .studio-authoring-block[data-active] { background: color-mix(in srgb, var(--canvas) 56%, transparent); @@ -2369,13 +2386,13 @@ .studio-app .studio-inline-asset-actions { justify-content: flex-start; } .studio-app .studio-block-editor { - margin-inline: -18px; - padding-inline: 18px; + margin-inline: -14px; + padding-inline: 14px; } .studio-app .studio-authoring-block { - grid-template-columns: 22px minmax(0, 1fr); - margin-inline: -18px 0; + grid-template-columns: 14px minmax(0, 1fr); + margin-inline: -14px 0; } .studio-app .studio-authoring-block__actions { display: none; } diff --git a/tests/e2e/tech-log-responsive.spec.ts b/tests/e2e/tech-log-responsive.spec.ts index 1e89ff4..3d1612a 100644 --- a/tests/e2e/tech-log-responsive.spec.ts +++ b/tests/e2e/tech-log-responsive.spec.ts @@ -34,6 +34,9 @@ for (const width of [1050, 1024, 980, 900, 820, 768, 767, 420, 390, 375] as cons page, "/studio/documents/11111111-1111-4111-8111-111111111111/edit", ); + // The body's block editor draws after the rest of the form. Measured + // before it, the page never overflowed; its gutter is what overflowed. + await page.locator("section.studio-block-editor").waitFor(); const dimensions = await horizontalOverflow(page); expect(dimensions.scrollWidth).toBeLessThanOrEqual(dimensions.clientWidth); await expect(page.getByRole("heading", { level: 1 })).toBeVisible();