feat: add Open File Manager to tab right-click menu (#1051)

Co-authored-by: SankeerthNara <sankeerthnara@gmail.com>
This commit is contained in:
ZacharyZcR
2026-07-14 01:39:33 +08:00
committed by GitHub
parent 07d5f5a133
commit 6e66a5a4ef
2 changed files with 21 additions and 0 deletions
+17
View File
@@ -18,6 +18,7 @@ import {
Pencil,
Maximize2,
Minimize2,
FolderOpen,
} from "lucide-react";
import { tabIcon } from "@/shell/tabUtils";
import { isElectron } from "@/lib/electron";
@@ -40,6 +41,7 @@ export function TabBar({
onAddToSplit,
onRemoveFromSplit,
onRenameTab,
onOpenFileManager,
isAppFullscreen,
onToggleAppFullscreen,
}: {
@@ -56,6 +58,7 @@ export function TabBar({
onAddToSplit: (tabId: string) => void;
onRemoveFromSplit: (tabId: string) => void;
onRenameTab?: (tabId: string, newLabel: string) => void;
onOpenFileManager?: (tabId: string) => void;
isAppFullscreen: boolean;
onToggleAppFullscreen: () => void;
}) {
@@ -527,6 +530,20 @@ export function TabBar({
{t("nav.refreshTab")}
</button>
)}
{ctxTab.type === "terminal" &&
ctxTab.host &&
onOpenFileManager && (
<button
className="flex items-center gap-2 w-full px-3 py-1.5 text-xs text-left hover:bg-accent hover:text-accent-foreground"
onClick={() => {
onOpenFileManager(contextTabId);
setContextTabId(null);
}}
>
<FolderOpen className="size-3" />
{t("nav.openFileManager")}
</button>
)}
<button
className="flex items-center gap-2 w-full px-3 py-1.5 text-xs text-left hover:bg-accent hover:text-accent-foreground"
onClick={() => {