Skip to content

Commit 07cff2f

Browse files
committed
Add platform to extension state so it's available in the webview
1 parent c78fbed commit 07cff2f

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

src/core/webview/ClineProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,6 +2382,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
23822382
customModes: await this.customModesManager.getCustomModes(),
23832383
experiments: experiments ?? experimentDefault,
23842384
mcpServers: this.mcpHub?.getAllServers() ?? [],
2385+
platform: process.platform,
23852386
}
23862387
}
23872388

src/core/webview/__tests__/ClineProvider.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ describe("ClineProvider", () => {
351351
mode: defaultModeSlug,
352352
customModes: [],
353353
experiments: experimentDefault,
354+
platform: "win32",
354355
}
355356

356357
const message: ExtensionMessage = {

src/shared/ExtensionMessage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export interface ExtensionState {
127127
autoApprovalEnabled?: boolean
128128
customModes: ModeConfig[]
129129
toolRequirements?: Record<string, boolean> // Map of tool names to their requirements (e.g. {"apply_diff": true} if diffEnabled)
130+
platform: string // Operating system platform (e.g., 'win32', 'darwin', 'linux')
130131
}
131132

132133
export interface ClineMessage {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
6363
setExperimentEnabled,
6464
alwaysAllowModeSwitch,
6565
setAlwaysAllowModeSwitch,
66+
platform,
6667
} = useExtensionState()
6768
const [apiErrorMessage, setApiErrorMessage] = useState<string | undefined>(undefined)
6869
const [modelIdErrorMessage, setModelIdErrorMessage] = useState<string | undefined>(undefined)
@@ -701,7 +702,7 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
701702
</div>
702703
)}
703704

704-
{process.platform !== "win32" && (
705+
{platform !== "win32" && (
705706
<div style={{ marginBottom: 15 }}>
706707
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
707708
<span style={{ color: "var(--vscode-errorForeground)" }}>⚠️</span>

0 commit comments

Comments
 (0)