Skip to content

fix(automations): stack the automation editor when the dialog is narrow - #48142

Merged
nwparker merged 1 commit into
stablyai:mainfrom
2SinceJuly:fix/48138-automation-editor-narrow
Nov 24, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
2SinceJuly:fix/48138-automation-editor-narrow

Conversation

@2SinceJuly

@2SinceJuly 2SinceJuly commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When the window was narrow, the "Edit automation" popup still tried to fit two columns side by side. The prompt box shrank to almost nothing and the settings ran off the right edge. Now, when the popup is too narrow, the two columns stack on top of each other and the whole form scrolls, so everything stays usable. At normal widths it looks exactly the same as before.

What Changed

Before, in a narrow window (for example 360px): the editor kept a fixed 320px settings sidebar next to the prompt column. The prompt editor collapsed to a 2x2px strip, the Time/Agent/Workspace fields were cut off at the dialog's right edge, and the footer hint was truncated to Onc….

After: below a 35rem (560px) dialog width, the prompt sits on top and the settings follow below it at full width, and the column area scrolls as one. At 35rem and wider the two-column layout is unchanged.

Mechanism:

  • DialogContent in AutomationEditorDialog.tsx is now the @container, so every container query in the editor measures the dialog's width. Its gap-0 p-0 now comes from surface="panel", which resolves to the same classes. This is the same pattern BotTemplatesDialog uses.
  • The column wrapper is flex-col and scrolls below @max-[35rem], and switches to flex-row at @min-[35rem].
  • AutomationEditorSettingsSidebar: both <aside> variants share one class string. In the stacked layout the sidebar is full width with a top border, and it no longer has its own scroll area.
  • AutomationEditorPromptSection sizes to its content when stacked. The Monaco box in AutomationEditorPromptEditor gets min-h-[max(12rem,40vh)], so the prompt editor stays usable, including under a long, wrapping name or a schedule warning.
  • AutomationEditorDialogFooter: the "Once saved, runs automatically until paused." hint is hidden below @max-sm (24rem), and Cancel/Save get ml-auto so they stay right-aligned.
  • automation-editor-prompt-options.ts: scrollbar.alwaysConsumeMouseWheel: false (the same option IpynbCellEditor uses). When the prompt editor reaches its scroll edge, the wheel scrolls the stacked form instead.
  • New AutomationEditorDialog.fixture.tsx renders the real dialog in phone-width (360), medium (600), long-name (360) and wide (1112) windows.

Why

The overflow came from the layout itself: a fixed 320px sidebar can't fit beside a prompt column in a dialog this narrow, so wrapping text inside the fields could never fix it. Shrinking the sidebar would leave the select controls too small to use. Stacking is what the app already does in BotTemplatesDialog.

The breakpoint is a container query on the dialog because that is the element whose width matters. It is set at 35rem so windows from about 594px to 671px keep main's two-column layout. At 40rem those widths would have stacked even though two columns still fit.

Linked Issue

Fixes #48138

Visual Proof

Headless component fixture shots (pnpm fixtures:shot), dark theme.

360px window, before (main): the prompt column is crushed to a strip, the settings run past the right edge, and the footer hint is truncated.

before narrow 360

360px window, after: the columns are stacked, the prompt editor is full width, the settings are below it (reached by scrolling), and Cancel/Save are right-aligned.

after narrow 360

360px window, after, with a 4-line name and a schedule warning: the prompt editor keeps its height.

after narrowLongName 360

Bot-target draft at 360px, before / after

before bot target 360
after bot target 360

593px window, before / after: a 561px dialog whose content box (excluding its 1px borders) is 559px, just under the 560px breakpoint, so it is the widest window that stacks. Main squeezes the prompt beside the sidebar.

before 593
after 593

Default width (1112px window, 1080px dialog), after: byte-identical to main (same image sha 38d52b01).

after wide 1112

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

  • Reproduced on main with headless pnpm fixtures:shot on macOS (a separate Mac), using the new fixture plus a Playwright geometry probe at window widths 320, 360, 591, 593, 600 and 1112.

    • Main at 360: row layout, prompt editor 2x2px, sidebar overflowing the dialog.
    • Fix at 360: stacked, editor 262x360px, sidebar inside the dialog, column scrollable.
  • At 600 and 1112 the screenshots are byte-identical to main: medium sha 2b787dc7, wide sha 38d52b01.

  • I compiled the classes with @tailwindcss/node. Stacking is @container (width < 35rem) and the row layout is @container (width >= 35rem), so there is no gap or overlap at the boundary.

  • Passing: oxlint, oxfmt --check, anti-slop and native code-quality oxlint (--deny-warnings), ast-grep scan, and check-changed-code-quality on the 7 touched files.

  • No unit test was added: this is a layout-only change and jsdom can't evaluate container queries. The fixture that renders the real dialog is the regression check (pnpm fixtures:shot "automations/authoring/AutomationEditorDialog:*").

  • Reachability: the Electron main window's minimum width is 600px, so the stacked layout shows up in desktop Orca only under zoom or in the 480px popout. In the web-client build it shows up directly.

  • Platforms: macOS. The change is pure CSS plus one Monaco option, with no platform branches.

Performance

None, because the change is CSS classes, container-type: inline-size on one modal, and one Monaco construction option, in a dialog opened on demand. It adds no JS, IPC, polling, I/O or subprocess work.

Benchmark on a separate Mac: 400 forced relayouts of the open dialog per case, main vs fix (performance.now resolution is 0.1ms).

  • Default width: p95 0.1ms vs 0.1ms.
  • 568px dialog: p95 0.1ms vs 0.2ms.
  • 328px dialog: p95 0.1ms vs 0.2ms.
  • Adversarial case (crossing the breakpoint on every relayout): max 0.3ms vs 0.7–1.3ms.

Every case is far under 16ms.

Risk

Level: Low

The riskiest part is @container on DialogContent. Inline-size containment means the dialog's width can't come from its content. The dialog already has an explicit width, and the default-width shot is byte-identical to main.

Other trade-offs:

  • With the change to alwaysConsumeMouseWheel, a wheel event at the prompt's scroll edge, including Ctrl+wheel, now goes to the surrounding page, the same as with any other text field.
  • The template popover (w-96) is still wider than a 360px dialog. That was already true before this PR.

To back it out, revert the commit. No saved data, settings, IPC or remote contract is involved.

Review

Reviewed by Claude and Codex, and verified by fixture shots before and after. Review fixes folded in:

  • The container query is measured against the dialog. In the original PR the container was on the wrapper, so the wrapper queried itself and the default width broke.
  • The stacked prompt editor no longer collapses.
  • Cancel/Save are right-aligned when the hint is hidden.
  • The breakpoint is 35rem, so windows from about 594px to 671px keep two columns.
  • The form scrolls when the wheel is over the editor.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security, cross-platform, SSH/remote, mobile and backwards compatibility are unaffected. The change only touches layout classes and one editor option inside a single renderer dialog.

Original fix by @2SinceJuly in #48142 (authorship preserved on the commit).

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The automation editor now stacks and scrolls its prompt and settings area below a 35rem container width. The prompt editor, footer, settings sidebar, and scrollbar options also receive updates. New fixtures render the dialog at 360px, 600px, and 1112px, including a narrow case with a longer name and schedule warning.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 31140

The automation editor now stacks and scrolls in narrow panes, and the two-column layout is kept at wider widths. The earlier problem of the responsive rules never activating is addressed. No remaining merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Directly linked issue #48138 requires the automation editor to fit a 360 px pane. Labels and fields must stay readable. All footer controls must stay visible and reachable.

Code at the reviewed head …
Out of Scope Changes check Passed All changed areas relate to the narrow-pane layout of the automation editor in #48138:
- AutomationEditorDialog.tsx: @container, surface="panel", and the stacked column wrapper.
- AutomationEditor…
Title check Passed The title "fix(automations): stack the automation editor when the dialog is narrow" matches the main change. The PR stacks the prompt and settings columns below a 35rem dialog width, and the title nam…
Description check Passed The description follows the template and covers each required section. It has an ELI5, a before/after What Changed section with the mechanism, a Why section that compares alternatives, a linked issue …
Full details: Linked Issues check

Explanation

Directly linked issue #48138 requires the automation editor to fit a 360 px pane. Labels and fields must stay readable. All footer controls must stay visible and reachable.

Code at the reviewed head (AutomationEditorDialog.tsx) confirms the mechanism:

  • DialogContent carries @container, so the inner wrapper's container-query variants resolve against an ancestor.
  • The column wrapper uses flex min-h-0 flex-1 flex-col scrollbar-sleek @max-[35rem]:overflow-y-auto @min-[35rem]:flex-row. The layout stacks and scrolls when narrow.
  • AutomationEditorPromptSection.tsx adds @max-[35rem]:flex-none. The prompt does not collapse to a strip when stacked.
  • AutomationEditorPromptEditor.tsx adds @max-[35rem]:min-h-[max(12rem,40vh)]. The Monaco area keeps a readable height when stacked.

The PR description states different values: a 40rem threshold, an 18rem prompt minimum, and DialogContent as the container. The code uses 35rem and max(12rem,40vh). The commit message matches the code. The code governs this verdict, so the description is stale.

The settings sidebar (w-[min(320px,100%)]) and footer (hides trailing copy below 24rem) were not readable in this review. Their diffs were not available. Their conclusions rest on the PR summary and the author's reported 360 px and 1080 px renders, which were not re-run. The structural evidence above supports the claim that the columns no longer overflow the dialog.

No automated test is added. #48138 does not require one.

Full details: Out of Scope Changes check

Explanation

All changed areas relate to the narrow-pane layout of the automation editor in #48138:

  • AutomationEditorDialog.tsx: @container, surface="panel", and the stacked column wrapper.
  • AutomationEditorPromptSection.tsx and AutomationEditorPromptEditor.tsx: stacked-height rules.
  • AutomationEditorSettingsSidebar.tsx and AutomationEditorDialogFooter.tsx: width and footer copy rules (per PR summary).
  • automation-editor-prompt-options.ts: sets scrollbar.alwaysConsumeMouseWheel to false. This is not in the PR description, but the commit message ties it to scrolling beyond the prompt edge in the stacked layout. It supports the stacked scroll behavior and is not unrelated.
  • AutomationEditorDialog.fixture.tsx: renders the real dialog at 360 px and 1080 px for verification. It does not change product behavior.

No unrelated files appear in the summary. Uncertainty: removing gap-0 p-0 from DialogContent could change its default spacing. The DialogContent diff was not readable, so this effect is not confirmed.

Full details: Title check

Explanation

The title "fix(automations): stack the automation editor when the dialog is narrow" matches the main change. The PR stacks the prompt and settings columns below a 35rem dialog width, and the title names the affected feature (automation editor) and the trigger (narrow dialog). It is specific and uses the conventional fix() prefix. It is 71 characters, which is acceptable.

Full details: Description check

Explanation

The description follows the template and covers each required section. It has an ELI5, a before/after What Changed section with the mechanism, a Why section that compares alternatives, a linked issue (Fixes #48138), visual proof for the before and after states, testing details, a performance line, a risk level, and a rollback plan. The AI Disclosure section is left empty, which the template allows for internal contributors. The description does not show the Performance line in the exact template form, but it gives a measured performance statement. The description also conflicts with the PR objectives on the breakpoint (40rem vs 35rem) and the prompt height rule. The author explains the change from the PR description, and the commit history has its own rules. The Checklist leaves the lint/typecheck/test/build item unchecked, which is a minor gap.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 46366bca-f41d-4c7e-94b4-bd2384008bd5
Commits

Reviewing files that changed from the base of the PR and between d0b50e4 and 311409d.

Files selected for processing: 7

  • src/renderer/src/components/automations/authoring/AutomationEditorDialog.fixture.tsx
  • src/renderer/src/components/automations/authoring/AutomationEditorDialog.tsx
  • src/renderer/src/components/automations/authoring/AutomationEditorDialogFooter.tsx
  • src/renderer/src/components/automations/authoring/AutomationEditorPromptEditor.tsx
  • src/renderer/src/components/automations/authoring/AutomationEditorPromptSection.tsx
  • src/renderer/src/components/automations/authoring/AutomationEditorSettingsSidebar.tsx
  • src/renderer/src/components/automations/authoring/automation-editor-prompt-options.ts
Files skipped from review as they are similar to previous changes: 3

  • src/renderer/src/components/automations/authoring/AutomationEditorDialogFooter.tsx
  • src/renderer/src/components/automations/authoring/AutomationEditorPromptSection.tsx
  • src/renderer/src/components/automations/authoring/AutomationEditorSettingsSidebar.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 632e4632-5548-4250-ab69-74f0d3def8c9
Commits

Reviewing files that changed from the base of the PR and between 30b7a2c and b9eda47.

Files selected for processing: 5

  • src/renderer/src/components/automations/authoring/AutomationEditorDialog.fixture.tsx
  • src/renderer/src/components/automations/authoring/AutomationEditorDialog.tsx
  • src/renderer/src/components/automations/authoring/AutomationEditorDialogFooter.tsx
  • src/renderer/src/components/automations/authoring/AutomationEditorPromptSection.tsx
  • src/renderer/src/components/automations/authoring/AutomationEditorSettingsSidebar.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@2SinceJuly

Copy link
Copy Markdown
Contributor Author

You're right, and it was worse than the diff suggested. Confirmed in ef46d112dd6.

The self-reference. @container on the wrapper can't drive the variants declared on that same wrapper, and nothing above it declared a container: DialogContent in ui/dialog.tsx has none, and the portal target is body. So both rules were dead. Measured on the fixture with the fix removed: containerType: normal on the dialog content, flex-direction: column and overflow-y: visible at 1080, 700, 500 and 360px. The dialog was a column at every width, and the narrow case never scrolled.

Fix. @container is now on DialogContent (AutomationEditorDialog.tsx:210), so the wrapper measures the dialog width — the same shape BotTemplatesDialog.tsx:161 already uses. Measured with the change: inline-size container, row at 1080 and 700, column with overflow-y: auto at 500 and 360.

The fixture. Your last point was the important one. It built its own div carrying an outer @container, so the wrapper had an ancestor container in the capture and none in production — the screenshots stayed identical before and after the change for exactly that reason. It now renders the real DialogContent with production's classes and no outer container. I also set the width inline, because DialogContent's own w-[min(1080px,calc(100vw-2rem))] follows the capture viewport rather than the fixture frame, which would have hidden the narrow case a second way.

Before (clipped prompt, footer riding over the settings) and after (prompt scrolls, footer anchored):

AutomationEditorDialog:narrow — before / after
AutomationEditorDialog:wide — before / after

@2SinceJuly
2SinceJuly force-pushed the fix/48138-automation-editor-narrow branch from ef46d11 to d0b50e4 Compare November 24, 2026 08:32
@2SinceJuly

Copy link
Copy Markdown
Contributor Author

Follow-up on how the change landed, since two details moved while I was verifying it.

  • @container is on DialogContent, and the dialog now passes surface="panel" instead of gap-0 p-0. The design-system lint rejects spacing tokens on DialogContent in any form (including data-[size=flush]:gap-0), and panel is the primitive that owns that spacing — the route BotTemplatesDialog already uses. pnpm check:code-quality:changed reports 0 new findings.
  • The numbers above are from the corrected fixture. Before: containerType: normal and flex-direction: column at 1080/700/500/360 px, so the row layout and the scroll region were both inert. After: inline-size, row at 1080 and 700, column with overflow-y: auto at 500 and 360.

pnpm tc:web and pnpm check:changed (31/31) both pass on the branch.

The editor dialog laid its prompt and a fixed 320px settings sidebar out
as a row at every width, so in a narrow window the prompt collapsed to a
sliver and the settings fields ran past the dialog edge.

Make DialogContent the @container (gap-0 p-0 now comes from the
equivalent surface="panel") so the editor's container queries measure
the dialog. Below a 35rem dialog the columns stack and scroll as one,
the sidebar takes the full width with a top border, and the prompt
editor keeps a min-height of max(12rem, 40vh). The footer hint hides
below @Max-sm so Cancel/Save keep their room and stay right-aligned.
Monaco no longer always consumes the wheel, so scrolling past the
prompt's edge scrolls the stacked form. Two-column layouts at 35rem and
up are unchanged.

Adds an AutomationEditorDialog fixture that renders the real dialog at
phone, medium and wide window widths.

Fixes stablyai#48138

Co-authored-by: Neil <[email protected]>
@nwparker
nwparker force-pushed the fix/48138-automation-editor-narrow branch from d0b50e4 to 311409d Compare November 24, 2026 09:13
@nwparker nwparker changed the title fix(automations): fit the editor in a narrow pane fix(automations): stack the automation editor when the dialog is narrow Nov 24, 2026
@nwparker
nwparker merged commit 284b6d8 into stablyai:main Nov 24, 2026
55 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fit the automation editor in narrow panes

2 participants