Skip to content

feat(desktop): show preset buttons under New Terminal button#302

Merged
Kitenite merged 2 commits intomainfrom
forward-tarsier-107ea0
Dec 10, 2025
Merged

feat(desktop): show preset buttons under New Terminal button#302
Kitenite merged 2 commits intomainfrom
forward-tarsier-107ea0

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Dec 9, 2025

Summary

  • Add terminal preset quick-access buttons directly below the "+ New Terminal" button in the sidebar
  • Presets displayed as child items with left border for visual hierarchy
  • Added terminal icon to tab items for consistency

Test plan

  • Create a terminal preset in settings
  • Verify preset button appears under "+ New Terminal" button
  • Click preset button and verify terminal opens with preset configuration
  • Verify styling looks consistent with parent button

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a presets panel in the sidebar for quick preset selection; entries can be selected to apply a preset (disabled when no active workspace).
    • Each preset entry displays the preset name (or "Unnamed") and shows the working directory as hover text.
  • Style

    • Tabs and preset entries now include a command-line icon for clearer visual cues.

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

Add terminal preset quick-access buttons directly below the New Terminal
button in the sidebar. Presets are displayed as child items with a left
border for visual hierarchy, making them easily accessible without
opening the command dialog.

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

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

vercel Bot commented Dec 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
website Ready Ready Preview Comment Dec 10, 2025 1:11am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 9, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a command-line icon to tab labels and a new conditional "presets" UI block in the workspace sidebar's tabs area that lists selectable presets with names and working-directory tooltips.

Changes

Cohort / File(s) Change Summary
Tab icon enhancement
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabItem/index.tsx
Adds HiMiniCommandLine import and renders the command-line icon alongside the tab label; no public API changes.
Presets UI integration
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
Imports HiMiniCommandLine and injects a conditional presets block that renders ghost Button entries (icon + name or "Unnamed"), uses cwd as title, disables entries when no active workspace, and calls handleSelectPreset(preset) on click.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Focus review on UI layout and accessibility of the added icon and presets list.
  • Verify tooltip (cwd) correctness and that disabled state respects workspace presence.

Possibly related PRs

Poem

🐰
Hopping through tabs with a click and a grin,
A tiny command-line icon peeks in,
Presets like carrots lined up to show,
Click one, and off to the cwd we go,
Little rabbit cheers — ready, set, go! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
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.
Description check ❓ Inconclusive The PR description covers key aspects but deviates from the template structure; it lacks the formal template sections (Related Issues, Type of Change, Testing steps, Screenshots). Restructure the description to follow the repository template with proper sections including Related Issues, Type of Change checkbox, formal Testing section, and remove the generation note for professionalism.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: adding preset buttons below the New Terminal button, which is reflected in the file changes and objectives.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 24462c5 and 4604b31.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabItem/index.tsx (2 hunks)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (2 hunks)

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 9, 2025

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabItem/index.tsx (1)

5-5: Tab icon addition looks consistent; consider optional accessibility polish

The new HiMiniCommandLine icon in the tab button aligns well with the presets UI and improves scannability. No behavioral risks from this change.

If the icon is purely decorative (the tab label already conveys meaning), consider marking it aria-hidden (and/or using a shared “Icon + label” pattern) so screen readers don’t announce redundant content. This is an optional follow‑up and might be better handled as a small sweep across similar icons in the sidebar.

Also applies to: 138-138

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ba95fbd and 24462c5.

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

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

For Electron interprocess communication, ALWAYS use tRPC as defined in src/lib/trpc

Files:

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

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

apps/desktop/**/*.{ts,tsx}: Please 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/TabItem/index.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Maintain type safety and avoid using any unless absolutely necessary in TypeScript code

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabItem/index.tsx
  • 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 - only in src/main/

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabItem/index.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
🧠 Learnings (2)
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Use React + TailwindCSS v4 + shadcn/ui for UI components

Applied to files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabItem/index.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
📚 Learning: 2025-12-08T23:32:32.232Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T23:32:32.232Z
Learning: Applies to apps/desktop/src/main/lib/*{workspace,worktree}-*.ts : Use git worktree-based workspace management in the desktop app through workspace-manager.ts and worktree-manager.ts

Applied to files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx
🧬 Code graph analysis (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/index.tsx (1)
packages/ui/src/components/button.tsx (1)
  • Button (61-61)
⏰ 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)

3-3: Imports and icon choices align with the new sidebar UX

The additional imports for HiMiniPlus, HiMiniEllipsisHorizontal, and HiMiniCommandLine match their usage in the top button group and presets, and fit the terminal-focused affordances. No issues from a renderer/IPC or alias standpoint.

Also applies to: 8-8, 15-15


153-171: Code is approved—usePresets hook guarantees a non-null array

The presets list implementation is solid. The usePresets() hook in apps/desktop/src/renderer/react-query/presets/index.ts uses a default value of [] on line 56 (const { data: presets = [], isLoading }), which guarantees that presets is always an array, never null or undefined. This means the code at lines 153–171 is safe: both presets.length and presets.map() will always work as expected. The implementation correctly uses tRPC for the data query and follows all coding guidelines (aliases, no Node.js modules in renderer, proper imports).

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