Skip to content

Commit f8f63c5

Browse files
committed
feat: Move Import/Export to Modes view toolbar (#8686)
1 parent 7320d79 commit f8f63c5

File tree

1 file changed

+33
-35
lines changed

1 file changed

+33
-35
lines changed

webview-ui/src/components/modes/ModesView.tsx

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,39 @@ const ModesView = ({ onDone }: ModesViewProps) => {
594594
<span className="codicon codicon-extensions"></span>
595595
</Button>
596596
</StandardTooltip>
597+
598+
<StandardTooltip content={t("prompts:exportMode.title")}>
599+
<Button
600+
variant="ghost"
601+
size="icon"
602+
onClick={() => {
603+
const currentMode = getCurrentMode()
604+
if (currentMode?.slug && !isExporting) {
605+
setIsExporting(true)
606+
vscode.postMessage({
607+
type: "exportMode",
608+
slug: currentMode.slug,
609+
})
610+
}
611+
}}
612+
disabled={isExporting}
613+
title={t("prompts:exportMode.title")}
614+
data-testid="export-mode-toolbar-button">
615+
<Upload className="h-4 w-4" />
616+
</Button>
617+
</StandardTooltip>
618+
619+
<StandardTooltip content={t("prompts:modes.importMode")}>
620+
<Button
621+
variant="ghost"
622+
size="icon"
623+
onClick={() => setShowImportDialog(true)}
624+
disabled={isImporting}
625+
title={t("prompts:modes.importMode")}
626+
data-testid="import-mode-toolbar-button">
627+
<Download className="h-4 w-4" />
628+
</Button>
629+
</StandardTooltip>
597630
</div>
598631
</div>
599632

@@ -1220,41 +1253,6 @@ const ModesView = ({ onDone }: ModesViewProps) => {
12201253
</StandardTooltip>
12211254
</div>
12221255

1223-
{/* Export/Import Mode Buttons */}
1224-
<div className="flex items-center gap-2">
1225-
{/* Export button - visible when any mode is selected */}
1226-
{getCurrentMode() && (
1227-
<Button
1228-
variant="default"
1229-
onClick={() => {
1230-
const currentMode = getCurrentMode()
1231-
if (currentMode?.slug && !isExporting) {
1232-
setIsExporting(true)
1233-
vscode.postMessage({
1234-
type: "exportMode",
1235-
slug: currentMode.slug,
1236-
})
1237-
}
1238-
}}
1239-
disabled={isExporting}
1240-
title={t("prompts:exportMode.title")}
1241-
data-testid="export-mode-button">
1242-
<Upload className="h-4 w-4" />
1243-
{isExporting ? t("prompts:exportMode.exporting") : t("prompts:exportMode.title")}
1244-
</Button>
1245-
)}
1246-
{/* Import button - always visible */}
1247-
<Button
1248-
variant="default"
1249-
onClick={() => setShowImportDialog(true)}
1250-
disabled={isImporting}
1251-
title={t("prompts:modes.importMode")}
1252-
data-testid="import-mode-button">
1253-
<Download className="h-4 w-4" />
1254-
{isImporting ? t("prompts:importMode.importing") : t("prompts:modes.importMode")}
1255-
</Button>
1256-
</div>
1257-
12581256
{/* Advanced Features Disclosure */}
12591257
<div className="mt-4">
12601258
<button

0 commit comments

Comments
 (0)