mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix(prompts): revert to vscodetextarea to prevent race condition (#3343)
This commit is contained in:
parent
1688bd66c0
commit
4730a12d4e
2 changed files with 12 additions and 11 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState, useEffect, useMemo, useCallback, useRef } from "react"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { VSCodeCheckbox, VSCodeRadioGroup, VSCodeRadio } from "@vscode/webview-ui-toolkit/react"
|
||||
import { VSCodeCheckbox, VSCodeRadioGroup, VSCodeRadio, VSCodeTextArea } from "@vscode/webview-ui-toolkit/react"
|
||||
|
||||
import { useExtensionState } from "@src/context/ExtensionStateContext"
|
||||
import {
|
||||
|
|
@ -27,7 +27,6 @@ import {
|
|||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
Textarea,
|
||||
Popover,
|
||||
PopoverContent,
|
||||
PopoverTrigger,
|
||||
|
|
@ -666,7 +665,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|||
<div className="text-sm text-vscode-descriptionForeground mb-2">
|
||||
{t("prompts:roleDefinition.description")}
|
||||
</div>
|
||||
<Textarea
|
||||
<VSCodeTextArea
|
||||
value={(() => {
|
||||
const customMode = findModeBySlug(visualMode, customModes)
|
||||
const prompt = customModePrompts?.[visualMode] as PromptComponent
|
||||
|
|
@ -848,7 +847,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|||
modeName: getCurrentMode()?.name || "Code",
|
||||
})}
|
||||
</div>
|
||||
<Textarea
|
||||
<VSCodeTextArea
|
||||
value={(() => {
|
||||
const customMode = findModeBySlug(visualMode, customModes)
|
||||
const prompt = customModePrompts?.[visualMode] as PromptComponent
|
||||
|
|
@ -1002,7 +1001,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|||
language: i18next.language,
|
||||
})}
|
||||
</div>
|
||||
<Textarea
|
||||
<VSCodeTextArea
|
||||
value={customInstructions}
|
||||
onChange={(e) => {
|
||||
const value =
|
||||
|
|
@ -1080,7 +1079,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|||
</Button>
|
||||
</div>
|
||||
|
||||
<Textarea
|
||||
<VSCodeTextArea
|
||||
value={getSupportPromptValue(activeSupportOption)}
|
||||
onChange={(e) => {
|
||||
const value =
|
||||
|
|
@ -1140,7 +1139,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|||
</div>
|
||||
|
||||
<div className="mt-4">
|
||||
<Textarea
|
||||
<VSCodeTextArea
|
||||
value={testPrompt}
|
||||
onChange={(e) => setTestPrompt((e.target as HTMLTextAreaElement).value)}
|
||||
placeholder={t("prompts:supportPrompts.enhance.testPromptPlaceholder")}
|
||||
|
|
@ -1245,10 +1244,10 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|||
}}>
|
||||
{t("prompts:createModeDialog.roleDefinition.description")}
|
||||
</div>
|
||||
<Textarea
|
||||
<VSCodeTextArea
|
||||
value={newModeRoleDefinition}
|
||||
onChange={(e) => {
|
||||
setNewModeRoleDefinition(e.target.value)
|
||||
setNewModeRoleDefinition((e.target as HTMLTextAreaElement).value)
|
||||
}}
|
||||
rows={4}
|
||||
className="w-full resize-y"
|
||||
|
|
@ -1296,10 +1295,10 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
|
|||
<div className="text-[13px] text-vscode-descriptionForeground mb-2">
|
||||
{t("prompts:createModeDialog.customInstructions.description")}
|
||||
</div>
|
||||
<Textarea
|
||||
<VSCodeTextArea
|
||||
value={newModeCustomInstructions}
|
||||
onChange={(e) => {
|
||||
setNewModeCustomInstructions(e.target.value)
|
||||
setNewModeCustomInstructions((e.target as HTMLTextAreaElement).value)
|
||||
}}
|
||||
rows={4}
|
||||
className="w-full resize-y"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
// npx jest src/components/prompts/__tests__/PromptsView.test.tsx
|
||||
|
||||
import { render, screen, fireEvent, waitFor } from "@testing-library/react"
|
||||
import PromptsView from "../PromptsView"
|
||||
import { ExtensionStateContext } from "@src/context/ExtensionStateContext"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue