Skip to content

Commit 1e0c2fc

Browse files
authored
Release 0.6.2 (#418)
2 parents cf51636 + c968230 commit 1e0c2fc

File tree

75 files changed

+6053
-4135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+6053
-4135
lines changed

.devcontainer/devcontainer.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "Node.js 20 Workspace",
3+
"image": "mcr.microsoft.com/devcontainers/javascript-node:20",
4+
5+
"hostRequirements": {
6+
"cpus": 4
7+
},
8+
9+
// Lifecycle commands
10+
"onCreateCommand": "npm install",
11+
"updateContentCommand": "if git diff --name-only HEAD~1 HEAD | grep -E 'package(-lock)?\\.json'; then npm install; fi && npm run build",
12+
13+
"forwardPorts": [3000],
14+
"portsAttributes": {
15+
"3000": {
16+
"label": "Development Server",
17+
"onAutoForward": "notify"
18+
}
19+
},
20+
21+
"customizations": {
22+
"vscode": {
23+
"extensions": [
24+
"dbaeumer.vscode-eslint",
25+
"mike-lischke.vscode-antlr4",
26+
"amodio.tsl-problem-matcher",
27+
"Orta.vscode-jest",
28+
"esbenp.prettier-vscode"
29+
],
30+
"settings": {
31+
"editor.formatOnSave": true,
32+
"eslint.enable": true
33+
}
34+
}
35+
},
36+
37+
// Cache node_modules between prebuilds
38+
"mounts": ["source=node_modules-cache,target=/workspace/node_modules,type=volume"]
39+
}

.github/copilot-instructions.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,152 @@ export async function yourCommand(context: IActionContext, targetItem: SomeItem)
371371
}
372372
```
373373

374+
### Wizard Back Navigation and Context Persistence
375+
376+
When users navigate back in a wizard (via `GoBackError`), the `AzureWizard` framework resets context properties. Understanding this behavior is critical for proper wizard implementation.
377+
378+
#### How AzureWizard Handles Back Navigation
379+
380+
When a step throws `GoBackError`, the wizard:
381+
382+
1. Pops steps from the finished stack until finding the previous prompted step
383+
2. **Resets context properties** to what existed before that step's `prompt()` ran
384+
3. Re-runs the step's `prompt()` method
385+
386+
**Critical Implementation Detail**: Before each step's `prompt()` runs, the wizard captures `propertiesBeforePrompt`:
387+
388+
```javascript
389+
// From AzureWizard.js - this runs for EACH step before prompt()
390+
step.propertiesBeforePrompt = Object.keys(this._context).filter((k) => !isNullOrUndefined(this._context[k])); // Only non-null/undefined values!
391+
```
392+
393+
When going back, properties NOT in `propertiesBeforePrompt` are set to `undefined`:
394+
395+
```javascript
396+
// From AzureWizard.js goBack() method
397+
for (const key of Object.keys(this._context)) {
398+
if (!step.propertiesBeforePrompt.find((p) => p === key)) {
399+
this._context[key] = undefined; // Property gets cleared!
400+
}
401+
}
402+
```
403+
404+
#### Making Context Properties Survive Back Navigation
405+
406+
To ensure a context property survives when users navigate back, you must initialize it with a **non-null, non-undefined value** in the wizard context creation:
407+
408+
```typescript
409+
// ❌ Bad - Property will be cleared on back navigation
410+
const wizardContext: MyWizardContext = {
411+
...context,
412+
cachedData: undefined, // undefined is filtered out of propertiesBeforePrompt!
413+
};
414+
415+
// ❌ Bad - Property not initialized, same problem
416+
const wizardContext: MyWizardContext = {
417+
...context,
418+
// cachedData not set - will be undefined
419+
};
420+
421+
// ✅ Good - Property will survive back navigation (using empty array)
422+
const wizardContext: MyWizardContext = {
423+
...context,
424+
cachedData: [], // Empty array is not null/undefined, captured in propertiesBeforePrompt
425+
};
426+
427+
// ✅ Good - Property will survive back navigation (using empty object)
428+
const wizardContext: MyWizardContext = {
429+
...context,
430+
cachedConfig: {}, // Empty object is not null/undefined
431+
};
432+
433+
// ✅ Good - Property will survive back navigation (using empty string)
434+
const wizardContext: MyWizardContext = {
435+
...context,
436+
cachedId: '', // Empty string is not null/undefined
437+
};
438+
439+
// ✅ Good - Property will survive back navigation (using zero)
440+
const wizardContext: MyWizardContext = {
441+
...context,
442+
retryCount: 0, // Zero is not null/undefined
443+
};
444+
445+
// ✅ Good - Property will survive back navigation (using false)
446+
const wizardContext: MyWizardContext = {
447+
...context,
448+
hasBeenValidated: false, // false is not null/undefined
449+
};
450+
```
451+
452+
#### Pattern for Cached Data with Back Navigation Support
453+
454+
When you need to cache expensive data (like API calls) that should survive back navigation:
455+
456+
1. **Context Interface**: Make the property required with a non-nullable type
457+
458+
```typescript
459+
export interface MyWizardContext extends IActionContext {
460+
// Required - initialized with non-null/undefined value to survive back navigation
461+
cachedItems: CachedItem[];
462+
463+
// Optional - user selections that may be cleared
464+
selectedItem?: SomeItem;
465+
}
466+
```
467+
468+
2. **Wizard Initialization**: Initialize with a non-null/undefined value
469+
470+
```typescript
471+
const wizardContext: MyWizardContext = {
472+
...context,
473+
cachedItems: [], // Any non-null/undefined value survives back navigation
474+
};
475+
```
476+
477+
3. **Step Implementation**: Check appropriately for the initial value
478+
479+
```typescript
480+
public async prompt(context: MyWizardContext): Promise<void> {
481+
const getQuickPickItems = async () => {
482+
// Check for initial empty value (array uses .length, string uses === '', etc.)
483+
if (context.cachedItems.length === 0) {
484+
context.cachedItems = await this.fetchExpensiveData();
485+
}
486+
return context.cachedItems.map(item => ({ label: item.name }));
487+
};
488+
489+
await context.ui.showQuickPick(getQuickPickItems(), { /* options */ });
490+
}
491+
```
492+
493+
4. **Clearing Cache**: Reset to the initial non-null/undefined value
494+
495+
```typescript
496+
// When you need to invalidate the cache (e.g., after a mutation)
497+
context.cachedItems = []; // Reset to initial value, not undefined!
498+
```
499+
500+
#### Using GoBackError in Steps
501+
502+
To navigate back programmatically from a step:
503+
504+
```typescript
505+
import { GoBackError } from '@microsoft/vscode-azext-utils';
506+
507+
public async prompt(context: MyWizardContext): Promise<void> {
508+
const result = await context.ui.showQuickPick(items, options);
509+
510+
if (result.isBackOption) {
511+
// Clear step-specific selections before going back
512+
context.selectedItem = undefined;
513+
throw new GoBackError();
514+
}
515+
516+
// Process selection...
517+
}
518+
```
519+
374520
### Tree View Architecture
375521

376522
- Use proper data providers that implement `vscode.TreeDataProvider`.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: 📥 Checkout Repository
19+
uses: actions/checkout@v4
20+
with:
21+
ref: main
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: 🚀 Deploy to GitHub Pages
25+
uses: JamesIves/github-pages-deploy-action@v4
26+
with:
27+
folder: docs/
28+
branch: gh-pages
29+
clean: true
30+
token: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Change Log
22

3+
## 0.6.2
4+
5+
### Fixes
6+
7+
- **Azure Tenant Filtering in Service Discovery**: Resolved an issue where users could not deselect tenants when filtering from a large number of available tenants. This update improves the Azure account, tenant, and subscription management workflow. For more details on the enhanced workflow, see the [updated documentation](https://microsoft.github.io/vscode-documentdb/user-manual/managing-azure-discovery). [#391](https://github.com/microsoft/vscode-documentdb/issues/391), [#415](https://github.com/microsoft/vscode-documentdb/pull/415)
8+
- **Service Discovery Defaults**: The service discovery feature now starts with no pre-selected engines. Previously, the Azure Cosmos DB for MongoDB (RU) plugin was enabled by default, which has been corrected. [#390](https://github.com/microsoft/vscode-documentdb/issues/390), [#412](https://github.com/microsoft/vscode-documentdb/pull/412)
9+
- **Accessibility in Query Insights**: Fixed a responsive layout issue in the "Query Insights" tab where the 'AI response may be inaccurate' text would overlap with other UI elements on resize. [#376](https://github.com/microsoft/vscode-documentdb/issues/376), [#416](https://github.com/microsoft/vscode-documentdb/pull/416)
10+
11+
### Improvements
12+
13+
- **Dependency Upgrades**:
14+
- Upgraded to React 19 and SlickGrid 9, enhancing UI performance and modernizing the webview components. This also includes updates to TypeScript, Webpack, and other build tools. [#406](https://github.com/microsoft/vscode-documentdb/issues/406), [#407](https://github.com/microsoft/vscode-documentdb/pull/407)
15+
- Updated various other dependencies to improve security and performance. [#386](https://github.com/microsoft/vscode-documentdb/pull/386)
16+
317
## 0.6.1
418

519
### New Features & Improvements

api/package-lock.json

Lines changed: 35 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The User Manual provides guidance on using DocumentDB for VS Code. It contains d
6464

6565
Explore the history of updates and improvements to the DocumentDB for VS Code extension. Each release brings new features, enhancements, and fixes to improve your experience.
6666

67-
- [0.6](./release-notes/0.6), [0.6.1](./release-notes/0.6#patch-release-v061)
67+
- [0.6](./release-notes/0.6), [0.6.1](./release-notes/0.6#patch-release-v061), [0.6.2](./release-notes/0.6#patch-release-v062)
6868
- [0.5](./release-notes/0.5), [0.5.1](./release-notes/0.5#patch-release-v051), [0.5.2](./release-notes/0.5#patch-release-v052)
6969
- [0.4](./release-notes/0.4), [0.4.1](./release-notes/0.4#patch-release-v041)
7070
- [0.3](./release-notes/0.3), [0.3.1](./release-notes/0.3#patch-release-v031)

docs/release-notes/0.6.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,56 @@ This patch release introduces feedback optimization and fixes a broken link.
7878

7979
### What's Changed in v0.6.1
8080

81-
#### **Feedback Optimization** ([#392](https://github.com/microsoft/vscode-documentdb/pull/392))
81+
#### 💠 **Feedback Optimization** ([#392](https://github.com/microsoft/vscode-documentdb/pull/392))
8282

8383
Introduces privacy consent and feedback signal controls for the Query Insights feature, primarily to ensure compliance with organizational data protection requirements and user telemetry settings. It also disables survey functionality and refines the feedback dialog UI.
8484

85-
#### **Privacy Policy Link Update** ([#388](https://github.com/microsoft/vscode-documentdb/pull/388))
85+
#### 💠 **Privacy Policy Link Update** ([#388](https://github.com/microsoft/vscode-documentdb/pull/388))
8686

8787
Updated the outdated privacy policy link in the README to the current Microsoft privacy statement URL.
8888

8989
### Changelog
9090

9191
See the full changelog entry for this release:
9292
➡️ [CHANGELOG.md#061](https://github.com/microsoft/vscode-documentdb/blob/main/CHANGELOG.md#061)
93+
94+
---
95+
96+
## Patch Release v0.6.2
97+
98+
This patch release delivers important fixes for Azure tenant management, service discovery, and accessibility. It also includes a significant set of dependency upgrades to modernize the extension's underlying architecture.
99+
100+
### What's Changed in v0.6.2
101+
102+
#### 💠 **Improved Azure Tenant and Subscription Filtering in Service Discovery** ([#391](https://github.com/microsoft/vscode-documentdb/issues/391), [#415](https://github.com/microsoft/vscode-documentdb/pull/415))
103+
104+
We've resolved a key issue that affected users managing numerous Azure tenants. Previously, when a user had access to a large number of tenants, and had selected all of them, the filtering wizard would fail to work correctly when attempting to deselect tenants, making it impossible to refine the resource view.
105+
106+
This update introduces an improved filtering mechanism that ensures a reliable experience, even for users in enterprise environments. The wizard for managing accounts, tenants, and subscriptions is now more resilient, allowing you to precisely control which resources are displayed in the Service Discovery panel.
107+
108+
For a complete guide on the enhanced workflow, please see our updated documentation on [Managing Azure Discovery](https://microsoft.github.io/vscode-documentdb/user-manual/managing-azure-discovery).
109+
110+
#### 💠 **Corrected Service Discovery Default Settings** ([#390](https://github.com/microsoft/vscode-documentdb/issues/390), [#412](https://github.com/microsoft/vscode-documentdb/pull/412))
111+
112+
To provide a cleaner initial experience, the Service Discovery feature no longer starts with any discovery engines enabled by default. In a previous version, the "Azure Cosmos DB for MongoDB (RU)" plugin was pre-selected by mistake, which could cause confusion.
113+
114+
With this fix, you now have full control over which service discovery plugins are active from the start, for a more intentional and direct setup.
115+
116+
#### 💠 **Accessibility Fix for Query Insights** ([#376](https://github.com/microsoft/vscode-documentdb/issues/376), [#416](https://github.com/microsoft/vscode-documentdb/pull/416))
117+
118+
We've addressed an accessibility issue in the "Query Insights" tab where the "AI response may be inaccurate" warning text would overlap with other UI elements when the panel was resized. The layout has been updated to be fully responsive, ensuring all content remains readable and accessible regardless of panel size.
119+
120+
#### 💠 **Modernized Architecture with Major Dependency Upgrades** ([#406](https://github.com/microsoft/vscode-documentdb/issues/406), [#407](https://github.com/microsoft/vscode-documentdb/pull/407), [#386](https://github.com/microsoft/vscode-documentdb/pull/386))
121+
122+
This release includes a significant overhaul of our dev dependencies, bringing major performance and modernization improvements:
123+
124+
- **Upgraded to React 19**: We've migrated our webview components to React 19, leveraging the latest features and performance enhancements from the React team.
125+
- **Upgraded to SlickGrid 9**: The data grids used to display collection data have been updated to SlickGrid 9. This major update improves rendering performance and aligns with modern JavaScript standards.
126+
- **Other Key Updates**: We've also updated TypeScript, Webpack, the MongoDB driver, and numerous other packages to enhance security, stability, and build performance.
127+
128+
These upgrades ensure the extension remains fast, secure, and aligned with the latest web development best practices.
129+
130+
### Changelog
131+
132+
See the full changelog entry for this release:
133+
➡️ [CHANGELOG.md#062](https://github.com/microsoft/vscode-documentdb/blob/main/CHANGELOG.md#062)

0 commit comments

Comments
 (0)