Skip to content

feat(desktop): add parallel execution mode for terminal presets#855

Merged
Kitenite merged 7 commits intosuperset-sh:mainfrom
chasemcdo:feat-commands-open-new-terminals
Jan 25, 2026
Merged

feat(desktop): add parallel execution mode for terminal presets#855
Kitenite merged 7 commits intosuperset-sh:mainfrom
chasemcdo:feat-commands-open-new-terminals

Conversation

@chasemcdo
Copy link
Copy Markdown
Contributor

@chasemcdo chasemcdo commented Jan 20, 2026

Summary

Add an executionMode field to terminal presets allowing commands to run in separate split panes (parallel) instead of sequentially in one terminal.

Problem

Currently, terminal presets run all commands sequentially in a single terminal (joined with &&). For development workflows that require multiple concurrent processes (e.g., npm run dev, npm run watch, npm test), users have to manually create separate terminals for each command.

Solution

  • Add optional executionMode field to preset schema (sequential | parallel)
  • When set to "Parallel" with multiple commands, create a multi-pane tab with one pane per command
  • Add balanced layout utility that creates grid layouts for 3+ panes
  • Add execution mode dropdown in Terminal Settings UI

Type of Change

  • New feature (non-breaking change which adds functionality)

Test plan

  • Create a preset with multiple commands (e.g., npm run dev, npm run watch, npm test)
  • Set execution mode to "Parallel" in Settings → Terminal
  • Select the preset from the tab dropdown
  • Verify multiple split panes appear in one tab, each running its command
  • Verify "Sequential" mode still joins commands with && as before
  • Verify single-command presets work the same regardless of mode

Summary by CodeRabbit

  • New Features

    • Terminal presets can store an execution mode (sequential or parallel); Settings shows a Mode column to edit per-preset.
    • Presets marked parallel open a tab with multiple panes so commands run concurrently.
    • Tabs store now supports creating tabs with multiple panes in a balanced layout.
  • Tests

    • Added comprehensive tests for multi-pane layout behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 20, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds an optional executionMode to terminal presets, per-preset UI to edit it, persistence via the settings TRPC router, multi-pane tab creation for parallel presets, a balanced multi-pane layout builder, and tests for the layout utility.

Changes

Cohort / File(s) Summary
Schema & Types
packages/local-db/src/schema/zod.ts
Exported EXECUTION_MODES and ExecutionMode type; added optional executionMode to terminalPresetSchema.
Settings Router
apps/desktop/src/lib/trpc/routers/settings/index.ts
createTerminalPreset and updateTerminalPreset inputs accept optional executionMode; updateTerminalPreset applies preset.executionMode = input.patch.executionMode when provided.
Settings UI
apps/desktop/src/renderer/routes/_authenticated/settings/terminal/components/TerminalSettings/TerminalSettings.tsx, .../PresetRow/PresetRow.tsx
Imported ExecutionMode/EXECUTION_MODES; TerminalSettings adds handleExecutionModeChange and calls updatePreset.mutate; PresetRow gains onExecutionModeChange prop and a Select to edit per-row executionMode (defaults to "sequential" if unset).
Workspace & Tab Interaction
apps/desktop/src/renderer/screens/.../GroupStrip/GroupStrip.tsx
If preset executionMode === "parallel" and multiple commands, uses addTabWithMultiplePanes to create one pane per command; otherwise creates a single-pane tab.
Tabs Store API & Types
apps/desktop/src/renderer/stores/tabs/types.ts, apps/desktop/src/renderer/stores/tabs/store.ts
Added AddTabWithMultiplePanesOptions type and addTabWithMultiplePanes(workspaceId, options) method returning { tabId, paneIds }; method creates panes, builds a balanced layout, and updates store state.
Tab Layout Utilities & Tests
apps/desktop/src/renderer/stores/tabs/utils.ts, apps/desktop/src/renderer/stores/tabs/utils.test.ts
Added buildMultiPaneLayout(paneIds: string[], direction = "column") to construct a balanced MosaicNode layout; comprehensive tests for empty/single/multi-pane scenarios.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant SettingsUI as "Settings UI"
    participant PresetRow as "PresetRow"
    participant TRPC as "Settings TRPC"
    participant Workspace as "GroupStrip"
    participant TabsStore as "Tabs Store"

    User->>SettingsUI: change execution mode for preset
    SettingsUI->>PresetRow: onExecutionModeChange(rowIndex, mode)
    PresetRow-->>SettingsUI: new mode selected
    SettingsUI->>TRPC: updatePreset.mutate({ id, patch: { executionMode } })
    TRPC->>TRPC: persist executionMode

    User->>Workspace: click preset (parallel, multiple commands)
    Workspace->>TabsStore: addTabWithMultiplePanes(workspaceId, { commands, initialCwd })
    TabsStore->>TabsStore: create pane per command
    TabsStore->>TabsStore: buildMultiPaneLayout(paneIds)
    TabsStore-->>Workspace: return { tabId, paneIds }
    Workspace->>Workspace: render multi-pane tab
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I toggle modes from sequential to spree,
Carrots of commands split — one, two, three,
Tabs grow panes in a tidy design,
Presets saved snug, each mode set in line,
A rabbit hops, delighted — panes align!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(desktop): add parallel execution mode for terminal presets' clearly and concisely describes the main feature being added—a new parallel execution mode for terminal presets.
Description check ✅ Passed The pull request description is comprehensive and follows the template structure with Summary, Problem, Solution, Type of Change, and Test Plan sections fully filled out.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kitenite
Copy link
Copy Markdown
Collaborator

I'm adding a few mods such as remote branch and from PR link. and handling if pr branch exists already. will clean up and push to the PR and merge

@chasemcdo
Copy link
Copy Markdown
Contributor Author

I'm adding a few mods such as remote branch and from PR link. and handling if pr branch exists already. will clean up and push to the PR and merge

imagine this was intended for the other PR haha

@Kitenite
Copy link
Copy Markdown
Collaborator

It was. it was late haha

chasemcdo and others added 5 commits January 24, 2026 20:57
Add an executionMode field to terminal presets allowing commands to run
in separate split panes (parallel) instead of sequentially in one terminal.

- Add EXECUTION_MODES constant and executionMode field to preset schema
- Add buildMultiPaneLayout utility for balanced multi-pane layouts
- Add addTabWithMultiplePanes store action
- Update GroupStrip to handle parallel preset selection
- Add execution mode dropdown to preset settings UI
- Update tRPC mutations to support executionMode
Add w-full to SelectTrigger so the mode dropdown fills its container
instead of auto-sizing to content, ensuring Sequential and Parallel
have the same width.
- Add EXECUTION_MODES validation in PresetRow to guard type assertion
- Refactor duplicated tab renaming logic in GroupStrip
- Add unit tests for buildMultiPaneLayout utility
- Add tooltip to Mode column header explaining execution modes
@Kitenite Kitenite force-pushed the feat-commands-open-new-terminals branch from b6b19e8 to e758b6f Compare January 25, 2026 04:58
@cursor
Copy link
Copy Markdown

cursor Bot commented Jan 25, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on February 14.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@Kitenite Kitenite merged commit 832e016 into superset-sh:main Jan 25, 2026
1 check was pending
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.

2 participants