Skip to content

Commit 8b6d70b

Browse files
authored
fix(site): update vs code dev container button URLs (#18696)
1 parent 3517457 commit 8b6d70b

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
{
2525
"slug": "cursor",
2626
"displayName": "Cursor Desktop",
27-
"url": "cursor://coder.coder-remote/openDevContainer?owner=${localEnv:CODER_WORKSPACE_OWNER_NAME}&workspace=${localEnv:CODER_WORKSPACE_NAME}&agent=${localEnv:CODER_WORKSPACE_PARENT_AGENT_NAME}&url=${localEnv:CODER_URL}&token=$SESSION_TOKEN&devContainerName=${localEnv:CONTAINER_ID}&devContainerFolder=${containerWorkspaceFolder}",
27+
"url": "cursor://coder.coder-remote/openDevContainer?owner=${localEnv:CODER_WORKSPACE_OWNER_NAME}&workspace=${localEnv:CODER_WORKSPACE_NAME}&agent=${localEnv:CODER_WORKSPACE_PARENT_AGENT_NAME}&url=${localEnv:CODER_URL}&token=$SESSION_TOKEN&devContainerName=${localEnv:CONTAINER_ID}&devContainerFolder=${containerWorkspaceFolder}&localWorkspaceFolder=${localWorkspaceFolder}",
2828
"external": true,
2929
"icon": "/icon/cursor.svg",
3030
"order": 1
3131
},
3232
{
3333
"slug": "windsurf",
3434
"displayName": "Windsurf Editor",
35-
"url": "windsurf://coder.coder-remote/openDevContainer?owner=${localEnv:CODER_WORKSPACE_OWNER_NAME}&workspace=${localEnv:CODER_WORKSPACE_NAME}&agent=${localEnv:CODER_WORKSPACE_PARENT_AGENT_NAME}&url=${localEnv:CODER_URL}&token=$SESSION_TOKEN&devContainerName=${localEnv:CONTAINER_ID}&devContainerFolder=${containerWorkspaceFolder}",
35+
"url": "windsurf://coder.coder-remote/openDevContainer?owner=${localEnv:CODER_WORKSPACE_OWNER_NAME}&workspace=${localEnv:CODER_WORKSPACE_NAME}&agent=${localEnv:CODER_WORKSPACE_PARENT_AGENT_NAME}&url=${localEnv:CODER_URL}&token=$SESSION_TOKEN&devContainerName=${localEnv:CONTAINER_ID}&devContainerFolder=${containerWorkspaceFolder}&localWorkspaceFolder=${localWorkspaceFolder}",
3636
"external": true,
3737
"icon": "/icon/windsurf.svg",
3838
"order": 4

site/src/modules/resources/AgentDevcontainerCard.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ export const AgentDevcontainerCard: FC<AgentDevcontainerCardProps> = ({
307307
workspaceName={workspace.name}
308308
devContainerName={devcontainer.container.name}
309309
devContainerFolder={subAgent?.directory ?? ""}
310+
localWorkspaceFolder={devcontainer.workspace_folder}
311+
localConfigFile={devcontainer.config_path || ""}
310312
displayApps={displayApps} // TODO(mafredri): We could use subAgent display apps here but we currently set none.
311313
agentName={parentAgent.name}
312314
/>
@@ -331,7 +333,9 @@ export const AgentDevcontainerCard: FC<AgentDevcontainerCardProps> = ({
331333

332334
{wildcardHostname !== "" &&
333335
devcontainer.container?.ports.map((port) => {
334-
const portLabel = `${port.port}/${port.network.toUpperCase()}`;
336+
const portLabel = `${
337+
port.port
338+
}/${port.network.toUpperCase()}`;
335339
const hasHostBind =
336340
port.host_port !== undefined && port.host_ip !== undefined;
337341
const helperText = hasHostBind

site/src/modules/resources/VSCodeDevContainerButton/VSCodeDevContainerButton.stories.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export const Default: Story = {
1717
agentName: MockWorkspaceAgent.name,
1818
devContainerName: "musing_ride",
1919
devContainerFolder: "/workspace/coder",
20+
localWorkspaceFolder: "/home/coder/coder",
21+
localConfigFile: "/home/coder/coder/.devcontainer/devcontainer.json",
2022
displayApps: [
2123
"vscode",
2224
"vscode_insiders",
@@ -34,6 +36,8 @@ export const VSCodeOnly: Story = {
3436
agentName: MockWorkspaceAgent.name,
3537
devContainerName: "nifty_borg",
3638
devContainerFolder: "/workspace/coder",
39+
localWorkspaceFolder: "/home/coder/coder",
40+
localConfigFile: "/home/coder/coder/.devcontainer/devcontainer.json",
3741
displayApps: [
3842
"vscode",
3943
"port_forwarding_helper",
@@ -50,6 +54,8 @@ export const InsidersOnly: Story = {
5054
agentName: MockWorkspaceAgent.name,
5155
devContainerName: "amazing_swartz",
5256
devContainerFolder: "/workspace/coder",
57+
localWorkspaceFolder: "/home/coder/coder",
58+
localConfigFile: "/home/coder/coder/.devcontainer/devcontainer.json",
5359
displayApps: [
5460
"vscode_insiders",
5561
"port_forwarding_helper",

site/src/modules/resources/VSCodeDevContainerButton/VSCodeDevContainerButton.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ interface VSCodeDevContainerButtonProps {
1515
agentName?: string;
1616
devContainerName: string;
1717
devContainerFolder: string;
18+
localWorkspaceFolder: string;
19+
localConfigFile: string;
1820
displayApps: readonly DisplayApp[];
1921
}
2022

@@ -112,6 +114,8 @@ const VSCodeButton: FC<VSCodeDevContainerButtonProps> = ({
112114
agentName,
113115
devContainerName,
114116
devContainerFolder,
117+
localWorkspaceFolder,
118+
localConfigFile,
115119
}) => {
116120
const [loading, setLoading] = useState(false);
117121

@@ -129,6 +133,8 @@ const VSCodeButton: FC<VSCodeDevContainerButtonProps> = ({
129133
token: key,
130134
devContainerName,
131135
devContainerFolder,
136+
localWorkspaceFolder,
137+
localConfigFile,
132138
});
133139
if (agentName) {
134140
query.set("agent", agentName);
@@ -156,6 +162,8 @@ const VSCodeInsidersButton: FC<VSCodeDevContainerButtonProps> = ({
156162
agentName,
157163
devContainerName,
158164
devContainerFolder,
165+
localWorkspaceFolder,
166+
localConfigFile,
159167
}) => {
160168
const [loading, setLoading] = useState(false);
161169

@@ -173,6 +181,8 @@ const VSCodeInsidersButton: FC<VSCodeDevContainerButtonProps> = ({
173181
token: key,
174182
devContainerName,
175183
devContainerFolder,
184+
localWorkspaceFolder,
185+
localConfigFile,
176186
});
177187
if (agentName) {
178188
query.set("agent", agentName);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy