Repository navigation
Conversation
When opening a workspace, preset commands were not running after the initialization script because useOpenWorktree bypassed the preset system. This merges setup commands with preset commands so both run in sequence (setup first, then preset).
The initialCwd from the default preset was being computed but not passed to createOrAttach, so custom working directories in presets were not being applied to terminal sessions.
📝 WalkthroughWalkthroughThe PR modifies workspace opening logic to consume preset data via a new hook instead of direct store access. It merges initial commands from workspace setup with preset commands, sources the working directory from presets, adjusts tab titling based on command presence, and conditions toast notifications on available initialization commands. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
Description
When opening a workspace with a setup script configured, preset commands were not running after the initialization script completed. This was because
useOpenWorktreebypassed the preset system entirely by using the rawaddTabfrom the store instead ofuseTabsWithPresets.This fix merges setup commands with preset commands so both run in sequence:
Related Issues
Type of Change
Testing
.superset/config.jsonecho "preset ran")Screenshots (if applicable)
N/A
Additional Notes
Resolves #834
The root cause was two-fold:
useOpenWorktreeuseduseTabsStore.addTabdirectly, bypassinguseTabsWithPresetsuseTabsWithPresets, the logic was OR-based (options OR preset), not AND-basedThe fix imports
useTabsWithPresets, merges the command arrays ([...setupCommands, ...presetCommands]), and passes the combined commands explicitly to prevent double-application of presets.Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.