Skip to content

feat(automations): align layout with Codex - #501

Draft
lucas77778 wants to merge 13 commits into
masterfrom
chenyu/code-649
Draft

feat(automations): align layout with Codex#501
lucas77778 wants to merge 13 commits into
masterfrom
chenyu/code-649

Conversation

@lucas77778

Copy link
Copy Markdown
Member

Summary

  • Redesign Automations as a Codex-inspired searchable index and explicit master-detail layout.
  • Preserve the persistent app sidebar on Desktop and Web when Automations expands.
  • Reuse the shared pane transition for matching open/close, interruption, and reduced-motion behavior.

Linear: CODE-649

Verification

  • pnpm check:ci
  • pnpm test — 3040 passed, 1 skipped
  • pnpm -F @linkcode/webview build
  • Observed the real Electron flow: open, close, mid-flight reversal, reduced motion, and static app sidebar

Checklist

  • pnpm check:ci and pnpm test both pass
  • I ran the affected surface and observed the change working
  • No wire message changed
  • New code and assets are my own work
  • No documentation update is required

Copilot AI lite review requested due to automatic review settings September 1, 2026 07:28
@linear-code

linear-code Bot commented Sep 1, 2026

Copy link
Copy Markdown

CODE-649

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown

Greptile Summary

The PR redesigns Automations into a searchable, responsive master-detail surface embedded within the persistent Desktop and Webview shells.

  • Moves Desktop Automations into a workspace overlay that preserves the app sidebar.
  • Nests the Webview Automations route under the resident workbench shell.
  • Adds searchable schedule and loop indexes with explicit detail and creation panes.
  • Promotes the pane-transition utility into the shared presentation package.

Confidence Score: 3/5

The PR should not merge until the narrow master-detail layout and stale Webview Resources column are corrected.

Narrow Automations viewports can make the selected detail or creation form unreachable, while wide Webview layouts can retain session-specific Resources beside the replacement Automations surface.

Files Needing Attention: packages/client/workbench/src/automations/automations-view.tsx; apps/webview/src/shell/web-workbench-shell.tsx

Important Files Changed

Filename Overview
packages/client/workbench/src/automations/automations-view.tsx Introduces the searchable master-detail layout, but the narrow expanded state stacks two full-height sections and can place details outside the clipped viewport.
apps/webview/src/shell/web-workbench-shell.tsx Embeds Automations in the persistent shell, but leaves the active session's floating Resources column visible on that route.
apps/desktop/src/renderer/src/shell/desktop-shell.tsx Moves Automations into the workspace while preserving the sidebar and correctly suppresses session resource presentation.
apps/desktop/src/renderer/src/shell/layout/workspace.tsx Adds an inert workspace overlay above the existing main, right, and bottom panes.
packages/presentation/ui/src/shell/pane-transition.ts Promotes the existing transition state machine to shared UI and makes optional geometry updates usable by Automations.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Nav[Automations navigation] --> Shell{Application shell}
  Shell -->|Desktop| Overlay[Workspace overlay]
  Shell -->|Webview| Main[ShellFrame mainContent]
  Overlay --> View[AutomationsView]
  Main --> View
  View --> Search[Searchable schedule/loop index]
  Search --> Select[Select or create]
  Select --> Detail[Master-detail pane]
  Detail --> Thread[Open run thread]
  Thread --> Session[Workbench session selection]
Loading

Comments Outside Diff (1)

  1. apps/webview/src/shell/web-workbench-shell.tsx, line 43 (link)

    P1 Resources persist across Automations

    When Resources is open in the floating layout and the user navigates to /automations, resourcesFloatingOpen remains true, leaving the active session's Resources card visible and narrowing the Automations surface after its header control disappears.

    Knowledge Base Used: Webview interface and presentation

Reviews (1): Last reviewed commit: "feat(automations): align layout with Cod..." | Re-trigger Greptile

Comment on lines +123 to +127
<div
className={cn(
'grid h-full min-h-0 grid-cols-1 bg-background lg:[container-type:inline-size] lg:transition-[grid-template-columns] motion-reduce:transition-none',
expanded ? 'lg:grid-cols-[22rem_calc(100%_-_22rem)]' : 'lg:grid-cols-[100%_0%]',
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Narrow details render offscreen

When an automation is selected or created below 1024px, both full-height sections occupy implicit rows in the fixed-height single-column grid, placing the detail form below the clipped viewport along with its close control.

Knowledge Base Used: Webview interface and presentation

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copilot AI 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.

Pull request overview

Redesigns the Automations surface into a Codex-style searchable index that expands into a master–detail layout, while keeping the app sidebar persistent on Desktop and Web. It also centralizes the shared pane transition logic so Automations can match existing open/close and reduced-motion behavior.

Changes:

  • Add shell support for “main content override” (Automations) while keeping the shell sidebar visible and correctly highlighted.
  • Rework Automations UI to a searchable index with an expandable master–detail layout, plus new i18n strings.
  • Share/export the pane transition utility from @linkcode/ui and update desktop/web shells + tests to consume it.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/presentation/ui/src/shell/shell-frame.tsx Adds mainContent override and automationsActive to keep sidebar + allow Automations to replace the thread surface.
packages/presentation/ui/src/shell/session-sidebar.tsx Threads the automationsActive state into the sidebar’s Automations entry.
packages/presentation/ui/src/shell/pane-transition.ts Makes size optional and generalizes the pane transition hook for non-resizable consumers.
packages/presentation/ui/src/shell/index.ts Re-exports the pane transition utilities from the shell barrel.
packages/presentation/i18n/src/locales/zh-cn.ts Adds Automations description/search/matching strings in zh-CN.
packages/presentation/i18n/src/locales/en.ts Adds Automations description/search/matching strings in English.
packages/client/workbench/src/automations/store.ts Adds a collapse() action and updates selection semantics for the new layout.
packages/client/workbench/src/automations/schedule/pane.tsx Converts schedule list to a searchable index list (no embedded detail).
packages/client/workbench/src/automations/pane-layout.tsx Updates master button + skeleton styling to match the new index layout.
packages/client/workbench/src/automations/loop/pane.tsx Converts loop list to a searchable index list (no embedded detail).
packages/client/workbench/src/automations/automations-view.tsx Implements the new expandable index ↔ master–detail Automations layout and shared transition handling.
apps/webview/src/shell/web-workbench-shell.tsx Mounts Automations inside the shell via mainContent and keeps sidebar persistent; updates navigation behaviors.
apps/webview/src/routes/workbench-route.tsx Updates page title handling so /automations uses the Automations title while rendering the workbench shell.
apps/webview/src/routes/automations.tsx Removes the dedicated full-page Automations route (now integrated into the shell).
apps/webview/src/router.tsx Routes /automations through the workbench route tree (same shell, different pathname).
apps/desktop/src/renderer/src/shell/layout/workspace.tsx Adds workspaceOverlay slot that covers workspace panes while preserving the persistent app sidebar.
apps/desktop/src/renderer/src/shell/desktop-shell.tsx Mounts Automations as a workspace overlay and wires sidebar active state; disables resources while Automations is open.
apps/desktop/src/renderer/src/index.css Updates documentation comment to reference @linkcode/ui’s SHELL_TRANSITION.
apps/desktop/src/renderer/src/automations/automations-view.tsx Removes the dedicated full-page Automations desktop overlay component.
apps/desktop/src/renderer/src/app.tsx Removes Automations from the “full-page overlay” underlay behavior; Settings remains the only full-page overlay.
apps/desktop/src/renderer/src/tests/pane-transition.test.ts Switches pane transition tests to use the shared @linkcode/ui exports.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +762 to +764
<div className="min-h-0 flex-1">
<AutomationsView onOpenSession={onSelectSession} />
</div>

@pullfrog pullfrog 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.

ℹ️ Minor suggestions only — nothing blocking.

Reviewed changes

  • Read the full diff (21 files) end to end: the two deleted full-page surfaces, the desktop workspaceOverlay grid cell, the webview pathless layout route, the pane-transition.ts move into packages/presentation/ui, and the AutomationsView rework.
  • Confirmed pane-transition.ts is a genuine rename — the old apps/desktop/.../shell/layout/ path is gone and the new packages/presentation/ui/src/shell/ one is present, even though the formatted diff omits the rename header.
  • Traced every exit path now that the explicit Back button is deleted. Sidebar thread select and new-draft both funnel through applySelection/startDraft in packages/client/workbench/src/surface/use-workbench-sessions.ts, which call setOverlay(null); the desktop titlebar back arrow (shell/chrome/chrome.tsx:524) traverses history to the same place. Users are not stranded.
  • Checked the translucent-shell ghosting invariant from .claude/rules/frontend.md: the overlay cell is opaque bg-background and correctly stacked at z-40 above the z-10/z-20 panes inside the isolate context, and dockedInert now trips on workspaceOverlayOpen so the covered panes and sashes are inert. The sidebar sash staying live is correct here.
  • Reviewed the usePaneTransition phase machine against the new open: expanded && splitLayout input plus the grid-template-columns-guarded transitionrun/transitionend/transitioncancel handlers — no stuck-phase or double-fallback path.
  • Verified the webview overrides for onSelectSession/onStartDraft are placed after {...props} so the navigate('/') wrappers actually win.
  • Built a Chromium repro of the sub-lg stacked layout at 940×700 (desktop MIN_WINDOW_SIZE.width is 940, below the 1024px lg breakpoint the new layout switches on) at 3/8/12/20 rows, because I suspected the two auto grid rows would overflow the fixed-height container and clip the detail pane. They don't: align-content: stretch yields two 350px rows, both the list ul and the detail scroller become scrollable, and the close button stays visible. No issue.

The layout work looks solid. Three small observations that have no single diff line to anchor to:

ℹ️ No Escape binding for desktop Automations

Deleting apps/desktop/src/renderer/src/automations/automations-view.tsx removed the only explicit dismissal affordance for this surface on desktop. Settings — the sibling overlay — binds CLOSE_SETTINGS_SHORTCUT = { key: 'Escape' } at settings-view.tsx:55. Automations now relies entirely on picking a thread, starting a draft, or the titlebar back arrow. Worth adding the same Escape binding for symmetry; not blocking since no path strands the user.

ℹ️ New pure helpers land without unit tests

collapse() in automations/store.ts and the new getAutomationDetailTarget / detailTargetIdentity helpers plus the list query filter are all pure and cheap to test, and the repo already unit-tests helpers of exactly this shape (sidebar/ordering.ts, navigation/history.ts). collapse() in particular encodes the behavior change away from "null falls back to the first item", which is the kind of thing a test pins down.

ℹ️ Desktop chrome still describes the covered thread

While the workspace overlay is up, the titlebar keeps rendering the hidden thread's title, DiffStatChip, and panel toggles. The panes underneath are correctly inert, so this is cosmetic rather than a ghosting problem — but the chrome is describing something the user can't see. May well be intentional for this iteration; flagging in case it isn't.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Claude Opus𝕏

pageTitle: 'Automations',
description: 'Schedule agent work or run tasks in a loop until verification passes.',
back: 'Back',
closeDetails: 'Close details',

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.

back on the line above is now a dead key — this PR deleted both of its call sites (apps/desktop/src/renderer/src/automations/automations-view.tsx and apps/webview/src/routes/automations.tsx), and grep finds no remaining t('back') in the workbench.automations namespace (the other hits are the settings, dialog, and browser-pane namespaces). Same in zh-cn.ts. Worth dropping both while the context is fresh.

For contrast, pageTitle is still live — apps/webview/src/routes/workbench-route.tsx:16 reads it for the /automations path.

@xiaoland
xiaoland marked this pull request as draft September 8, 2026 12:35
Copilot AI review requested due to automatic review settings September 9, 2026 02:31

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The persistent DesktopChrome never suppressed its right-rail panel
toggles or session title/menu while the Automations overlay covers
the workspace, so they kept showing on top of it. Null out
rightControls and titleContent while automationsOpen, matching the
existing !automationsOpen gate already used for the Resources control.
…i-select

- Move Loop's agent/harness selector out of Advanced settings into the
  primary flow, alongside project selection.
- Move Schedule's timezone field into Advanced settings now that it's
  confirmed load-bearing for cadence calculation (DST-aware next-run
  math), not cosmetic.
- Convert the misfire policy control from a radio group to a dropdown.
- Support selecting several weekdays for a weekly schedule: the form
  model now carries an array, the cadence builder joins them into a
  comma-separated cron field (croner already parses that), and the
  preset recognizer round-trips a multi-weekday cron expression back
  into the friendly weekly UI. Adds a new TaskMultiSelect checklist
  popover to back the picker.
- New ResizeHandle (packages/presentation/ui): a standalone drag
  divider that reads no sibling DOM geometry and owns no styling
  contract, unlike the desktop shell's Sash — any panel can report a
  clamped size through onResize/onResizeEnd and decide how to render
  and persist it. Live drag frames stay local to the caller; only the
  settled size needs persisting.
- New persisted useAutomationDetailWidthStore backing the Automations
  detail pane's width (420-960px, default 640).
- automations-view.tsx: the list pane is now the fluid grid column and
  the detail pane is the fixed, user-resizable one, mirroring how the
  session view's own right panel works. Also adds a fixed top-right
  slot (DetailHeaderSlotProvider) next to the close button for detail
  views to portal contextual header actions into, and removes the
  list pane's masterDetailVisible-driven title/button/padding swap so
  expanding or collapsing the detail pane only animates the outer grid
  track — nothing inside the list has to reflow or pop.
- Drop the max-w-xl cap on the create-form pane so its content fills
  the resizable width instead of re-centering at a fixed 576px.
- Schedule and Loop detail views now portal their AutomationActions
  overflow menu into the fixed slot next to the close button instead
  of rendering it inline in their own scrollable header — the two
  controls were only ever coincidentally adjacent, and scrolled apart
  as soon as the panel's content moved.
- Split Schedule's run history out of the disclosure that used to sit
  after the Save/Cancel row into its own "Run history" tab, alongside
  an "Edit" tab holding the existing form — nothing renders below Save
  now.
- Remove the duplicate heading text repeated inside the Loop log and
  Schedule run-history disclosures (the trigger already shows it).
- Give the discard-unsaved-changes and delete-confirmation dialogs
  their missing padding via AlertDialogHeader/AlertDialogFooter,
  matching every other dialog in the codebase.
- Drop the now-unused "title" string; the in-page <h1> it backed was
  removed together with the list pane's other content that swapped on
  selection.
The status badge sat inline with the truncated name (top-aligned with
the rest of the row), while the sibling "more actions" button is
vertically centered against the row's full height — visibly offset
once the list pane is wide enough for a two-line row to have real
height to spare. A container query on the row now moves the badge to
a trailing, self-centered column past 380px of row width, matching
the actions button; narrower rows keep the existing inline placement.
Copilot AI review requested due to automatic review settings September 9, 2026 09:54

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

3 participants