Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Button } from "@superset/ui/button";
import { Input } from "@superset/ui/input";
import { useRef, useState } from "react";
import { useDrag, useDrop } from "react-dnd";
import { HiMiniXMark } from "react-icons/hi2";
import { HiMiniCommandLine, HiMiniXMark } from "react-icons/hi2";
import { trpc } from "renderer/lib/trpc";
import { useTabsStore } from "renderer/stores/tabs/store";
import type { Tab } from "renderer/stores/tabs/types";
Expand Down Expand Up @@ -134,6 +134,7 @@ export function TabItem({ tab, index, isActive }: TabItemProps) {
${isDragOver ? "bg-tertiary-active/50" : ""}
`}
>
<HiMiniCommandLine className="size-4" />
<div className="flex items-center gap-1 flex-1 min-w-0">
{isRenaming ? (
<Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { LayoutGroup, motion } from "framer-motion";
import type { TerminalPreset } from "main/lib/db/schemas";
import { useMemo, useRef, useState } from "react";
import { useDrop } from "react-dnd";
import { HiMiniEllipsisHorizontal, HiMiniPlus } from "react-icons/hi2";
import {
HiMiniCommandLine,
HiMiniEllipsisHorizontal,
HiMiniPlus,
} from "react-icons/hi2";
import { trpc } from "renderer/lib/trpc";
import { usePresets } from "renderer/react-query/presets";
import { useOpenSettings, useSidebarStore } from "renderer/stores";
Expand Down Expand Up @@ -148,6 +152,23 @@ export function TabsView() {
<HiMiniEllipsisHorizontal className="size-4" />
</Button>
</ButtonGroup>
{presets.length > 0 && (
<div className="ml-4 pl-1 space-y-0.5 mb-2 border-l-2">
{presets.map((preset) => (
<Button
key={preset.id}
variant="ghost"
onClick={() => handleSelectPreset(preset)}
disabled={!activeWorkspaceId}
className="w-full justify-start px-3 py-1.5 h-auto text-sm"
title={preset.cwd || undefined}
>
<HiMiniCommandLine className="size-4" />
<span className="truncate">{preset.name || "Unnamed"}</span>
</Button>
))}
</div>
)}
<TabsCommandDialog
open={commandOpen}
onOpenChange={setCommandOpen}
Expand Down