feat(desktop): V2 preset execution mode parity with V1#3354
Conversation
…preset hotkeys V2 presets previously ignored executionMode, always creating a single tab with commands joined by &&. Now split-pane, new-tab, and new-tab-split-pane modes work correctly, each command gets its own pane with initialCommand, and OPEN_PRESET_1-9 hotkeys are functional.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughIntroduces a centralized Changes
Sequence DiagramsequenceDiagram
participant User as User
participant Hotkey as Hotkey Handler
participant PresetBar as V2PresetsBar
participant Hook as useV2PresetExecution
participant Store as Workspace Store
User->>Hotkey: Press OPEN_PRESET_1
Hotkey->>Hook: openPresetByIndex(0) / executePreset(preset)
Hook->>Store: Read state (activeTabId, etc.)
Hook->>Store: Resolve target from preset.executionMode
Hook->>Store: Create tab(s) and/or pane(s) per plan
Store-->>Hook: Updated workspace state
Hook-->>Hotkey: Completion
User->>PresetBar: Click "Run preset"
PresetBar->>Hook: executePreset(preset)
Hook->>Store: Same execution flow as hotkey
Store-->>PresetBar: Panes/tabs rendered
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR brings V2 workspace preset execution to parity with V1 by wiring up Key changes:
Minor issues found (all P2/style, none affect runtime):
Confidence Score: 5/5Safe to merge — the logic is correct, well-structured, and reuses the proven V1 launch-plan utility; all findings are non-blocking cleanup suggestions. All five launch plans are correctly mapped to V2 store calls, the useV2PresetExecution.ts — three small dead-code/unused-param items worth cleaning up. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User: click bar item or press Ctrl+1-9] --> B[executePreset]
B --> C{resolveTarget executionMode}
C -->|split-pane| D[target = active-tab]
C -->|new-tab / new-tab-split-pane| E[target = new-tab]
D --> F[getPresetLaunchPlan]
E --> F
F -->|new-tab-single| G[addTab 1 pane]
F -->|new-tab-multi-pane| H[addTab N panes]
F -->|new-tab-per-command| I[addTab x N, one per command]
F -->|active-tab-single| J[addPane to activeTab]
F -->|active-tab-multi-pane| K[addPane x N to activeTab]
J -->|no activeTab fallback| G
K -->|no activeTab fallback| H
Reviews (1): Last reviewed commit: "feat(desktop): respect executionMode in ..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/desktop/plans/20260411-v2-preset-parity.md`:
- Around line 69-71: The note incorrectly states that V2PresetsBar calls
useV2PresetExecution; update the wording to reflect that page.tsx invokes
useV2PresetExecution and then passes the resulting matchedPresets and
executePreset down as props to V2PresetsBar (and that executePreset is forwarded
to V2PresetBarItem as onExecutePreset). Mention the actual data flow: page.tsx
-> useV2PresetExecution -> { matchedPresets, executePreset } -> V2PresetsBar
props -> V2PresetBarItem onExecutePreset.
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/`$workspaceId/hooks/useWorkspaceHotkeys/useWorkspaceHotkeys.ts:
- Around line 247-263: The hotkey handler openPresetByIndex currently looks up
presets from matchedPresets causing Ctrl+1..9 to target unpinned items; change
openPresetByIndex to read from the pinned preset list (e.g.,
pinnedPresets[index]) and update its dependency array to include pinnedPresets
(instead of or in addition to matchedPresets and executePreset), and keep the
same guard (if (preset) executePreset(preset)); also ensure the useHotkey
bindings (OPEN_PRESET_1..9) remain unchanged but now call the updated
openPresetByIndex so hotkeys map to the visible pinned preset bar.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9d4eea64-bdd0-494c-9196-b0c91136df87
📒 Files selected for processing (7)
apps/desktop/plans/20260411-v2-preset-parity.mdapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/V2PresetsBar/V2PresetsBar.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/V2PresetsBar/components/V2PresetBarItem/V2PresetBarItem.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useV2PresetExecution/index.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useV2PresetExecution/useV2PresetExecution.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useWorkspaceHotkeys/useWorkspaceHotkeys.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/page.tsx
…ad code branch - Remove unused `workspaceId` from `UseV2PresetExecutionArgs` and call site - Remove unreachable `commands.length === 0` guard in `new-tab-per-command` case - Fix plan doc wording to match actual data flow
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
) * feat(desktop): respect executionMode in V2 preset execution and wire preset hotkeys V2 presets previously ignored executionMode, always creating a single tab with commands joined by &&. Now split-pane, new-tab, and new-tab-split-pane modes work correctly, each command gets its own pane with initialCommand, and OPEN_PRESET_1-9 hotkeys are functional. * fix(desktop): address PR review — remove unused workspaceId param, dead code branch - Remove unused `workspaceId` from `UseV2PresetExecutionArgs` and call site - Remove unreachable `commands.length === 0` guard in `new-tab-per-command` case - Fix plan doc wording to match actual data flow
Summary
executionMode(split-pane,new-tab,new-tab-split-pane) instead of always creating a single tab with commands joined by&&initialCommandset, using the V2 store'saddTab(balanced split tree) andaddPaneAPIsuseV2PresetExecutionhook shared by the preset bar and hotkeysTest plan
split-panemode — click bar item, verify panes are added to the active tabnew-tabmode — click bar item, verify separate tabs are created (one per command)new-tab-split-panemode — click bar item, verify a new tab opens with split panesSummary by cubic
V2 presets now respect their
executionModelike V1, opening tabs/panes per command with clean layouts. Preset hotkeys 1–9 work in V2 workspaces.New Features
executionMode: split-pane, new-tab, and new-tab-split-pane.initialCommand(no "&&").addTab/addPane, with fallback to a new tab if no active tab.Refactors
useV2PresetExecutionhook and simplifiedV2PresetsBar; renamed callback to onExecutePreset and menu to “Run preset.”getPresetLaunchPlanfor consistent launch behavior.workspaceIdparam and an unreachable branch in per-command tab creation; updated the plan doc wording to match data flow.Written for commit e423c75. Summary will update on new commits.
Summary by CodeRabbit
New Features
UI Updates
Documentation