Skip to content

Commit 37c2bae

Browse files
committed
Remove mode chooser from settings
1 parent a13da25 commit 37c2bae

File tree

2 files changed

+31
-48
lines changed

2 files changed

+31
-48
lines changed

webview-ui/src/components/chat/ChatTextArea.tsx

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -714,11 +714,15 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
714714
value={mode}
715715
disabled={textAreaDisabled}
716716
onChange={(e) => {
717-
const newMode = e.target.value as Mode
718-
setMode(newMode)
717+
const value = e.target.value
718+
if (value === "prompts-action") {
719+
window.postMessage({ type: "action", action: "promptsButtonClicked" })
720+
return
721+
}
722+
setMode(value as Mode)
719723
vscode.postMessage({
720724
type: "mode",
721-
text: newMode,
725+
text: value,
722726
})
723727
}}
724728
style={{
@@ -737,6 +741,10 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
737741
{mode.name}
738742
</option>
739743
))}
744+
<option disabled style={{ borderTop: "1px solid var(--vscode-dropdown-border)" }}>
745+
────
746+
</option>
747+
<option value="prompts-action">Edit...</option>
740748
</select>
741749
<div style={caretContainerStyle}>
742750
<CaretIcon />
@@ -753,20 +761,25 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
753761
overflow: "hidden",
754762
}}>
755763
<select
756-
value={currentApiConfigName}
764+
value={currentApiConfigName || ""}
757765
disabled={textAreaDisabled}
758-
onChange={(e) =>
766+
onChange={(e) => {
767+
const value = e.target.value
768+
if (value === "settings-action") {
769+
window.postMessage({ type: "action", action: "settingsButtonClicked" })
770+
return
771+
}
759772
vscode.postMessage({
760773
type: "loadApiConfiguration",
761-
text: e.target.value,
774+
text: value,
762775
})
763-
}
776+
}}
764777
style={{
765778
...selectStyle,
766779
width: "100%",
767780
textOverflow: "ellipsis",
768781
}}>
769-
{(listApiConfigMeta || [])?.map((config) => (
782+
{(listApiConfigMeta || []).map((config) => (
770783
<option
771784
key={config.name}
772785
value={config.name}
@@ -777,6 +790,10 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
777790
{config.name}
778791
</option>
779792
))}
793+
<option disabled style={{ borderTop: "1px solid var(--vscode-dropdown-border)" }}>
794+
────
795+
</option>
796+
<option value="settings-action">Edit...</option>
780797
</select>
781798
<div style={caretContainerStyle}>
782799
<CaretIcon />
@@ -806,14 +823,18 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
806823
role="button"
807824
aria-label="enhance prompt"
808825
data-testid="enhance-prompt-button"
809-
className={`input-icon-button ${textAreaDisabled ? "disabled" : ""} codicon codicon-sparkle`}
826+
className={`input-icon-button ${
827+
textAreaDisabled ? "disabled" : ""
828+
} codicon codicon-sparkle`}
810829
onClick={() => !textAreaDisabled && handleEnhancePrompt()}
811830
style={{ fontSize: 16.5 }}
812831
/>
813832
)}
814833
</div>
815834
<span
816-
className={`input-icon-button ${shouldDisableImages ? "disabled" : ""} codicon codicon-device-camera`}
835+
className={`input-icon-button ${
836+
shouldDisableImages ? "disabled" : ""
837+
} codicon codicon-device-camera`}
817838
onClick={() => !shouldDisableImages && onSelectImages()}
818839
style={{ fontSize: 16.5 }}
819840
/>

webview-ui/src/components/settings/SettingsView.tsx

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { vscode } from "../../utils/vscode"
1212
import ApiOptions from "./ApiOptions"
1313
import McpEnabledToggle from "../mcp/McpEnabledToggle"
1414
import ApiConfigManager from "./ApiConfigManager"
15-
import { Mode } from "../../../../src/shared/modes"
1615

1716
const IS_DEV = false // FIXME: use flags when packaging
1817

@@ -65,8 +64,6 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
6564
setRequestDelaySeconds,
6665
currentApiConfigName,
6766
listApiConfigMeta,
68-
mode,
69-
setMode,
7067
experimentalDiffStrategy,
7168
setExperimentalDiffStrategy,
7269
} = useExtensionState()
@@ -110,7 +107,6 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
110107
text: currentApiConfigName,
111108
apiConfiguration,
112109
})
113-
vscode.postMessage({ type: "mode", text: mode })
114110
vscode.postMessage({ type: "experimentalDiffStrategy", bool: experimentalDiffStrategy })
115111
onDone()
116112
}
@@ -215,40 +211,6 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
215211
Agent Settings
216212
</h3>
217213

218-
<div style={{ marginBottom: 15 }}>
219-
<label style={{ fontWeight: "500", display: "block", marginBottom: 5 }}>Agent Mode</label>
220-
<select
221-
value={mode}
222-
onChange={(e) => {
223-
const value = e.target.value as Mode
224-
setMode(value)
225-
vscode.postMessage({ type: "mode", text: value })
226-
}}
227-
style={{
228-
width: "100%",
229-
padding: "4px 8px",
230-
backgroundColor: "var(--vscode-input-background)",
231-
color: "var(--vscode-input-foreground)",
232-
border: "1px solid var(--vscode-input-border)",
233-
borderRadius: "2px",
234-
height: "28px",
235-
}}>
236-
<option value="code">Code</option>
237-
<option value="architect">Architect</option>
238-
<option value="ask">Ask</option>
239-
</select>
240-
<p
241-
style={{
242-
fontSize: "12px",
243-
marginTop: "5px",
244-
color: "var(--vscode-descriptionForeground)",
245-
}}>
246-
Select the mode that best fits your needs. Code mode focuses on implementation details,
247-
Architect mode on high-level design, and Ask mode on asking questions about the
248-
codebase.
249-
</p>
250-
</div>
251-
252214
<label style={{ fontWeight: "500", display: "block", marginBottom: 5 }}>
253215
Preferred Language
254216
</label>

0 commit comments

Comments
 (0)