Skip to content

fix(desktop): open terminal presets as pane instead of new tab#430

Closed
saddlepaddle wants to merge 1 commit intomainfrom
frightened-boa-63884b
Closed

fix(desktop): open terminal presets as pane instead of new tab#430
saddlepaddle wants to merge 1 commit intomainfrom
frightened-boa-63884b

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Dec 19, 2025

Summary

  • Change default behavior when selecting a terminal preset to add as a split pane in the current tab instead of creating a new tab
  • Falls back to creating a new tab if no active tab exists
  • Context menu still offers both "Open as New Tab" and "Open as Pane in Current Tab" options

Test plan

  • Click preset in sidebar with existing tab → should add pane (split)
  • Click preset in sidebar with no tabs → should create new tab
  • Use Cmd+K command dialog to select preset → should add pane
  • Right-click context menu → should still offer both options

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Preset activation now opens content as a pane within the active tab instead of creating a new tab, improving workflow efficiency. Previous behavior is preserved when no active workspace or tab exists.

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

Change the default behavior when selecting a terminal preset so it adds as a split pane in the current tab instead of creating a new tab.

The context menu still offers both options for users who prefer new tabs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 19, 2025

Walkthrough

This PR modifies preset activation behavior in TabsView, redirecting preset selection from opening new tabs to creating panes within the active tab by rerouting through handleSelectPresetAsPane instead of handleSelectPreset in both button handlers and the command dialog.

Changes

Cohort / File(s) Summary
Preset activation rebinding
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
Changed preset selection to route through handleSelectPresetAsPane instead of handleSelectPreset, altering preset activation to open as panes within the active tab rather than creating new tabs. Updates both onClick handler and TabsCommandDialog prop. Fallback behavior preserved when no active workspace or tab exists.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus areas during review:
    • Verify that handleSelectPresetAsPane is correctly defined and handles all necessary pane creation logic
    • Confirm fallback behavior works correctly when there is no active workspace or active tab
    • Test preset activation through both the button onClick and TabsCommandDialog paths to ensure consistent behavior
    • Validate that existing preset functionality is not broken by the routing change

Possibly related PRs

Poem

🐰 A preset walks into a tab with glee,
But now finds itself in a pane, you see!
No new tab opens—the pane's more neat,
Where presets nestle, their new retreat! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: shifting preset activation from opening a new tab to opening as a pane within the active tab.
Description check ✅ Passed The description provides a clear summary, test plan, and notes about fallback behavior, though it lacks explicit links to related issues and a formal change type classification.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch frightened-boa-63884b

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b4efd9 and 529412b.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
apps/desktop/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)

apps/desktop/**/*.{ts,tsx,js,jsx}: For Electron interprocess communication, ALWAYS use trpc as defined in src/lib/trpc
Use alias as defined in tsconfig.json when possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary.

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Avoid using any type in TypeScript - maintain type safety unless absolutely necessary

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run Biome for formatting, linting, import organization, and safe fixes at the root level using bun run lint:fix

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
**/{components,features}/**/[!.]*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Organize project structure with one folder per component: ComponentName/ComponentName.tsx with index.ts barrel export

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
**/{components,features}/**/*.{ts,tsx,test.ts,test.tsx,stories.tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Co-locate component dependencies (utils, hooks, constants, config, tests, stories) next to the file using them

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never import Node.js modules in renderer process or shared code - use only in main process (src/main/)

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
apps/desktop/src/{main,renderer,preload}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use type-safe IPC communication - define channel types in apps/desktop/src/shared/ipc-channels.ts before implementing handlers

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
**/*.{tsx,css}

📄 CodeRabbit inference engine (AGENTS.md)

Use React + TailwindCSS v4 + shadcn/ui for UI development

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
**/{components,features}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

**/{components,features}/**/*.tsx: Nest components in parent's components/ folder if used only once, promote to highest shared parent's components/ if used 2+ times
Use one component per file - do not combine multiple components in a single file

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (2)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (2)

219-237: LGTM! Default preset behavior successfully changed to open as pane.

The change correctly implements the PR objective by routing preset clicks through handleSelectPresetAsPane, which adds the preset as a split pane in the current tab. The fallback to handleSelectPreset when no active tab exists (lines 104-109) ensures the feature degrades gracefully. The context menu at lines 216-217 still offers both options, preserving user choice.

Please verify that this UX behavior change has been tested according to the test plan mentioned in the PR description:

  • Clicking a preset with an existing tab adds a pane
  • Clicking with no tabs creates a new tab
  • The context menu still provides both options

243-250: LGTM! Command dialog preset selection now consistent with button behavior.

The change ensures that selecting a preset via the Cmd+K command dialog also creates a pane in the current tab rather than a new tab, maintaining consistency with the direct preset button clicks. The same fallback logic applies when no active tab exists.


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 Kitenite deleted the frightened-boa-63884b branch December 20, 2025 18:11
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.

1 participant