Skip to content

Commit 2696839

Browse files
authored
🤖 fix: simplify Editor settings UI (#1042)
Simplifies the Editor settings in the General section: - Removed redundant 'Editor' section header - now just a single 'Editor' row - Removed 'Use Remote-SSH' checkbox - SSH workspaces always use Remote-SSH when the editor supports it (VS Code/Cursor) - Removed `useRemoteExtension` from `EditorConfig` type and storage For SSH workspaces, there's no other sensible path than Remote-SSH, so the checkbox was unnecessary. When users click 'Open in Editor' on an SSH workspace with VS Code/Cursor, it just works. If the Remote-SSH extension isn't installed, the editor itself prompts to install it. --- _Generated with `mux`_
1 parent 47df2dc commit 2696839

File tree

5 files changed

+38
-93
lines changed

5 files changed

+38
-93
lines changed

src/browser/components/Settings/sections/GeneralSection.tsx

Lines changed: 33 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import {
88
SelectValue,
99
} from "@/browser/components/ui/select";
1010
import { Input } from "@/browser/components/ui/input";
11-
import { Checkbox } from "@/browser/components/ui/checkbox";
12-
import { Tooltip, TooltipTrigger, TooltipContent } from "@/browser/components/ui/tooltip";
1311
import { usePersistedState } from "@/browser/hooks/usePersistedState";
1412
import {
1513
EDITOR_CONFIG_KEY,
@@ -40,13 +38,6 @@ export function GeneralSection() {
4038
setEditorConfig((prev) => ({ ...prev, customCommand }));
4139
};
4240

43-
const handleRemoteExtensionChange = (useRemoteExtension: boolean) => {
44-
setEditorConfig((prev) => ({ ...prev, useRemoteExtension }));
45-
};
46-
47-
// Remote-SSH is only supported for VS Code and Cursor
48-
const supportsRemote = editorConfig.editor === "vscode" || editorConfig.editor === "cursor";
49-
5041
return (
5142
<div className="space-y-6">
5243
<div>
@@ -71,67 +62,41 @@ export function GeneralSection() {
7162
</div>
7263
</div>
7364

74-
<div>
75-
<h3 className="text-foreground mb-4 text-sm font-medium">Editor</h3>
76-
<div className="space-y-4">
77-
<div className="flex items-center justify-between">
78-
<div>
79-
<div className="text-foreground text-sm">Default Editor</div>
80-
<div className="text-muted text-xs">Editor to open workspaces in</div>
81-
</div>
82-
<Select value={editorConfig.editor} onValueChange={handleEditorChange}>
83-
<SelectTrigger className="border-border-medium bg-background-secondary hover:bg-hover h-9 w-auto cursor-pointer rounded-md border px-3 text-sm transition-colors">
84-
<SelectValue />
85-
</SelectTrigger>
86-
<SelectContent>
87-
{EDITOR_OPTIONS.map((option) => (
88-
<SelectItem key={option.value} value={option.value}>
89-
{option.label}
90-
</SelectItem>
91-
))}
92-
</SelectContent>
93-
</Select>
94-
</div>
95-
96-
{editorConfig.editor === "custom" && (
97-
<div className="flex items-center justify-between">
98-
<div>
99-
<div className="text-foreground text-sm">Custom Command</div>
100-
<div className="text-muted text-xs">Command to run (path will be appended)</div>
101-
</div>
102-
<Input
103-
value={editorConfig.customCommand ?? ""}
104-
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
105-
handleCustomCommandChange(e.target.value)
106-
}
107-
placeholder="e.g., nvim"
108-
className="border-border-medium bg-background-secondary h-9 w-40"
109-
/>
110-
</div>
111-
)}
112-
113-
{supportsRemote && (
114-
<div className="flex items-center justify-between">
115-
<div className="flex items-center gap-2">
116-
<div className="text-foreground text-sm">Use Remote-SSH for SSH workspaces</div>
117-
<Tooltip>
118-
<TooltipTrigger asChild>
119-
<span className="text-muted cursor-help text-xs">(?)</span>
120-
</TooltipTrigger>
121-
<TooltipContent side="top" className="max-w-xs">
122-
When enabled, opens SSH workspaces directly in the editor using the Remote-SSH
123-
extension. Requires the Remote-SSH extension to be installed.
124-
</TooltipContent>
125-
</Tooltip>
126-
</div>
127-
<Checkbox
128-
checked={editorConfig.useRemoteExtension}
129-
onCheckedChange={handleRemoteExtensionChange}
130-
/>
131-
</div>
132-
)}
65+
<div className="flex items-center justify-between">
66+
<div>
67+
<div className="text-foreground text-sm">Editor</div>
68+
<div className="text-muted text-xs">Editor to open workspaces in</div>
13369
</div>
70+
<Select value={editorConfig.editor} onValueChange={handleEditorChange}>
71+
<SelectTrigger className="border-border-medium bg-background-secondary hover:bg-hover h-9 w-auto cursor-pointer rounded-md border px-3 text-sm transition-colors">
72+
<SelectValue />
73+
</SelectTrigger>
74+
<SelectContent>
75+
{EDITOR_OPTIONS.map((option) => (
76+
<SelectItem key={option.value} value={option.value}>
77+
{option.label}
78+
</SelectItem>
79+
))}
80+
</SelectContent>
81+
</Select>
13482
</div>
83+
84+
{editorConfig.editor === "custom" && (
85+
<div className="flex items-center justify-between">
86+
<div>
87+
<div className="text-foreground text-sm">Custom Command</div>
88+
<div className="text-muted text-xs">Command to run (path will be appended)</div>
89+
</div>
90+
<Input
91+
value={editorConfig.customCommand ?? ""}
92+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
93+
handleCustomCommandChange(e.target.value)
94+
}
95+
placeholder="e.g., nvim"
96+
className="border-border-medium bg-background-secondary h-9 w-40"
97+
/>
98+
</div>
99+
)}
135100
</div>
136101
);
137102
}

src/browser/hooks/useOpenInEditor.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export function useOpenInEditor() {
4444
return { success: false, error: "Please configure a custom editor command in Settings" };
4545
}
4646

47-
// For SSH workspaces, validate the editor supports remote
48-
if (isSSH && editorConfig.useRemoteExtension) {
47+
// For SSH workspaces, validate the editor supports Remote-SSH
48+
if (isSSH) {
4949
if (editorConfig.editor === "zed") {
5050
return { success: false, error: "Zed does not support Remote-SSH for SSH workspaces" };
5151
}
@@ -57,14 +57,6 @@ export function useOpenInEditor() {
5757
}
5858
}
5959

60-
// For SSH workspaces without remote extension, we can't open
61-
if (isSSH && !editorConfig.useRemoteExtension) {
62-
return {
63-
success: false,
64-
error: "Enable 'Use Remote-SSH' in Settings to open SSH workspaces in editor",
65-
};
66-
}
67-
6860
// Call the backend API
6961
const result = await api?.general.openWorkspaceInEditor({
7062
workspaceId,

src/common/constants/storage.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,10 @@ export type EditorType = "vscode" | "cursor" | "zed" | "custom";
168168
export interface EditorConfig {
169169
editor: EditorType;
170170
customCommand?: string; // Only when editor='custom'
171-
useRemoteExtension: boolean; // For SSH workspaces, use Remote-SSH
172171
}
173172

174173
export const DEFAULT_EDITOR_CONFIG: EditorConfig = {
175174
editor: "vscode",
176-
useRemoteExtension: true,
177175
};
178176

179177
/**

src/common/orpc/schemas/api.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ const EditorTypeSchema = z.enum(["vscode", "cursor", "zed", "custom"]);
458458
const EditorConfigSchema = z.object({
459459
editor: EditorTypeSchema,
460460
customCommand: z.string().optional(),
461-
useRemoteExtension: z.boolean(),
462461
});
463462

464463
// General
@@ -533,7 +532,7 @@ export const general = {
533532
},
534533
/**
535534
* Open the workspace in the user's configured editor.
536-
* For SSH workspaces with useRemoteExtension enabled, uses Remote-SSH extension.
535+
* For SSH workspaces, uses Remote-SSH extension (VS Code/Cursor only).
537536
*/
538537
openWorkspaceInEditor: {
539538
input: z.object({

src/node/services/editorService.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { log } from "@/node/services/log";
66
export interface EditorConfig {
77
editor: string;
88
customCommand?: string;
9-
useRemoteExtension: boolean;
109
}
1110

1211
/**
@@ -29,7 +28,7 @@ export class EditorService {
2928

3029
/**
3130
* Open the workspace in the user's configured code editor.
32-
* For SSH workspaces with Remote-SSH extension enabled, opens directly in the editor.
31+
* For SSH workspaces, opens via Remote-SSH extension (VS Code/Cursor only).
3332
*/
3433
async openWorkspaceInEditor(
3534
workspaceId: string,
@@ -63,15 +62,7 @@ export class EditorService {
6362
}
6463

6564
if (isSSH) {
66-
// SSH workspace handling
67-
if (!editorConfig.useRemoteExtension) {
68-
return {
69-
success: false,
70-
error: "Cannot open SSH workspace without Remote-SSH extension enabled",
71-
};
72-
}
73-
74-
// Only VS Code and Cursor support Remote-SSH
65+
// SSH workspace handling - only VS Code and Cursor support Remote-SSH
7566
if (editorConfig.editor !== "vscode" && editorConfig.editor !== "cursor") {
7667
return {
7768
success: false,

0 commit comments

Comments
 (0)