|
|
@@ -1,6 +1,6 @@
|
|
|
import React, { useState, useEffect, useMemo, useCallback } from "react"
|
|
|
+import { Button } from "@/components/ui/button"
|
|
|
import {
|
|
|
- VSCodeButton,
|
|
|
VSCodeTextArea,
|
|
|
VSCodeDropdown,
|
|
|
VSCodeOption,
|
|
|
@@ -393,7 +393,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
<Tab>
|
|
|
<TabHeader className="flex justify-between items-center">
|
|
|
<h3 className="text-vscode-foreground m-0">{t("prompts:title")}</h3>
|
|
|
- <VSCodeButton onClick={onDone}>{t("prompts:done")}</VSCodeButton>
|
|
|
+ <Button onClick={onDone}>{t("prompts:done")}</Button>
|
|
|
</TabHeader>
|
|
|
|
|
|
<TabContent>
|
|
|
@@ -401,15 +401,17 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
<div onClick={(e) => e.stopPropagation()} className="flex justify-between items-center mb-3">
|
|
|
<h3 className="text-vscode-foreground m-0">{t("prompts:modes.title")}</h3>
|
|
|
<div className="flex gap-2">
|
|
|
- <VSCodeButton
|
|
|
- appearance="icon"
|
|
|
+ <Button
|
|
|
+ variant="ghost"
|
|
|
+ size="icon"
|
|
|
onClick={openCreateModeDialog}
|
|
|
title={t("prompts:modes.createNewMode")}>
|
|
|
<span className="codicon codicon-add"></span>
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
<div className="relative inline-block">
|
|
|
- <VSCodeButton
|
|
|
- appearance="icon"
|
|
|
+ <Button
|
|
|
+ variant="ghost"
|
|
|
+ size="icon"
|
|
|
title={t("prompts:modes.editModesConfig")}
|
|
|
className="flex"
|
|
|
onClick={(e: React.MouseEvent) => {
|
|
|
@@ -422,7 +424,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
setTimeout(() => setShowConfigMenu(false), 200)
|
|
|
}}>
|
|
|
<span className="codicon codicon-json"></span>
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
{showConfigMenu && (
|
|
|
<div
|
|
|
onClick={(e) => e.stopPropagation()}
|
|
|
@@ -512,8 +514,9 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
}}
|
|
|
className="w-full"
|
|
|
/>
|
|
|
- <VSCodeButton
|
|
|
- appearance="icon"
|
|
|
+ <Button
|
|
|
+ variant="ghost"
|
|
|
+ size="icon"
|
|
|
title={t("prompts:createModeDialog.deleteMode")}
|
|
|
onClick={() => {
|
|
|
vscode.postMessage({
|
|
|
@@ -522,7 +525,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
})
|
|
|
}}>
|
|
|
<span className="codicon codicon-trash"></span>
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -531,8 +534,9 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
<div className="flex justify-between items-center mb-1">
|
|
|
<div className="font-bold">{t("prompts:roleDefinition.title")}</div>
|
|
|
{!findModeBySlug(mode, customModes) && (
|
|
|
- <VSCodeButton
|
|
|
- appearance="icon"
|
|
|
+ <Button
|
|
|
+ variant="ghost"
|
|
|
+ size="icon"
|
|
|
onClick={() => {
|
|
|
const currentMode = getCurrentMode()
|
|
|
if (currentMode?.slug) {
|
|
|
@@ -542,7 +546,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
title={t("prompts:roleDefinition.resetToDefault")}
|
|
|
data-testid="role-definition-reset">
|
|
|
<span className="codicon codicon-discard"></span>
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
)}
|
|
|
</div>
|
|
|
<div className="text-sm text-vscode-descriptionForeground mb-2">
|
|
|
@@ -613,17 +617,18 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
<div className="flex justify-between items-center mb-1">
|
|
|
<div className="font-bold">{t("prompts:tools.title")}</div>
|
|
|
{findModeBySlug(mode, customModes) && (
|
|
|
- <VSCodeButton
|
|
|
- appearance="icon"
|
|
|
- onClick={() => setIsToolsEditMode(!isToolsEditMode)}
|
|
|
- title={
|
|
|
+ <Button
|
|
|
+ variant="ghost"
|
|
|
+ size="icon"
|
|
|
+ onClick={() => setIsToolsEditMode(!isToolsEditMode)}
|
|
|
+ title={
|
|
|
isToolsEditMode
|
|
|
? t("prompts:tools.doneEditing")
|
|
|
: t("prompts:tools.editTools")
|
|
|
}>
|
|
|
<span
|
|
|
className={`codicon codicon-${isToolsEditMode ? "check" : "edit"}`}></span>
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
)}
|
|
|
</div>
|
|
|
{!findModeBySlug(mode, customModes) && (
|
|
|
@@ -705,8 +710,9 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
}}>
|
|
|
<div style={{ fontWeight: "bold" }}>{t("prompts:customInstructions.title")}</div>
|
|
|
{!findModeBySlug(mode, customModes) && (
|
|
|
- <VSCodeButton
|
|
|
- appearance="icon"
|
|
|
+ <Button
|
|
|
+ variant="ghost"
|
|
|
+ size="icon"
|
|
|
onClick={() => {
|
|
|
const currentMode = getCurrentMode()
|
|
|
if (currentMode?.slug) {
|
|
|
@@ -716,7 +722,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
title={t("prompts:customInstructions.resetToDefault")}
|
|
|
data-testid="custom-instructions-reset">
|
|
|
<span className="codicon codicon-discard"></span>
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
)}
|
|
|
</div>
|
|
|
<div
|
|
|
@@ -814,8 +820,8 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
borderBottom: "1px solid var(--vscode-input-border)",
|
|
|
}}>
|
|
|
<div style={{ display: "flex", gap: "8px" }}>
|
|
|
- <VSCodeButton
|
|
|
- appearance="primary"
|
|
|
+ <Button
|
|
|
+ variant="default"
|
|
|
onClick={() => {
|
|
|
const currentMode = getCurrentMode()
|
|
|
if (currentMode) {
|
|
|
@@ -827,9 +833,10 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
}}
|
|
|
data-testid="preview-prompt-button">
|
|
|
{t("prompts:systemPrompt.preview")}
|
|
|
- </VSCodeButton>
|
|
|
- <VSCodeButton
|
|
|
- appearance="icon"
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ variant="ghost"
|
|
|
+ size="icon"
|
|
|
title={t("prompts:systemPrompt.copy")}
|
|
|
onClick={() => {
|
|
|
const currentMode = getCurrentMode()
|
|
|
@@ -842,7 +849,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
}}
|
|
|
data-testid="copy-prompt-button">
|
|
|
<span className="codicon codicon-copy"></span>
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
</div>
|
|
|
|
|
|
{/* Custom System Prompt Disclosure */}
|
|
|
@@ -1004,12 +1011,13 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
marginBottom: "4px",
|
|
|
}}>
|
|
|
<div style={{ fontWeight: "bold" }}>{t("prompts:supportPrompts.prompt")}</div>
|
|
|
- <VSCodeButton
|
|
|
- appearance="icon"
|
|
|
+ <Button
|
|
|
+ variant="ghost"
|
|
|
+ size="icon"
|
|
|
onClick={() => handleSupportReset(activeSupportTab)}
|
|
|
title={t("prompts:supportPrompts.resetPrompt", { promptType: activeSupportTab })}>
|
|
|
<span className="codicon codicon-discard"></span>
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
</div>
|
|
|
|
|
|
<VSCodeTextArea
|
|
|
@@ -1091,12 +1099,12 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
alignItems: "center",
|
|
|
gap: 8,
|
|
|
}}>
|
|
|
- <VSCodeButton
|
|
|
+ <Button
|
|
|
+ variant="default"
|
|
|
onClick={handleTestEnhancement}
|
|
|
- disabled={isEnhancing}
|
|
|
- appearance="primary">
|
|
|
+ disabled={isEnhancing}>
|
|
|
{t("prompts:supportPrompts.enhance.previewButton")}
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</>
|
|
|
@@ -1132,8 +1140,9 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
overflowY: "auto",
|
|
|
minHeight: 0,
|
|
|
}}>
|
|
|
- <VSCodeButton
|
|
|
- appearance="icon"
|
|
|
+ <Button
|
|
|
+ variant="ghost"
|
|
|
+ size="icon"
|
|
|
onClick={() => setIsCreateModeDialogOpen(false)}
|
|
|
style={{
|
|
|
position: "absolute",
|
|
|
@@ -1141,7 +1150,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
right: "20px",
|
|
|
}}>
|
|
|
<span className="codicon codicon-close"></span>
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
<h2 style={{ margin: "0 0 16px" }}>{t("prompts:createModeDialog.title")}</h2>
|
|
|
<div style={{ marginBottom: "16px" }}>
|
|
|
<div style={{ fontWeight: "bold", marginBottom: "4px" }}>
|
|
|
@@ -1328,12 +1337,12 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
borderTop: "1px solid var(--vscode-editor-lineHighlightBorder)",
|
|
|
backgroundColor: "var(--vscode-editor-background)",
|
|
|
}}>
|
|
|
- <VSCodeButton onClick={() => setIsCreateModeDialogOpen(false)}>
|
|
|
+ <Button variant="secondary" onClick={() => setIsCreateModeDialogOpen(false)}>
|
|
|
{t("prompts:createModeDialog.buttons.cancel")}
|
|
|
- </VSCodeButton>
|
|
|
- <VSCodeButton appearance="primary" onClick={handleCreateMode}>
|
|
|
+ </Button>
|
|
|
+ <Button variant="default" onClick={handleCreateMode}>
|
|
|
{t("prompts:createModeDialog.buttons.create")}
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -1366,8 +1375,9 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
overflowY: "auto",
|
|
|
minHeight: 0,
|
|
|
}}>
|
|
|
- <VSCodeButton
|
|
|
- appearance="icon"
|
|
|
+ <Button
|
|
|
+ variant="ghost"
|
|
|
+ size="icon"
|
|
|
onClick={() => setIsDialogOpen(false)}
|
|
|
style={{
|
|
|
position: "absolute",
|
|
|
@@ -1375,7 +1385,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
right: "20px",
|
|
|
}}>
|
|
|
<span className="codicon codicon-close"></span>
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
<h2 style={{ margin: "0 0 16px" }}>
|
|
|
{selectedPromptTitle ||
|
|
|
t("prompts:systemPrompt.title", { modeName: getCurrentMode()?.name || "Code" })}
|
|
|
@@ -1404,9 +1414,9 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|
|
borderTop: "1px solid var(--vscode-editor-lineHighlightBorder)",
|
|
|
backgroundColor: "var(--vscode-editor-background)",
|
|
|
}}>
|
|
|
- <VSCodeButton onClick={() => setIsDialogOpen(false)}>
|
|
|
+ <Button variant="secondary" onClick={() => setIsDialogOpen(false)}>
|
|
|
{t("prompts:createModeDialog.close")}
|
|
|
- </VSCodeButton>
|
|
|
+ </Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|