Skip to content

Commit 4b60822

Browse files
Refresh VS Code quick start for released local setup
Require extension 0.10.1 or later, explain the Docker prerequisite and wizard actions, and provide the Command Palette fallback. The /local deep link shipped in microsoft/vscode-documentdb#898 and no longer needs a release blocker. Preserve the Docker default and add rendered-homepage regression coverage. Signed-off-by: Guanzhou Song <guanzhousong@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4fde31b commit 4b60822

4 files changed

Lines changed: 84 additions & 24 deletions

File tree

‎app/components/QuickStartTabs.tsx‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ function StepList({ steps }: { steps: QuickStartStep[] }) {
4444
);
4545
}
4646

47-
/**
48-
* The home page quick start, offering the two ways to get a local DocumentDB running.
49-
*
50-
* Docker stays first because it is the path that works everywhere and needs nothing installed
51-
* beyond Docker itself. The VS Code path is newer and shorter — the extension provisions the
52-
* container itself — but only pays off for people who already work in VS Code, so it is offered
53-
* rather than assumed.
54-
*/
5547
export default function QuickStartTabs({
5648
dockerCommand,
5749
dockerSteps,
@@ -131,6 +123,10 @@ export default function QuickStartTabs({
131123
aria-labelledby="quickstart-tab-vscode"
132124
hidden={activeTab !== "vscode"}
133125
>
126+
<p className="mb-4 text-sm leading-6 text-gray-400">
127+
Requires Docker Engine or Docker Desktop running Linux containers in
128+
your VS Code environment.
129+
</p>
134130
<div className="flex flex-col gap-2 sm:flex-row">
135131
<Link
136132
href={vscodeMarketplaceUrl}
@@ -140,11 +136,6 @@ export default function QuickStartTabs({
140136
>
141137
Get the extension
142138
</Link>
143-
{/*
144-
* A `vscode://` link does nothing at all when VS Code is not installed — no error, no
145-
* navigation — so it is offered second and never on its own. Someone arriving without
146-
* the extension gets the install link first and this becomes the obvious next step.
147-
*/}
148139
<Link
149140
href={vscodeDeepLinkUrl}
150141
className="inline-flex items-center justify-center rounded-lg border border-blue-400/30 bg-blue-500/20 px-4 py-2.5 text-sm font-semibold text-blue-100 transition-colors hover:bg-blue-500/30"
@@ -153,6 +144,13 @@ export default function QuickStartTabs({
153144
</Link>
154145
</div>
155146
<StepList steps={vscodeSteps} />
147+
<p className="mt-4 text-sm leading-6 text-gray-400">
148+
If the link does not open setup, run{" "}
149+
<strong className="font-semibold text-gray-300">
150+
DocumentDB: Set up DocumentDB Local
151+
</strong>{" "}
152+
from the VS Code Command Palette.
153+
</p>
156154
</div>
157155
</div>
158156
);

‎app/page.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,18 @@ const dockerQuickStartSteps = [
6161
const vscodeQuickStartSteps = [
6262
{
6363
step: "01",
64-
description: "Install the DocumentDB extension for Visual Studio Code.",
64+
description:
65+
"Install or update DocumentDB for VS Code to version 0.10.1 or later.",
6566
},
6667
{
6768
step: "02",
6869
description:
69-
"Open the DocumentDB Local setup and let the extension create and start the container for you.",
70+
"Open setup, confirm if prompted, select Continue, then review the defaults and select Start DocumentDB Local.",
7071
},
7172
{
7273
step: "03",
7374
description:
74-
"Browse databases, run queries, and edit documents without leaving the editor.",
75+
"When setup finishes, select Open Connection to browse data and run queries.",
7576
},
7677
];
7778

‎app/services/externalLinks.ts‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,5 @@ export const documentdbKubernetesOperatorGitHubUrl =
1717
export const documentdbVsCodeExtensionMarketplaceUrl =
1818
'https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-documentdb';
1919

20-
// Deep link into the extension's DocumentDB Local setup wizard.
21-
//
22-
// The path names the action; an empty path means "connect", which is what every link published
23-
// before the extension supported actions relies on. See the extension's
24-
// docs/user-manual/how-to-construct-url.md for the full vocabulary.
25-
//
26-
// Requires the extension to be installed: a `vscode://` URL for an absent extension does nothing
27-
// visible at all, so never present this without the marketplace link beside it.
2820
export const documentdbVsCodeLocalQuickStartDeepLink =
2921
'vscode://ms-azuretools.vscode-documentdb/local';

‎tests/quickStart.test.ts‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { createElement } from 'react';
2+
import { renderToStaticMarkup } from 'react-dom/server';
3+
import { describe, expect, it } from 'vitest';
4+
import Home from '../app/page';
5+
import {
6+
documentdbVsCodeExtensionMarketplaceUrl,
7+
documentdbVsCodeLocalQuickStartDeepLink,
8+
} from '../app/services/externalLinks';
9+
10+
const html = renderToStaticMarkup(createElement(Home));
11+
12+
describe('homepage local quick start', () => {
13+
it('preserves the public anchor and Docker as the default tab', () => {
14+
expect(html).toContain('id="run-with-docker"');
15+
expect(html).toMatch(
16+
/id="quickstart-tab-docker" aria-selected="true" aria-controls="quickstart-panel-docker" tabindex="0"/,
17+
);
18+
expect(html).toMatch(
19+
/id="quickstart-tab-vscode" aria-selected="false" aria-controls="quickstart-panel-vscode" tabindex="-1"/,
20+
);
21+
expect(html).toMatch(
22+
/id="quickstart-panel-docker" aria-labelledby="quickstart-tab-docker">/,
23+
);
24+
expect(html).toMatch(
25+
/id="quickstart-panel-vscode" aria-labelledby="quickstart-tab-vscode" hidden=""/,
26+
);
27+
expect(html).toContain('docker run -dt --name documentdb');
28+
expect(html).toContain('-p 10260:10260');
29+
expect(html).toContain(
30+
'ghcr.io/documentdb/documentdb/documentdb-local:latest',
31+
);
32+
});
33+
34+
it('offers the marketplace before the supported local setup deep link', () => {
35+
expect(documentdbVsCodeExtensionMarketplaceUrl).toBe(
36+
'https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-documentdb',
37+
);
38+
expect(documentdbVsCodeLocalQuickStartDeepLink).toBe(
39+
'vscode://ms-azuretools.vscode-documentdb/local',
40+
);
41+
const marketplace = html.indexOf(
42+
`href="${documentdbVsCodeExtensionMarketplaceUrl}"`,
43+
);
44+
const setup = html.indexOf(
45+
`href="${documentdbVsCodeLocalQuickStartDeepLink}"`,
46+
);
47+
expect(marketplace).toBeGreaterThan(-1);
48+
expect(setup).toBeGreaterThan(marketplace);
49+
});
50+
51+
it('states the shipped minimum version and Docker prerequisite', () => {
52+
expect(html).toContain('version 0.10.1 or later');
53+
expect(html).toContain(
54+
'Requires Docker Engine or Docker Desktop running Linux containers in your VS Code environment.',
55+
);
56+
});
57+
58+
it('describes the setup actions and provides a Command Palette fallback', () => {
59+
expect(html).toContain(
60+
'Open setup, confirm if prompted, select Continue, then review the defaults and select Start DocumentDB Local.',
61+
);
62+
expect(html).toContain(
63+
'When setup finishes, select Open Connection to browse data and run queries.',
64+
);
65+
expect(html).toContain('If the link does not open setup, run ');
66+
expect(html).toContain('DocumentDB: Set up DocumentDB Local');
67+
expect(html).toContain('from the VS Code Command Palette.');
68+
});
69+
});

0 commit comments

Comments
 (0)