Skip to content

Commit 612f1f3

Browse files
authored
feat(network): link the troubleshooting guide from the slow-connection tooltip (#1219)
While the slow-connection warning is active, the network status tooltip shows a "Troubleshooting guide" link on its own line after the latency test, network check and threshold actions. Relay connections open the "Common Problems with Direct Connections" section, which explains why a connection falls back to a relay. Direct connections open the top of the page, where the `coder ping` diagnostics are described. Fixes #1217
1 parent bd1241a commit 612f1f3

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
from published versions since it shows up in the VS Code extension changelog
66
tab and is confusing to users. Add it back between releases if needed. -->
77

8+
## Unreleased
9+
10+
### Added
11+
12+
- The slow-connection warning tooltip now links to the networking
13+
troubleshooting guide, opening the relay section when connected through a
14+
relay.
15+
816
## [v1.18.3](https://github.com/coder/vscode-coder/releases/tag/v1.18.3) 2026-11-25
917

1018
> **Note:** The Coder sidebar has a new Workspaces panel, and some SSH options

‎src/remote/networkStatus.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const WARNING_BACKGROUND = new vscode.ThemeColor(
1010
"statusBarItem.warningBackground",
1111
);
1212

13+
const NETWORKING_TROUBLESHOOTING_URL =
14+
"https://coder.com/docs/admin/networking/troubleshooting";
15+
1316
const CODER_CONNECT_TEXT = "$(globe) Coder Connect";
1417

1518
/** The commands the tooltip links to; no other command link may run. */
@@ -38,6 +41,16 @@ function connectionSummary(network: NetworkInfo): string {
3841
.value;
3942
}
4043

44+
/**
45+
* Relay connections link to the section on why a connection falls back to a
46+
* relay. No section covers slow direct connections, so those get the page root.
47+
*/
48+
function troubleshootingUrl(network: NetworkInfo): string {
49+
return network.p2p
50+
? NETWORKING_TROUBLESHOOTING_URL
51+
: `${NETWORKING_TROUBLESHOOTING_URL}#common-problems-with-direct-connections`;
52+
}
53+
4154
function buildStatusText(network: NetworkInfo, isStale: boolean): string {
4255
const label = network.p2p ? "Direct" : network.preferred_derp;
4356
const staleMarker = isStale ? "~" : "";
@@ -138,6 +151,7 @@ export class NetworkStatusReporter {
138151
"[$(pulse) Run latency test](command:coder.pingWorkspace) · " +
139152
"[$(globe) Run network check](command:coder.netcheck) · " +
140153
"[$(gear) Configure threshold](command:workbench.action.openSettings?%22coder.networkThreshold%22)",
154+
`[$(book) Troubleshooting guide](${troubleshootingUrl(network)})`,
141155
);
142156
}
143157

‎test/unit/remote/networkStatus.test.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ describe("NetworkStatusReporter tooltip", () => {
6868
expect(t).not.toContain("Slow connection detected");
6969
expect(t).not.toContain("Run latency test");
7070
expect(t).not.toContain("Configure threshold");
71+
expect(t).not.toContain("Troubleshooting guide");
7172
});
7273

7374
it("leads with a relay explainer mentioning the DERP region", () => {
@@ -92,6 +93,26 @@ describe("NetworkStatusReporter tooltip", () => {
9293
expect(t).toContain("Run latency test");
9394
expect(t).toContain("Run network check");
9495
expect(t).toContain("Configure threshold");
96+
expect(t).toContain(
97+
"%22coder.networkThreshold%22)\n\n[$(book) Troubleshooting guide]",
98+
);
99+
expect(t).toContain(
100+
"[$(book) Troubleshooting guide](https://coder.com/docs/admin/networking/troubleshooting)",
101+
);
102+
});
103+
104+
it("links the relay troubleshooting section when a slow connection is relayed", () => {
105+
const { bar, reporter } = setup(100);
106+
const slowRelay = makeNetworkInfo({
107+
p2p: false,
108+
preferred_derp: "SFO",
109+
latency: 350,
110+
});
111+
reporter.update(slowRelay, false);
112+
reporter.update(slowRelay, false);
113+
expect(tooltipOf(bar)).toContain(
114+
"[$(book) Troubleshooting guide](https://coder.com/docs/admin/networking/troubleshooting#common-problems-with-direct-connections)",
115+
);
95116
});
96117

97118
it("appends a stale footer at the bottom of the tooltip", () => {

0 commit comments

Comments
 (0)