From e4bc9e2aea759e0250bb1c5953968bc170d23d8a Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Fri, 27 Nov 2026 17:36:06 +0100 Subject: [PATCH 01/52] partial plan --- docs/ai-and-plans/README.md | 1 + .../features/accessibility/README.md | 128 ++++++++++++ .../iterations/01-plan-work-items-3-6.md | 195 ++++++++++++++++++ 3 files changed, 324 insertions(+) create mode 100644 docs/ai-and-plans/features/accessibility/README.md create mode 100644 docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md diff --git a/docs/ai-and-plans/README.md b/docs/ai-and-plans/README.md index e3d707a58..09de431bd 100644 --- a/docs/ai-and-plans/README.md +++ b/docs/ai-and-plans/README.md @@ -46,6 +46,7 @@ treat `status: historical` or `status: superseded` as current. | [build-and-test-stack](./features/build-and-test-stack/README.md) | Vite host and webview builds, Vitest, packaged checks, CI tiers, and modernization history | active | | [e2e-testing](./features/e2e-testing/README.md) | The planned installed-workbench and webview end-to-end test iteration | planned | | [data-grid](./features/data-grid/README.md) | The Collection View table and tree, including the planned SlickGrid replacement | planned | +| [accessibility](./features/accessibility/README.md) | Open a11y issues grouped into work items, with grid-dependent fixes parked until the grid update lands | active | | [survey](./features/survey/README.md) | Survey refresh: simpler eligibility, broader activity coverage, cohort telemetry, and invitation surface | draft #992; enabled | | [docs-site](./features/docs-site/README.md) | The GitHub Pages documentation site: Just the Docs theme, OS dark mode, local preview | draft #420 | | [pre-release-polish](./features/pre-release-polish/README.md) | Cross-feature visual and documentation refinements prepared for the 1.0 release | active | diff --git a/docs/ai-and-plans/features/accessibility/README.md b/docs/ai-and-plans/features/accessibility/README.md new file mode 100644 index 000000000..00aefef9f --- /dev/null +++ b/docs/ai-and-plans/features/accessibility/README.md @@ -0,0 +1,128 @@ +--- +feature: accessibility +kind: plan +status: active +created: 2026-11-27 +--- + +# Accessibility work items + +Issue-based grouping of all **13 open issues labelled `a11y`** as of 2026-11-27. +The issue bodies and comments were read; the codebase was not inspected to establish +current behavior or root causes. "Available" means available to start, not implemented +or verified. + +## Scope and sequencing + +The operator's decision on 2026-11-27 is to **park work items 1 and 2 until the grid +update lands on `main`**. Work items 3-6 are available now and do not need to wait for +that merge. After the grid update lands, reassess the parked reports against the +updated implementation before making additional changes. + +The plan for work items 3-6 is in +[iterations/01-plan-work-items-3-6.md](./iterations/01-plan-work-items-3-6.md). + +The grid update is documented under [data-grid](../data-grid/README.md). The two +VS Code-owned reports remain a separate upstream-tracking bucket, not presumed fixes +for this branch. + +## Work items + +### 1. Collection grid/tree keyboard interaction + +**Status:** parked until the grid update lands on `main`. +**Issues:** [#383](https://github.com/microsoft/vscode-documentdb/issues/383), +[#775](https://github.com/microsoft/vscode-documentdb/issues/775), +[#776](https://github.com/microsoft/vscode-documentdb/issues/776). + +- Keyboard navigation and activation in both table and tree modes, with logical, + visible focus. +- Table-cell focus indicators with at least **3:1 contrast** against adjacent colors + in Light 2026 and Dark 2026 themes. +- Column resizing without dragging, including a **single-pointer alternative** as + well as keyboard operation. Keyboard support alone does not satisfy #776. + +@tnaum-ms's 2026-10-01 comments already group these reports under the planned grid/tree +update and explicitly state that implementation and accessibility verification were +still pending. #383 is the severity-1 functionality blocker in the issue reports. + +### 2. Collection and Query Insights visual contrast + +**Status:** parked until the grid update lands on `main`, including the Query Insights +portion of this work item. +**Issues:** [#382](https://github.com/microsoft/vscode-documentdb/issues/382), +[#771](https://github.com/microsoft/vscode-documentdb/issues/771). + +- Grid "AB" text with at least **4.5:1 contrast** against its background. +- Query Insights information icons and grid `{}` icons with at least **3:1 contrast** + in Light 2026 and Dark 2026 themes. +- Retain the secondary report of low-contrast focused table-row text from + [#778](https://github.com/microsoft/vscode-documentdb/issues/778) in this contrast + pass. Its Quick Pick disposition does not establish that the table symptom is + outside extension control. + +These reports belong together as a visual-contrast pass; the issues do not establish +a shared implementation root cause. + +### 3. Query Playground keyboard workflow + +**Status:** available now. +**Issues:** [#773](https://github.com/microsoft/vscode-documentdb/issues/773), +[#774](https://github.com/microsoft/vscode-documentdb/issues/774). + +- Keyboard access and activation for "Connect to..." and "Shell", with visible focus. +- Make newly opened query results discoverable through focus movement **or + notification**, as #774 permits. + +Treat these as an editor-to-results workflow. @tnaum-ms identifies the CodeLens +approach as the concern in #773; no replacement approach has been selected here. + +### 4. New Document focus management + +**Status:** available now. +**Issues:** [#769](https://github.com/microsoft/vscode-documentdb/issues/769), +[#770](https://github.com/microsoft/vscode-documentdb/issues/770). + +- F6 must not land on invisible, non-interactive content. +- Save must show a visible focus indicator when initially focused, not only after + navigating away and back. +- Cover initial opening and subsequent F6, Tab, and Shift+Tab navigation together. + +### 5. Explorer tree accessible names + +**Status:** available now. +**Issue:** [#768](https://github.com/microsoft/vscode-documentdb/issues/768). + +Accessible names must include the visible "Documents" label. @Jacquelinezhong's +2026-08-20 comment reports the same problem for "Indexes" and proposes fixing both +together. Include both labels and check for overlapping contributor work before +implementation; the comment alone does not establish that a fix has landed. + +### 6. Index-creation completion announcement + +**Status:** available now. +**Issue:** [#772](https://github.com/microsoft/vscode-documentdb/issues/772). + +Announce successful index creation from AI Performance Insights without requiring +users to locate or focus the confirmation manually. This is a distinct status-message +fix, separate from visual contrast. + +## Upstream tracking + +Both reports below are open with the `wontfix` label. @tnaum-ms identifies the native +VS Code Quick Pick colors as outside extension control; @kapilvaishna links the +corresponding upstream reports: + +| Local issue | Report | Upstream | +| --- | --- | --- | +| [#767](https://github.com/microsoft/vscode-documentdb/issues/767) | Quick Pick placeholder text contrast | [microsoft/vscode#321135](https://github.com/microsoft/vscode/issues/321135) | +| [#778](https://github.com/microsoft/vscode-documentdb/issues/778) | Quick Pick focused-item text contrast | [microsoft/vscode#325289](https://github.com/microsoft/vscode/issues/325289) | + +Upstream issue status was not checked. Keep the focused table-row symptom from #778 +under work item 2 rather than assuming an upstream Quick Pick fix covers it. + +## Verification and closure + +This document records grouping and sequencing only; no fix or accessibility +verification is claimed. The reports that reserve closure for TCS/C+AI accessibility +testers must remain open until those testers verify the fixes. diff --git a/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md b/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md new file mode 100644 index 000000000..1f5054806 --- /dev/null +++ b/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md @@ -0,0 +1,195 @@ +--- +feature: accessibility +kind: plan +status: active +created: 2026-11-27 +--- + +# Plan: work items 3-6 + +Plan and suggestions for the four work items that are available now (see the +[feature README](../README.md)). Work items 1 and 2 stay parked until the grid update +lands on `main`. + +The issue bodies were re-read and the current code was inspected on 2026-11-27. Every +"Finding" below cites the code it is based on. Statements marked **verify** are +platform behavior that has not been confirmed in this session and must be checked +before relying on them. + +## Suggested order and PR shape + +| Order | Work item | Issues | Size | Why this order | +| --- | --- | --- | --- | --- | +| 1 | 5. Explorer tree accessible names | #768 | XS | One-line fix, no UX decision. Coordinate with the volunteer first. | +| 2 | 6. Index-creation announcement | #772 | S | Reuses the existing `Announcer` pattern. | +| 3 | 4. New Document focus management | #769, #770 | S-M | #769 needs a reproduction before a fix can be chosen. | +| 4 | 3. Query Playground keyboard workflow | #773, #774 | M | Needs two UX decisions (below). | + +One PR per work item keeps each fix independently verifiable by the TCS/C+AI testers, +who close the issues. Items 5 and 6 are small enough to share a PR if preferred. + +## 5. Explorer tree accessible names (#768) + +**Finding.** `DocumentsItem.getTreeItem()` sets a static string tooltip, +`'Click to open the collection view'` +([DocumentsItem.ts:56](../../../../../src/tree/documentdb/DocumentsItem.ts)). The issue +reports the accessible name as that tooltip text (on 0.9.1 it read "Double-click…"; the +wording has changed since, but it still does not contain "Documents"). VS Code's custom +tree view uses a string tooltip as the row's accessible name when no +`accessibilityInformation` is set (**verify** against the current VS Code tree +accessibility provider). + +`IndexesItem` on this branch sets **no** tooltip +([IndexesItem.ts:154-161](../../../../../src/tree/documentdb/IndexesItem.ts)), so its name +should already be "Indexes" plus the count description. That contradicts the 2026-08-20 +comment on #768; re-check it with Accessibility Insights rather than changing it blindly. +A search of `src/tree` and `src/plugins` found no other static `l10n.t()` string tooltip. + +**Suggested fix.** Set +`accessibilityInformation: { label: l10n.t('Documents') }` on the Documents item and keep +the hover tooltip for sighted users. Alternative: drop the tooltip, or make it start with +the visible label ("Documents – click to open the collection view"). + +**Tests.** A unit test asserting the accessible name of `DocumentsItem` contains its +label. Optionally a small guard test over tree items that use a plain-string tooltip. + +**Before starting.** @Jacquelinezhong volunteered on the issue and no PR exists (checked +2026-11-27). Ask on #768 whether they still plan to submit it. + +## 6. Index-creation completion announcement (#772) + +**Finding.** `ImprovementCard` renders success and error `MessageBar`s conditionally +after the action resolves +([ImprovementCard.tsx:216-246](../../../../../src/webviews/documentdb/collectionView/queryInsightsTab/components/optimizationCards/ImprovementCard.tsx)). +They are not live regions, so nothing is announced. On success the primary button also +becomes `disabled` (`disabled={… || !!primaryState.successMessage}`), which drops focus +from the button the user just activated to the document body. The same card serves the +drop-index and other actions, primary and secondary. + +**Suggested fix.** + +- Announce through the existing `Announcer` component, using the key-bump pattern from + `IndexesTab.tsx:256-268` and `ClusterDashboard.tsx`: polite for success, assertive for + errors. This matches the issue's requirement that the live region exist before the + text is injected. +- Keep focus on the activated button by using Fluent's `disabledFocusable` instead of + `disabled` after success, or move focus to the result message (`tabIndex={-1}`). +- Fix it in `ImprovementCard` for both buttons and both outcomes, not only create index. + +Alternative: Fluent `MessageBar` `politeness`. **Verify** that it announces without an +`AriaLiveAnnouncer` provider in our webviews before choosing it; `Announcer` is the +established pattern in this repo. + +**Tests.** A component test asserting a `role="status"` region receives the success +text, and that the button keeps focus. Add a browser scenario if Query Insights already +has one. + +## 4. New Document focus management (#769, #770) + +**Finding (#770).** On mount, `DocumentView` calls `saveButtonRef.current?.focus()` +([documentView.tsx:143](../../../../../src/webviews/documentdb/documentView/documentView.tsx)). +Fluent v9 draws focus rings only in keyboard-navigation mode (`:focus-visible` via +tabster/keyborg), and a programmatic focus on load does not enter that mode, so the ring +is missing until the user presses Tab (**verify** in the webview DevTools). + +Related: in `view` mode Save is disabled, so the same `focus()` call silently does +nothing. + +**Suggested fix (#770).** Add a small shared helper in +`src/webviews/components/accessibility/`, for example `focusWithVisibleIndicator(el)`, +that focuses the element and forces the visible indicator. Candidates, in order of +preference: Fluent/keyborg's keyboard-mode API; `el.focus({ focusVisible: true })` +(**verify** support in the VS Code Electron build); a scoped `:focus` style for the +initial-focus case. Use it at both `focus()` call sites, and pick a focus target that is +enabled in `view` mode. + +**Finding (#769).** Not yet reproducible from code. The report: F6 from the editor +lands on invisible static content; then Shift+Tab reaches Save and Tab reaches a +"Go Back" button that is not in our toolbar, likely VS Code's title-bar navigation. That +pattern suggests focus landed on the webview document itself (body or iframe) or on a +hidden element such as Monaco's aria container or a Fluent portal. + +**Suggested approach (#769).** + +1. Reproduce and log `document.activeElement` from the webview DevTools after F6. +2. Compare with another webview editor (for example Markdown preview) to decide whether + the F6 target is VS Code-owned. +3. If it is ours: remove any `tabIndex={0}` from non-interactive elements, and when the + webview receives focus with `document.activeElement === document.body`, redirect it + to the first meaningful control using the helper above. +4. If it is VS Code-owned: record it under "Upstream tracking" in the README, as was + done for #767 and #778. + +**Tests.** Cover initial open, F6, Tab and Shift+Tab together (the README requires +this). A browser scenario for the Document view can assert the initial +`document.activeElement` and the focus-visible state. + +## 3. Query Playground keyboard workflow (#773, #774) + +**Finding (#773).** Connect, Run, Run All, Collection View and Shell are CodeLens items +([PlaygroundCodeLensProvider.ts](../../../../../src/documentdb/playground/PlaygroundCodeLensProvider.ts)). +CodeLens items are not in the Tab order; keyboard users can only reach them through +VS Code's "Show CodeLens Commands for Current Line", which has no default keybinding. +Current non-CodeLens surfaces: + +- `playground.connect` is in the Command Palette. +- `runAll` and `runSelected` have keybindings (`Ctrl+Shift+Enter`, `Ctrl+Enter`) but are + hidden from the palette. +- `openQueryInShell` and `openQueryInCollectionView` are **not contributed in + `package.json` at all**, so they have no keyboard path. +- `editor/title` and `editor/context` menus are empty (`package.json:973-974`). +- A status bar item exists, but it only shows connection info + ([PlaygroundService.ts:75-76](../../../../../src/documentdb/playground/PlaygroundService.ts)). + +**Suggested fix (#773).** Keep CodeLens for mouse users and add native, +keyboard-reachable surfaces: + +1. Contribute `openQueryInShell` and `openQueryInCollectionView` as commands. Without + arguments they act on the block at the cursor. Show them in the palette when a + playground is active and connected (new context key, for example + `documentdb.playgroundConnected`; it must not have the `name.ext` shape when used on + its own, see the manifest-ID rule in `copilot-instructions.md`). +2. Add `editor/title` actions for playground editors: Run All and Connect / Change + Connection inline, Shell and Collection View in the overflow menu. The editor title + toolbar is keyboard reachable. +3. Add an `editor/context` group with the same commands (Shift+F10). +4. Make the status bar item act as Connect while disconnected, and offer "Change + connection" when connected. The status bar is reachable with F6. +5. Show `runAll` and `runSelected` in the palette for playground editors. +6. Optionally mention the shortcuts and "Show CodeLens Commands for Current Line" in the + new-playground header template. + +**Finding (#774).** `PlaygroundResultProvider.showResult()` always opens the result +beside the editor with `preserveFocus: true` +([PlaygroundResultProvider.ts:95-113](../../../../../src/documentdb/playground/PlaygroundResultProvider.ts)). +This is deliberate for the edit-run loop: `Ctrl+Enter` is bound only while the +playground editor has focus, so moving focus would break repeated runs. + +**Options (#774).** The issue accepts either moving focus or notifying. + +| Option | Effect | Trade-off | +| --- | --- | --- | +| A. Always move focus (`preserveFocus: false`) | Matches the issue's first expectation | Breaks the run-edit-run loop for everyone | +| B. Move focus only in screen-reader mode | Add a `Ctrl+Enter` keybinding variant with `when: … && accessibilityModeEnabled` and `args: { focusResult: true }` | Testers who check keyboard-only without screen-reader mode still see no change. **Verify** the context key. | +| C. Setting `documentDB.playground.focusResultAfterRun` (default off) plus a "Focus Query Playground Result" command | User control and a fast way to jump | Default behavior still fails the report | +| D. Notify on completion (`showInformationMessage` with a "Focus Result" button) | Announced by screen readers | Noisy for sighted users on every run | + +**Recommendation.** B + C: screen-reader mode moves focus by default, everyone else can +opt in, and a dedicated command makes results reachable with one keystroke. Choose D +instead if the testers verify #774 without screen-reader mode enabled. + +**Tests.** Unit tests for the `showResult` focus option and the command `when` clauses. +`npm run build` covers the manifest; the activation check applies if any new command is +registered lazily. + +## Open decisions for the operator + +1. #774: which option (B + C recommended, or D). +2. #773: which commands go inline in the editor title versus the overflow menu. +3. #768: wait for @Jacquelinezhong, or take the fix. +4. Ship items 5 and 6 together or separately. + +## Verification and closure + +Each PR follows Case 1 while in draft and Case 2 when handed over. No fix is claimed +here. The issues stay open until the TCS/C+AI testers verify them. From 5cec34a5ed2285b5f0ac82ff3ea7c98b9be38cf6 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Fri, 27 Nov 2026 18:23:21 +0100 Subject: [PATCH 02/52] docs: record accepted accessibility work-item plan Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../iterations/01-plan-work-items-3-6.md | 269 ++++++++++++++---- 1 file changed, 213 insertions(+), 56 deletions(-) diff --git a/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md b/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md index 1f5054806..d7645ad24 100644 --- a/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md +++ b/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md @@ -23,7 +23,7 @@ before relying on them. | 1 | 5. Explorer tree accessible names | #768 | XS | One-line fix, no UX decision. Coordinate with the volunteer first. | | 2 | 6. Index-creation announcement | #772 | S | Reuses the existing `Announcer` pattern. | | 3 | 4. New Document focus management | #769, #770 | S-M | #769 needs a reproduction before a fix can be chosen. | -| 4 | 3. Query Playground keyboard workflow | #773, #774 | M | Needs two UX decisions (below). | +| 4 | 3. Query Playground keyboard workflow | #773, #774 | M | Needs four UX decisions (3a-3d below). | One PR per work item keeps each fix independently verifiable by the TCS/C+AI testers, who close the issues. Items 5 and 6 are small enough to share a PR if preferred. @@ -126,68 +126,225 @@ this). A browser scenario for the Document view can assert the initial ## 3. Query Playground keyboard workflow (#773, #774) -**Finding (#773).** Connect, Run, Run All, Collection View and Shell are CodeLens items -([PlaygroundCodeLensProvider.ts](../../../../../src/documentdb/playground/PlaygroundCodeLensProvider.ts)). -CodeLens items are not in the Tab order; keyboard users can only reach them through -VS Code's "Show CodeLens Commands for Current Line", which has no default keybinding. -Current non-CodeLens surfaces: - -- `playground.connect` is in the Command Palette. -- `runAll` and `runSelected` have keybindings (`Ctrl+Shift+Enter`, `Ctrl+Enter`) but are - hidden from the palette. -- `openQueryInShell` and `openQueryInCollectionView` are **not contributed in - `package.json` at all**, so they have no keyboard path. -- `editor/title` and `editor/context` menus are empty (`package.json:973-974`). -- A status bar item exists, but it only shows connection info - ([PlaygroundService.ts:75-76](../../../../../src/documentdb/playground/PlaygroundService.ts)). - -**Suggested fix (#773).** Keep CodeLens for mouse users and add native, -keyboard-reachable surfaces: - -1. Contribute `openQueryInShell` and `openQueryInCollectionView` as commands. Without - arguments they act on the block at the cursor. Show them in the palette when a - playground is active and connected (new context key, for example - `documentdb.playgroundConnected`; it must not have the `name.ext` shape when used on - its own, see the manifest-ID rule in `copilot-instructions.md`). -2. Add `editor/title` actions for playground editors: Run All and Connect / Change - Connection inline, Shell and Collection View in the overflow menu. The editor title - toolbar is keyboard reachable. -3. Add an `editor/context` group with the same commands (Shift+F10). -4. Make the status bar item act as Connect while disconnected, and offer "Change - connection" when connected. The status bar is reachable with F6. -5. Show `runAll` and `runSelected` in the palette for playground editors. -6. Optionally mention the shortcuts and "Show CodeLens Commands for Current Line" in the - new-playground header template. - -**Finding (#774).** `PlaygroundResultProvider.showResult()` always opens the result -beside the editor with `preserveFocus: true` +The two issues describe one workflow: connect, write a query, run it, read the result, +and move it to another surface. Today that workflow assumes a mouse at two points +(the CodeLens buttons) and assumes sight at a third (noticing that the result tab +updated). The decisions below are listed in the order they block implementation. + +### 3.1 Current behavior (from the code) + +| Action | CodeLens (mouse) | Keyboard path today | Gaps | +| --- | --- | --- | --- | +| Connect | "Connect" on line 1 | Command Palette "Query Playground: Connect to Database"; status bar item (F6 to the status bar, then arrow keys) | Neither is visible from the editor or the Tab order, so testers did not find them | +| Change connection | "$(plug) cluster/db" on line 1 → modal | Status bar item → same modal | `showConnectionInfo` is hidden from the palette | +| Run All | line 1 | `Ctrl+Shift+Enter` | Hidden from the palette; only documented in the file's header comment | +| Run block | block start line | `Ctrl+Enter` | Same as Run All | +| Open block in Shell | block start line, only when connected and the block contains code | **none** | Not contributed in `package.json`; the handler returns silently without `uri, startLine, endLine` arguments | +| Open block in Collection View | same as Shell | **none** | Same as Shell | + +Sources: [PlaygroundCodeLensProvider.ts](../../../../../src/documentdb/playground/PlaygroundCodeLensProvider.ts), +[PlaygroundService.ts:347-366](../../../../../src/documentdb/playground/PlaygroundService.ts) +(the status bar item already switches to Connect when disconnected), +[playgroundOpenInShell.ts:26-28](../../../../../src/commands/playground/playgroundOpenInShell.ts), +`package.json:973-974` (empty `editor/title` and `editor/context`) and the +`commandPalette` entries that set `when: never` for `runAll`, `runSelected` and +`showConnectionInfo`. + +VS Code's built-in fallback, "Show CodeLens Commands for Current Line" +(`codelens.showLensesInCurrentLine`), has no default keybinding and lists only the lenses +on the **cursor's line** (checked in VS Code's `codelensController.ts`). Our Connect and +Run All lenses sit on line 1 and the block lenses on the block's first line, so a +keyboard user would have to move the cursor to exactly those lines. It is a workaround, +not a fix. + +Running a query reports progress in a notification and shows failures with +`showErrorMessage`, which screen readers announce. **Success is the only silent +outcome**: the result opens or updates beside the editor with `preserveFocus: true` ([PlaygroundResultProvider.ts:95-113](../../../../../src/documentdb/playground/PlaygroundResultProvider.ts)). -This is deliberate for the edit-run loop: `Ctrl+Enter` is bound only while the -playground editor has focus, so moving focus would break repeated runs. -**Options (#774).** The issue accepts either moving focus or notifying. +### 3.2 #773: make every action reachable without CodeLens -| Option | Effect | Trade-off | -| --- | --- | --- | -| A. Always move focus (`preserveFocus: false`) | Matches the issue's first expectation | Breaks the run-edit-run loop for everyone | -| B. Move focus only in screen-reader mode | Add a `Ctrl+Enter` keybinding variant with `when: … && accessibilityModeEnabled` and `args: { focusResult: true }` | Testers who check keyboard-only without screen-reader mode still see no change. **Verify** the context key. | -| C. Setting `documentDB.playground.focusResultAfterRun` (default off) plus a "Focus Query Playground Result" command | User control and a fast way to jump | Default behavior still fails the report | -| D. Notify on completion (`showInformationMessage` with a "Focus Result" button) | Announced by screen readers | Noisy for sighted users on every run | +The principle: CodeLens stays as the mouse shortcut, and every lens action also exists +as a regular command on standard keyboard-reachable VS Code surfaces. No custom focus +handling is needed in the editor. -**Recommendation.** B + C: screen-reader mode moves focus by default, everyone else can -opt in, and a dedicated command makes results reachable with one keystroke. Choose D -instead if the testers verify #774 without screen-reader mode enabled. +Required groundwork, independent of the decisions below: -**Tests.** Unit tests for the `showResult` focus option and the command `when` clauses. -`npm run build` covers the manifest; the activation check applies if any new command is -registered lazily. +- Make `openQueryInShell` and `openQueryInCollectionView` work without arguments by + using the block at the cursor, with the same fallback to the preceding block that + `runSelected` uses. Extract that block resolution into a shared helper so CodeLens, + `runSelected` and the new entry points agree on the block. +- Add context keys for menu `when` clauses: the playground is connected, and the + current block contains code. Set them from the existing `onDidChangeState` and + selection listeners. Context-key names must not have the `name.ext` shape when they + appear on their own in `package.json` (see the manifest-ID rule in + `copilot-instructions.md`). +- Record `activationSource` per surface (`codeLens`, `editorTitle`, `editorContext`, + `commandPalette`, `keybinding`) so we can see which surfaces people use. -## Open decisions for the operator +**Decision 3a: which surfaces to add.** **Decided 2026-11-27 +([decisions 0002](../decisions.md#0002--playground-actions-use-standard-vs-code-surfaces-no-new-keybindings)):** +palette, editor title, context menu and header comment; no new default keybindings. +`Ctrl+Enter` and `Ctrl+Shift+Enter` stay as they are. -1. #774: which option (B + C recommended, or D). -2. #773: which commands go inline in the editor title versus the overflow menu. -3. #768: wait for @Jacquelinezhong, or take the fix. -4. Ship items 5 and 6 together or separately. +| Surface | How keyboard users reach it | Discoverable? | Cost | Recommendation | +| --- | --- | --- | --- | --- | +| Command Palette entries | `Ctrl+Shift+P`, type "Query Playground" | Medium | Tiny: change `when: never` to `editorLangId == 'documentdb-playground'` | **Yes**, the minimum | +| Editor title toolbar (`editor/title`) | Focus the tab, then Tab into the toolbar | High: visible buttons next to the tab | Small; icons needed | **Yes**, the closest equivalent to the CodeLens buttons | +| Editor context menu (`editor/context`) | `Shift+F10` or the Menu key in the editor | Medium | Small | **Yes**, it acts on the cursor's block, matching the block lenses | +| Default keybindings for Shell / Collection View | Shortcut | Low unless documented | Risk of conflicts with user or other extension bindings | **No**; users can bind the commands themselves | +| Header comment in new playgrounds | Read with the file | High for screen-reader users | Tiny | **Yes**: name the palette commands and the context menu | + +**Decision 3b: what goes inline in the editor title and what goes in the overflow +menu ("…").** Inline buttons are the most visible but crowd the title bar, which also +holds VS Code's own split and more-actions buttons. + +- Recommended inline: **Run All** (with the `run-all` icon) and **Connect / Change + Connection** (with the `plug` icon). These are file-level actions, like their + line-1 lenses. +- Recommended overflow: **Run Block**, **Open Block in Shell**, **Open Block in + Collection View**. They depend on the cursor position, so they fit the context menu + better and should be there too. +- Alternative: put all five in the overflow menu to keep the title bar clean, at the + cost of discoverability. + +**Decision 3c: one Connect entry point or two.** Today the connected state uses +`showConnectionInfo` (a modal offering to switch), and the disconnected state uses +`connect`. The editor title can show the right command per state using the +"connected" context key, or show a single "Connect to Database…" that always opens the +picker. Recommended: one title action per state, mirroring the CodeLens and the status +bar, so all three surfaces behave the same. + +**Decisions 3b and 3c: decided as recommended +([decisions 0003](../decisions.md#0003--playground-editor-title-layout-and-connect-follow-the-recommendations)).** + +**Out of scope.** A setting to hide CodeLens, and changing the CodeLens layout. The +issue is about reachability, not about removing CodeLens. + +### 3.3 #774: make the completed run discoverable + +The issue accepts either outcome: "keyboard focus should move to the newly opened +result tab, **or** users should be notified". Moving focus is costly here because +`Ctrl+Enter` and `Ctrl+Shift+Enter` only work while the playground editor has focus. A +user whose focus moves to the result after every run has to return to the playground +(for example with "View: Focus Previous Editor Group") before running again. + +**Decision 3d: what happens by default after a successful run.** **Decided 2026-11-27 +([decisions 0004](../decisions.md#0004--after-a-run-focus-moves-to-the-result-only-in-screen-reader-mode)):** +option B through the `afterRun` setting below, documented on a new Accessibility page +(§7). The options are kept for the record. + +| Option | Behavior | Who benefits | Cost | Satisfies #774 for a tester using NVDA? | +| --- | --- | --- | --- | --- | +| A. Always move focus | `preserveFocus: false` | Screen-reader users | Breaks the edit-run loop for everyone | Yes | +| B. Move focus only in screen-reader-optimized mode | A second `Ctrl+Enter` / `Ctrl+Shift+Enter` keybinding with `when: … && accessibilityModeEnabled` and `args: { screenReaderMode: true }`; the command then moves focus to the result | Screen-reader users | Sighted keyboard-only users see no change. Runs started from CodeLens or the palette do not carry the args. | Yes, if VS Code detected the screen reader or `editor.accessibilitySupport` is `on` | +| C. Announce instead of moving focus | On success, show a non-modal notification such as "Query returned 20 documents" with a **Focus Result** button; focus stays in the playground | Screen-reader users; also gives everyone a one-step way to the result | A toast after every run is noise for sighted users | Yes, notifications are announced | +| C'. Announce instead of moving focus, only in screen-reader mode | Same as C, but only for runs that carry `screenReaderMode: true` (same keybinding mechanism as B). **An alternative to B, not an addition**: in screen-reader mode a run either moves focus (B) or announces (C'), never both | Screen-reader users | Same path limits as B | Yes, if the testers accept "notified" rather than "focus moved" | +| D. Setting only | `documentDB.playground.afterRun`: `stay` (default), `focusResult`, `notify` | Users who find the setting | Default behavior unchanged | **No**, default behavior still fails | + +Notes for evaluating the options: + +- VS Code defines `CONTEXT_ACCESSIBILITY_MODE_ENABLED` for screen-reader-optimized mode, + and VS Code's own features gate keybindings on it. **Verify** that the key string is + `accessibilityModeEnabled` with "Developer: Inspect Context Keys" before relying on it. + Extensions cannot read context keys directly, so the keybinding `args` is the only + way to pass this mode to the command. Reading the `editor.accessibilitySupport` + setting only helps when it is explicitly `on`, not `auto`. +- `runSelected(context, startLine, endLine)` takes positional line numbers from + CodeLens. Keybinding `args` arrive as one object in the first position, so the + signature must accept either form, for example `startLineOrOptions: number | { screenReaderMode?: boolean }`. +- "Focus Query Playground Result" as a palette command is cheap and useful under every + option. A matching "Focus Query Playground" command, also bound inside the result + editor, gives a one-key way back, which removes most of option A's cost for users who + choose to move focus. +- A completion announcement should state what came back (count or type, from + `formatResult`), not only "done", so it carries information for every user. + +**Recommendation: B as the default, exposed through one setting.** The setting is the +single source of truth; the screen-reader keybinding only informs its `auto` value. + +`documentDB.playground.afterRun`: + +| Value | Run started in screen-reader mode (keybinding passes `screenReaderMode: true`) | Any other run (normal keybinding, CodeLens, palette, title or context menu) | +| --- | --- | --- | +| `auto` (default) | Move focus to the result (option B) | Stay in the playground (today's behavior) | +| `stay` | Stay in the playground | Stay in the playground | +| `focusResult` | Move focus to the result | Move focus to the result | +| `notify` | Stay, and show the completion notification with **Focus Result** (option C) | Same | + +Rules: + +- An explicit value (`stay`, `focusResult`, `notify`) overrides the screen-reader + default for every run and every entry point. Only `auto` looks at + `screenReaderMode`. +- The behaviors never combine: one run produces exactly one of "stay", "move focus" or + "notify". C' is therefore not part of the recommendation; it is the alternative to + choose for `auto` if the operator prefers announcing over moving focus in + screen-reader mode. +- Errors keep today's error notification under every value. +- The "Focus Query Playground Result" and "Focus Query Playground" commands are added + under every value, so returning to the playground after a focus move is one command. + +Everyone who does not use screen-reader-optimized mode keeps today's edit-run loop +unless they change the setting. + +**Fallback if the testers do not use screen-reader mode.** With `auto`, nothing changes +for a keyboard-only tester. Ask on #774 which configuration they verify with before +implementing. If the answer is "keyboard only", change `auto` so that runs outside +screen-reader mode show the notification (option C) only on the **first** run per +playground, the run that opens the result tab, which is the "newly opened tab" case the +issue describes. Later runs stay silent, and the explicit setting values keep the +meaning in the table above. + +### 3.4 Tests and verification + +- Unit tests: block resolution for the new no-argument command paths, the + `runSelected` argument forms, and the `showResult` focus option. +- Manifest: every new command and menu `when` clause is checked by `npm run build` and + the VSIX/activation checks. Commands registered at activation do not need a + `LAZY_COMMANDS` entry. +- Manual pass with NVDA and with keyboard only: connect, run a block, run all, open the + block in Shell and in Collection View, and return to the playground, without the + mouse. Record the result in the PR. + +## 7. Accessibility page in the user manual + +**Decided 2026-11-27 +([decisions 0005](../decisions.md#0005--a-dedicated-accessibility-page-in-the-user-manual)).** +A new top-level page, `docs/user-manual/accessibility.md` (`parent: 'User Manual'`, +`nav_order: 5`, after AI Features), collects what the extension offers for assistive +technology. Proposed outline: + +1. **Keyboard access**: Query Playground actions through the palette, editor title and + context menu; the run shortcuts; the new focus commands. +2. **Screen readers**: the playground `afterRun` setting and its screen-reader default; + status announcements in webviews (Query Insights, index management, connection + diagnostics); Escape to leave embedded editors. +3. **Interactive Shell**: `documentDB.shell.display.colorSupport` for plain output; + links are underlined even with colors off, so they never rely on color alone + ([#631](https://github.com/microsoft/vscode-documentdb/pull/631)); the open terminal + accessibility pass + ([#941](https://github.com/microsoft/vscode-documentdb/issues/941)), mentioned only + for whatever it ships. +4. **Settings reference**: `documentDB.accessibility.hideCountPrefix`, + `documentDB.shell.display.colorSupport`, `documentDB.playground.afterRun`, and any + other accessibility-related settings found while writing the page. +5. **Known limitations and reporting**: VS Code-owned issues (Quick Pick contrast, see the + README's upstream tracking) and how to file an issue. + +Rules: describe only shipped behavior; link from Query Playground and Interactive Shell +instead of repeating content; add the page in the PR that ships work item 3, or earlier +with sections 3-5 only. Preview with the `previewing-docs-site` skill. + +## Decisions + +All decisions from this plan are recorded in [decisions.md](../decisions.md) +(0002-0006). Still open: + +1. Confirm the `accessibilityModeEnabled` context key (0004). +2. Ask on #774 which configuration the testers verify with. If they test keyboard-only, + the first-run notification fallback for `auto` needs a new decision. +3. Ask @Jacquelinezhong on #768 whether they still plan a PR. ## Verification and closure From 4b85a06a74e3d15c5fc9f15964bf6ae57f5d6479 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Fri, 27 Nov 2026 18:23:52 +0100 Subject: [PATCH 03/52] docs: preserve accepted accessibility decisions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../features/accessibility/README.md | 3 +- .../features/accessibility/decisions.md | 146 ++++++++++++++++++ 2 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 docs/ai-and-plans/features/accessibility/decisions.md diff --git a/docs/ai-and-plans/features/accessibility/README.md b/docs/ai-and-plans/features/accessibility/README.md index 00aefef9f..5c2a92d64 100644 --- a/docs/ai-and-plans/features/accessibility/README.md +++ b/docs/ai-and-plans/features/accessibility/README.md @@ -20,7 +20,8 @@ that merge. After the grid update lands, reassess the parked reports against the updated implementation before making additional changes. The plan for work items 3-6 is in -[iterations/01-plan-work-items-3-6.md](./iterations/01-plan-work-items-3-6.md). +[iterations/01-plan-work-items-3-6.md](./iterations/01-plan-work-items-3-6.md); the +operator's decisions are in [decisions.md](./decisions.md). The grid update is documented under [data-grid](../data-grid/README.md). The two VS Code-owned reports remain a separate upstream-tracking bucket, not presumed fixes diff --git a/docs/ai-and-plans/features/accessibility/decisions.md b/docs/ai-and-plans/features/accessibility/decisions.md new file mode 100644 index 000000000..c1683f95c --- /dev/null +++ b/docs/ai-and-plans/features/accessibility/decisions.md @@ -0,0 +1,146 @@ +--- +feature: accessibility +kind: decisions +status: active +created: 2026-11-27 +--- + +# Accessibility — Decisions + +> The decisions that shape the accessibility work items, and what was rejected on the way. + +| # | Decision | Status | Changed from the proposal? | Date | PR | +| ---- | ------------------------------------------------------------------------- | -------- | ----------------------------------------------------------- | ---------- | --- | +| 0001 | Park work items 1 and 2 until the grid update lands on `main` | Accepted | Recorded in the README before this file existed | 2026-11-27 | — | +| 0002 | Playground actions use standard VS Code surfaces, no new keybindings | Accepted | Confirms the 3a recommendation; makes "no keybindings" firm | 2026-11-27 | — | +| 0003 | Playground editor-title layout and Connect follow the recommendations | Accepted | Accepted as proposed (3b, 3c) | 2026-11-27 | — | +| 0004 | After a run, focus moves to the result only in screen-reader mode | Accepted | Picks option B for `auto`; rejects C' as the default | 2026-11-27 | — | +| 0005 | A dedicated Accessibility page in the user manual | Accepted | New; not in the plan | 2026-11-27 | — | +| 0006 | Work items 4-6 and #768 proceed as recommended in the plan | Accepted | Accepted as proposed | 2026-11-27 | — | + +> Entries below are **semantically** immutable: append new entries rather than +> rewriting old ones, and record reversals as a new entry plus a status change +> above. Editing for typos, broken links, or added verification metadata is fine. +> Heading text is frozen once written — a retitle means a new decision. + +## 0001 — Park work items 1 and 2 until the grid update lands on `main` + +**Decision.** Collection grid/tree keyboard interaction (#383, #775, #776) and the +visual-contrast pass (#382, #771, the table symptom of #778) wait for the grid update +([data-grid](../data-grid/README.md)). After it lands, reassess the reports against the +new implementation before changing anything. + +**Why.** Fixing the current grid would be thrown away by the update. Recorded here so the +sequencing in the [README](./README.md) has a decision entry. + +## 0002 — Playground actions use standard VS Code surfaces, no new keybindings + +**Context.** #773: Connect, Shell and Collection View exist only as CodeLens items, which +are not in the Tab order. See +[01-plan-work-items-3-6.md §3.1-3.2](./iterations/01-plan-work-items-3-6.md). + +**Decision.** CodeLens stays for mouse users. Every CodeLens action is also a regular +command, offered on: + +- the Command Palette, while a playground is the active editor; +- the editor title toolbar (layout in 0003); +- the editor context menu, acting on the block at the cursor; +- the header comment of new playgrounds, which names these entry points. + +**No new default keybindings.** The two existing ones stay unchanged: +`Ctrl+Enter` (Run block) and `Ctrl+Shift+Enter` (Run All), `Cmd` on macOS. Shell, +Collection View, Connect and the new focus commands from 0004 get no default shortcut; +users can bind them themselves. + +**Clarification for 0004.** 0004 adds a second contribution of the **same** two +shortcuts, active only in screen-reader-optimized mode, that passes an argument to the +same commands. This adds no new key combination, so it does not conflict with this +decision. + +**Rejected.** Default keybindings for Shell and Collection View: risk of conflicts with +user and other extensions' bindings, for little gain over the palette and context menu. +VS Code's "Show CodeLens Commands for Current Line" as the answer: it only lists lenses on +the cursor's line and has no default keybinding. + +## 0003 — Playground editor-title layout and Connect follow the recommendations + +**Decision.** As proposed in the plan (§3.2, decisions 3b and 3c): + +- Inline in the editor title: **Run All** and **Connect / Change Connection**. +- In the overflow menu ("…") and the context menu: **Run Block**, **Open Block in + Shell**, **Open Block in Collection View**. +- One title action per connection state (Connect when disconnected, the connection + info and switch action when connected), matching CodeLens and the status bar. + +## 0004 — After a run, focus moves to the result only in screen-reader mode + +**Context.** #774 accepts either moving focus to the new result tab or notifying the +user. Moving focus for everyone breaks the edit-run loop, because the run shortcuts only +work while the playground editor has focus. See +[01-plan-work-items-3-6.md §3.3](./iterations/01-plan-work-items-3-6.md). + +**Decision.** Option B, through one setting, `documentDB.playground.afterRun`: + +| Value | Run started in screen-reader mode | Any other run | +| --- | --- | --- | +| `auto` (default) | Move focus to the result | Stay in the playground (today's behavior) | +| `stay` | Stay | Stay | +| `focusResult` | Move focus to the result | Move focus to the result | +| `notify` | Stay and show a completion notification with **Focus Result** | Same | + +- "Run started in screen-reader mode" means the run came from the `Ctrl+Enter` or + `Ctrl+Shift+Enter` contribution gated on screen-reader-optimized mode (see 0002). +- An explicit value overrides the screen-reader default for every run and entry point. +- Each run produces exactly one outcome. Errors keep today's error notification. +- "Focus Query Playground Result" and "Focus Query Playground" commands are added under + every value, without default keybindings (0002). +- The behavior and the setting must be documented (0005). + +**Rejected.** + +- A, always moving focus: breaks the edit-run loop for everyone. +- C', announcing instead of moving focus in screen-reader mode: #774's primary + expectation is a focus move, and the announcement path is still available through + `notify`. +- D, a setting with an unchanged default: default behavior would still fail #774. + +**Still open.** Confirm with "Developer: Inspect Context Keys" that the context key is +`accessibilityModeEnabled`. Ask on #774 which configuration the testers verify with. If +they test keyboard-only without screen-reader mode, the plan's first-run notification +fallback for `auto` needs a new decision. + +## 0005 — A dedicated Accessibility page in the user manual + +**Decision.** Add `docs/user-manual/accessibility.md` as a top-level User Manual page. +It collects the accessibility behavior and settings that are currently scattered or +undocumented, starting with: + +- Query Playground: keyboard access to every action (0002, 0003) and the `afterRun` + setting with its screen-reader default (0004). +- Interactive Shell: `documentDB.shell.display.colorSupport` for plain output; clickable + links are underlined even with colors off, so they never rely on color alone + ([interactive-shell iteration 11](../interactive-shell/iterations/11-visible-underline-shell-links.md)). +- Tree views: `documentDB.accessibility.hideCountPrefix`. +- Other settings and behavior related to accessibility, gathered when the page is + written. + +Feature pages, such as Query Playground and Interactive Shell, link to it rather than +repeating it. The page ships with or after the first fix it documents; it describes +only behavior that has shipped. + +**Why.** The operator wants one place where users of assistive technology can find what +the extension offers. + +## 0006 — Work items 4-6 and #768 proceed as recommended in the plan + +**Decision.** Accepted as proposed in +[01-plan-work-items-3-6.md](./iterations/01-plan-work-items-3-6.md): + +- Order: 5 (#768), 6 (#772), 4 (#769, #770), 3 (#773, #774). One PR per work item by + default. +- #768: ask @Jacquelinezhong on the issue whether they still plan a PR before taking the + fix; set `accessibilityInformation` on the Documents item; re-check Indexes. +- #772: announce with the existing `Announcer`; keep focus with `disabledFocusable`. +- #770: a shared helper that focuses an element with a visible indicator. +- #769: reproduce first; record it under upstream tracking if the F6 target belongs to + VS Code. From b921dceaacb1df14d909fe5b6a548443e8ee1cd9 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Fri, 27 Nov 2026 18:39:19 +0100 Subject: [PATCH 04/52] docs: record accessibility dispatch and operator decisions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../features/accessibility/decisions.md | 29 +++++++++++++++ .../iterations/01-plan-work-items-3-6.md | 37 +++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/docs/ai-and-plans/features/accessibility/decisions.md b/docs/ai-and-plans/features/accessibility/decisions.md index c1683f95c..cb8831231 100644 --- a/docs/ai-and-plans/features/accessibility/decisions.md +++ b/docs/ai-and-plans/features/accessibility/decisions.md @@ -17,6 +17,8 @@ created: 2026-11-27 | 0004 | After a run, focus moves to the result only in screen-reader mode | Accepted | Picks option B for `auto`; rejects C' as the default | 2026-11-27 | — | | 0005 | A dedicated Accessibility page in the user manual | Accepted | New; not in the plan | 2026-11-27 | — | | 0006 | Work items 4-6 and #768 proceed as recommended in the plan | Accepted | Accepted as proposed | 2026-11-27 | — | +| 0007 | Playground telemetry groups indistinguishable invocation surfaces | Accepted | Amends the plan's five-surface attribution requirement | 2026-11-27 | — | +| 0008 | Declare keyborg directly for the Document focus helper | Accepted | Rejects relying on the transitive dependency | 2026-11-27 | — | > Entries below are **semantically** immutable: append new entries rather than > rewriting old ones, and record reversals as a new entry plus a status change @@ -144,3 +146,30 @@ the extension offers. - #770: a shared helper that focuses an element with a visible indicator. - #769: reproduce first; record it under upstream tracking if the F6 target belongs to VS Code. + +## 0007 — Playground telemetry groups indistinguishable invocation surfaces + +**Decision.** During `/lead` implementation on 2026-11-27, the operator approved +"honest grouped values (CodeLens, editor menu, screen-reader shortcut, other)" and +approved recording the decision. Use bounded attribution rather than infer whether +indistinguishable arguments came from the editor title, context menu, palette or +ordinary shortcut. Preserve the existing `playgroundCodeLens` value. + +**Reason for the proposal.** The Opus advisor found that VS Code passes the same +argument shapes for some entry points. Grouping avoids reporting an unobserved +surface as fact. This amends the separate-surface requirement in the plan's +section 3.2; it does not change command availability or user behavior. + +**Rejected alternative.** Add distinct command entry points solely to identify all +five surfaces. The operator selected grouped attribution instead. + +## 0008 — Declare keyborg directly for the Document focus helper + +**Decision.** During `/lead` implementation on 2026-11-27, the operator selected +"Declare keyborg as a direct dependency" rather than import the installed +transitive dependency without declaring it. + +**Additional instruction.** Inspect `vscode-cosmosdb` for potential focus-helper +ideas, not as best practice. Any relevant idea must still fit this extension's +Fluent UI behavior and the accepted scope; inspection alone does not approve +adopting another implementation. diff --git a/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md b/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md index d7645ad24..b2ae62a73 100644 --- a/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md +++ b/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md @@ -28,6 +28,17 @@ before relying on them. One PR per work item keeps each fix independently verifiable by the TCS/C+AI testers, who close the issues. Items 5 and 6 are small enough to share a PR if preferred. +**Implementation dispatch (2026-11-27).** The operator requested implementation +on this branch and allowed bundling simple work. Opus (`claude-opus-5.5`) is the +read-only advisor. Its coding recommendations and actual assignments are +`mai-code-2` for 5, 6, the Playground foundation (3a-3c), the header and manual +documentation (3e, 7), and Document initial focus (4a); `gpt-6.1-sol` for the +Playground result lifecycle (3d). The setting/keybindings and result lifecycle +stay together so their commit builds without a placeholder API. Lightweight +coordination, exploration and checks use `mai-code-2-flash`. Document workbench +verification (4b) is last. These splits do not add accepted scope; work items +1 and 2 remain parked. + ## 5. Explorer tree accessible names (#768) **Finding.** `DocumentsItem.getTreeItem()` sets a static string tooltip, @@ -56,6 +67,12 @@ label. Optionally a small guard test over tree items that use a plain-string too **Before starting.** @Jacquelinezhong volunteered on the issue and no PR exists (checked 2026-11-27). Ask on #768 whether they still plan to submit it. +**Coordination (2026-11-27).** The required question was +[posted](https://github.com/microsoft/vscode-documentdb/issues/768#issuecomment-7224367147) +before implementation. The accepted prerequisite is to ask, not to require a +reply. Indexes still needs a real Accessibility Insights check; a unit assertion +is not that verification. + ## 6. Index-creation completion announcement (#772) **Finding.** `ImprovementCard` renders success and error `MessageBar`s conditionally @@ -124,6 +141,13 @@ hidden element such as Monaco's aria container or a Fluent portal. this). A browser scenario for the Document view can assert the initial `document.activeElement` and the focus-visible state. +**Operator test gates (2026-11-27).** The operator explicitly left workbench +checks pending. Before any #769 fix, capture `document.activeElement.outerHTML` +and `document.hasFocus()` after F6 in Webview DevTools and compare Markdown +preview. Do not infer upstream ownership or add a speculative redirect. +Initial Save focus-ring verification also remains pending. The operator chose +a direct keyborg dependency for the accepted focus helper (decision 0008). + ## 3. Query Playground keyboard workflow (#773, #774) The two issues describe one workflow: connect, write a query, run it, read the result, @@ -182,6 +206,12 @@ Required groundwork, independent of the decisions below: - Record `activationSource` per surface (`codeLens`, `editorTitle`, `editorContext`, `commandPalette`, `keybinding`) so we can see which surfaces people use. +**Amendment (2026-11-27).** The operator approved honest grouped attribution +instead of guessing indistinguishable VS Code invocation surfaces; see +[decision 0007](../decisions.md#0007--playground-telemetry-groups-indistinguishable-invocation-surfaces). +The coding interface uses bounded CodeLens, editor-menu, screen-reader-shortcut +and other buckets, preserving existing CodeLens telemetry. + **Decision 3a: which surfaces to add.** **Decided 2026-11-27 ([decisions 0002](../decisions.md#0002--playground-actions-use-standard-vs-code-surfaces-no-new-keybindings)):** palette, editor title, context menu and header comment; no new default keybindings. @@ -346,6 +376,13 @@ All decisions from this plan are recorded in [decisions.md](../decisions.md) the first-run notification fallback for `auto` needs a new decision. 3. Ask @Jacquelinezhong on #768 whether they still plan a PR. +**Coordination update (2026-11-27).** Questions 2 and 3 were posted on +[#774](https://github.com/microsoft/vscode-documentdb/issues/774#issuecomment-7224367128) +and [#768](https://github.com/microsoft/vscode-documentdb/issues/768#issuecomment-7224367147). +Replies are pending. The accepted `auto` behavior is unchanged; a keyboard-only +fallback still requires a new operator decision. Context-key and shortcut-args +inspection remains an operator workbench gate before review handoff. + ## Verification and closure Each PR follows Case 1 while in draft and Case 2 when handed over. No fix is claimed From 04affdf7aa3c0d820713127ac81daf53b97f95f3 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Fri, 27 Nov 2026 18:44:16 +0100 Subject: [PATCH 05/52] fix: WI-5 include Documents in its accessible tree name Refs #768. Preserve the hover tooltip and guard the existing Indexes label. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/tree/documentdb/DocumentsItem.test.ts | 62 +++++++++++++++++++++++ src/tree/documentdb/DocumentsItem.ts | 1 + src/tree/documentdb/IndexesItem.test.ts | 7 +++ 3 files changed, 70 insertions(+) create mode 100644 src/tree/documentdb/DocumentsItem.test.ts diff --git a/src/tree/documentdb/DocumentsItem.test.ts b/src/tree/documentdb/DocumentsItem.test.ts new file mode 100644 index 000000000..d63324153 --- /dev/null +++ b/src/tree/documentdb/DocumentsItem.test.ts @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { describe, expect, it, vi } from 'vitest'; + +import { type CollectionItemModel, type DatabaseItemModel } from '../../documentdb/ClustersClient'; +import { DocumentDBExperience } from '../../DocumentDBExperiences'; +import { type BaseClusterModel, type TreeCluster } from '../models/BaseClusterModel'; +import { type CollectionItem } from './CollectionItem'; +import { DocumentsItem } from './DocumentsItem'; + +vi.mock('@microsoft/vscode-azext-utils', () => ({ + createContextValue: (values: string[]) => values.join(';'), +})); + +vi.mock('@vscode/l10n', () => ({ + t: (message: string): string => message, +})); + +vi.mock('vscode', () => ({ + ThemeIcon: class ThemeIcon { + constructor(public readonly id: string) {} + }, +})); + +const cluster = { + treeId: 'cluster-tree-id', + clusterId: 'cluster-id', + name: 'Cluster', + viewId: 'connectionsView', + dbExperience: DocumentDBExperience, +} as TreeCluster; +const databaseInfo: DatabaseItemModel = { name: 'database' }; +const collectionInfo: CollectionItemModel = { name: 'collection' }; +const parentCollectionNode = {} as CollectionItem; + +describe('DocumentsItem accessibility', () => { + it('includes the visible label in its accessible name', () => { + const treeItem = new DocumentsItem( + cluster, + databaseInfo, + collectionInfo, + parentCollectionNode, + ).getTreeItem(); + + expect(treeItem.label).toBe('Documents'); + expect(treeItem.accessibilityInformation?.label).toContain(treeItem.label as string); + }); + + it('retains the hover tooltip', () => { + const treeItem = new DocumentsItem( + cluster, + databaseInfo, + collectionInfo, + parentCollectionNode, + ).getTreeItem(); + + expect(treeItem.tooltip).toBe('Click to open the collection view'); + }); +}); diff --git a/src/tree/documentdb/DocumentsItem.ts b/src/tree/documentdb/DocumentsItem.ts index 56166182f..58eb4dc9b 100644 --- a/src/tree/documentdb/DocumentsItem.ts +++ b/src/tree/documentdb/DocumentsItem.ts @@ -53,6 +53,7 @@ export class DocumentsItem implements TreeElement, TreeElementWithExperience, Tr id: this.id, contextValue: this.contextValue, label: l10n.t('Documents'), + accessibilityInformation: { label: l10n.t('Documents') }, tooltip: l10n.t('Click to open the collection view'), command: { title: l10n.t('Open Collection'), // unused, but required by TreeItem diff --git a/src/tree/documentdb/IndexesItem.test.ts b/src/tree/documentdb/IndexesItem.test.ts index 350f0625a..10975db16 100644 --- a/src/tree/documentdb/IndexesItem.test.ts +++ b/src/tree/documentdb/IndexesItem.test.ts @@ -131,6 +131,13 @@ describe('IndexesItem - async index loading', () => { return new Promise((resolve) => setImmediate(resolve)); } + it('uses the visible Indexes label without a plain-string tooltip', () => { + const treeItem = new IndexesItem(cluster, databaseInfo, collectionInfo).getTreeItem(); + + expect(treeItem.label).toBe('Indexes'); + expect(treeItem.tooltip).toBeUndefined(); + }); + it('loadIndexCount fetches indexes once and exposes the count via description', async () => { const item = new IndexesItem(cluster, databaseInfo, collectionInfo); From 203227475c46b19d8f7b325b8534547fbad426e2 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Fri, 27 Nov 2026 18:44:41 +0100 Subject: [PATCH 06/52] docs: record WI-5 implementation and verification gates Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../features/accessibility/README.md | 20 ++++++++++--------- .../iterations/01-plan-work-items-3-6.md | 18 +++++++++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/docs/ai-and-plans/features/accessibility/README.md b/docs/ai-and-plans/features/accessibility/README.md index 5c2a92d64..4a1292b17 100644 --- a/docs/ai-and-plans/features/accessibility/README.md +++ b/docs/ai-and-plans/features/accessibility/README.md @@ -8,9 +8,9 @@ created: 2026-11-27 # Accessibility work items Issue-based grouping of all **13 open issues labelled `a11y`** as of 2026-11-27. -The issue bodies and comments were read; the codebase was not inspected to establish -current behavior or root causes. "Available" means available to start, not implemented -or verified. +The initial grouping came from issue bodies and comments, not a code inspection. +Implementation and verification progress are recorded below and inline in the +work-item plan. "Available" means available to start, not implemented or verified. ## Scope and sequencing @@ -75,8 +75,9 @@ a shared implementation root cause. - Make newly opened query results discoverable through focus movement **or notification**, as #774 permits. -Treat these as an editor-to-results workflow. @tnaum-ms identifies the CodeLens -approach as the concern in #773; no replacement approach has been selected here. +Treat these as an editor-to-results workflow. The accepted approach keeps CodeLens +and adds standard palette/title/context commands, with the `afterRun` setting for +result focus (decisions 0002-0004). ### 4. New Document focus management @@ -91,7 +92,7 @@ approach as the concern in #773; no replacement approach has been selected here. ### 5. Explorer tree accessible names -**Status:** available now. +**Status:** implemented in `04affdf7`; focused tests passed; workbench verification pending. **Issue:** [#768](https://github.com/microsoft/vscode-documentdb/issues/768). Accessible names must include the visible "Documents" label. @Jacquelinezhong's @@ -124,6 +125,7 @@ under work item 2 rather than assuming an upstream Quick Pick fix covers it. ## Verification and closure -This document records grouping and sequencing only; no fix or accessibility -verification is claimed. The reports that reserve closure for TCS/C+AI accessibility -testers must remain open until those testers verify the fixes. +Implementation commits and automated checks are recorded in the work-item plan. +They do not establish what a real screen reader announces or how the installed +workbench handles focus. Reports that reserve closure for TCS/C+AI accessibility +testers remain open until those testers verify the fixes. diff --git a/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md b/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md index b2ae62a73..29a3efc97 100644 --- a/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md +++ b/docs/ai-and-plans/features/accessibility/iterations/01-plan-work-items-3-6.md @@ -73,6 +73,16 @@ before implementation. The accepted prerequisite is to ask, not to require a reply. Indexes still needs a real Accessibility Insights check; a unit assertion is not that verification. +> **Done (2026-11-27), commit `04affdf7`:** `mai-code-2` added the explicit +> Documents accessible label while preserving the tooltip, plus two Documents +> tests and one Indexes guard. Naming follows the operator's accepted 0006 +> decision; the leader approved the one-line implementation at 99% confidence +> because it directly supplies VS Code's supported accessibility label. +> The leader requested reuse of the existing Indexes test fixture instead of a +> new double cast; no existing behavior assertions were weakened. The focused +> Documents/Indexes run passed all 16 tests. Case 1 batch build and real +> Accessibility Insights verification remain pending; the issue stays open. + ## 6. Index-creation completion announcement (#772) **Finding.** `ImprovementCard` renders success and error `MessageBar`s conditionally @@ -148,6 +158,14 @@ preview. Do not infer upstream ownership or add a speculative redirect. Initial Save focus-ring verification also remains pending. The operator chose a direct keyborg dependency for the accepted focus helper (decision 0008). +**Helper-idea inspection (2026-11-27).** At the operator's request, a read-only +`mai-code-2-flash` agent inspected public `microsoft/vscode-cosmosdb`. Its +[Monaco wrapper](https://github.com/microsoft/vscode-cosmosdb/blob/main/src/webviews/MonacoEditor.tsx#L139-L151) +has an invisible focus-trap bumper and uses `useUncontrolledFocus`; the inspected +Document panel had no explicit initial-focus or F6 handling. This is a candidate +to identify during the F6 reproduction, not evidence of the root cause or a +recommended implementation. No bumper or focus-trap change is authorized here. + ## 3. Query Playground keyboard workflow (#773, #774) The two issues describe one workflow: connect, write a query, run it, read the result, From 91dd07c4002fdad7a9c2400812725c604341f876 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Fri, 27 Nov 2026 18:46:10 +0100 Subject: [PATCH 07/52] fix: WI-6 announce optimization outcomes without losing focus Refs #772. Use persistent success/error live regions for both actions and preserve focus while disabled. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ImprovementCard.test.tsx | 191 ++++++++++++++++++ .../optimizationCards/ImprovementCard.tsx | 24 ++- 2 files changed, 213 insertions(+), 2 deletions(-) create mode 100644 src/webviews/documentdb/collectionView/queryInsightsTab/components/optimizationCards/ImprovementCard.test.tsx diff --git a/src/webviews/documentdb/collectionView/queryInsightsTab/components/optimizationCards/ImprovementCard.test.tsx b/src/webviews/documentdb/collectionView/queryInsightsTab/components/optimizationCards/ImprovementCard.test.tsx new file mode 100644 index 000000000..24ba01ef8 --- /dev/null +++ b/src/webviews/documentdb/collectionView/queryInsightsTab/components/optimizationCards/ImprovementCard.test.tsx @@ -0,0 +1,191 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +// @vitest-environment jsdom + +import { act } from 'react'; +import { createRoot, type Root } from 'react-dom/client'; // eslint-disable-line import/no-internal-modules +import { afterEach, describe, expect, it, vi } from 'vitest'; + +import { type ImprovementCard as ImprovementCardConfig } from '../../../types/queryInsights'; +import { ImprovementCard } from './ImprovementCard'; + +vi.mock('@vscode/l10n', () => ({ + t: (message: string, ...args: unknown[]): string => + args.reduce((result, arg, index) => result.replace(`{${index}}`, String(arg)), message), +})); + +(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true; + +interface ActionResult { + success: boolean; + message?: string; +} + +interface Deferred { + promise: Promise; + resolve: (result: ActionResult) => void; +} + +const mounted: { host: HTMLElement; root: Root }[] = []; + +function deferred(): Deferred { + let resolve: (result: ActionResult) => void = () => undefined; + const promise = new Promise((resolvePromise) => { + resolve = resolvePromise; + }); + return { promise, resolve }; +} + +async function renderCard( + primaryAction?: (actionId: string, payload: unknown) => Promise, + secondaryAction?: (actionId: string, payload: unknown) => Promise, +): Promise { + const config: ImprovementCardConfig = { + type: 'improvement', + cardId: 'card-1', + title: 'Create an index', + priority: 'high', + description: 'An index can improve this query.', + recommendedIndex: '{ field: 1 }', + indexName: 'field_1', + recommendedIndexDetails: 'Indexes the field in ascending order.', + details: 'Check the index build cost.', + shellCommand: 'db.collection.createIndex({ field: 1 })', + primaryButton: { + label: 'Primary action', + actionId: 'primaryAction', + payload: { source: 'primary' }, + }, + secondaryButton: { + label: 'Secondary action', + actionId: 'secondaryAction', + payload: { source: 'secondary' }, + }, + }; + const host = document.createElement('div'); + document.body.appendChild(host); + const root = createRoot(host); + mounted.push({ host, root }); + await act(async () => { + root.render( + , + ); + }); + return host; +} + +function buttonWithLabel(host: HTMLElement, label: string): HTMLButtonElement { + const button = Array.from(host.querySelectorAll('button')).find( + (candidate) => candidate.textContent?.trim() === label, + ); + if (!button) { + throw new Error(`Missing button: ${label}`); + } + return button; +} + +afterEach(async () => { + for (const { host, root } of mounted.splice(0)) { + await act(async () => root.unmount()); + host.remove(); + } + vi.useRealTimers(); + vi.restoreAllMocks(); +}); + +describe('ImprovementCard action announcements', () => { + it.each(['primary', 'secondary'] as const)( + 'keeps focus and announces %s success without allowing duplicate clicks', + async (actionKind) => { + vi.useFakeTimers(); + const pending = deferred(); + const action = vi.fn((_actionId: string, _payload: unknown) => pending.promise); + const host = + actionKind === 'primary' + ? await renderCard(action) + : await renderCard(undefined, action); + const regions = Array.from(host.querySelectorAll('[role="status"]')); + const politeRegions = Array.from(host.querySelectorAll('[aria-live="polite"]')); + const successRegion = politeRegions[actionKind === 'primary' ? 0 : 1]; + const button = buttonWithLabel(host, actionKind === 'primary' ? 'Primary action' : 'Secondary action'); + + expect(regions).toHaveLength(4); + expect(regions.every((region) => region.textContent === '')).toBe(true); + button.focus(); + + await act(async () => button.click()); + expect(button.getAttribute('aria-disabled')).toBe('true'); + expect(button.hasAttribute('disabled')).toBe(false); + expect(document.activeElement).toBe(button); + + await act(async () => button.click()); + expect(action).toHaveBeenCalledTimes(1); + + await act(async () => { + pending.resolve({ success: true, message: `${actionKind} completed` }); + await pending.promise; + }); + expect(document.activeElement).toBe(button); + + await act(async () => vi.advanceTimersByTimeAsync(100)); + const currentSuccessRegion = Array.from( + host.querySelectorAll('[aria-live="polite"]'), + )[actionKind === 'primary' ? 0 : 1]; + expect(currentSuccessRegion).toBe(successRegion); + expect(successRegion.textContent).toBe(`${actionKind} completed`); + expect(document.activeElement).toBe(button); + + await act(async () => button.click()); + expect(action).toHaveBeenCalledTimes(1); + }, + ); + + it.each(['primary', 'secondary'] as const)( + 'announces repeated %s failures as assertive retry messages', + async (actionKind) => { + vi.useFakeTimers(); + const first = deferred(); + const second = deferred(); + const action = vi + .fn((_actionId: string, _payload: unknown) => first.promise) + .mockReturnValueOnce(first.promise) + .mockReturnValueOnce(second.promise); + const host = + actionKind === 'primary' + ? await renderCard(action) + : await renderCard(undefined, action); + const errorRegion = Array.from(host.querySelectorAll('[aria-live="assertive"]'))[ + actionKind === 'primary' ? 0 : 1 + ]; + const button = buttonWithLabel(host, actionKind === 'primary' ? 'Primary action' : 'Secondary action'); + + await act(async () => button.click()); + await act(async () => { + first.resolve({ success: false, message: 'Try again' }); + await first.promise; + }); + await act(async () => vi.advanceTimersByTimeAsync(100)); + expect(errorRegion.textContent).toBe('Error: Try again'); + expect(button.textContent?.trim()).toBe('Retry'); + + await act(async () => button.click()); + await act(async () => vi.advanceTimersByTimeAsync(0)); + expect(errorRegion.textContent).toBe(''); + + await act(async () => { + second.resolve({ success: false, message: 'Try again' }); + await second.promise; + }); + await act(async () => vi.advanceTimersByTimeAsync(100)); + expect(errorRegion.textContent).toBe('Error: Try again'); + expect(action).toHaveBeenCalledTimes(2); + }, + ); +}); diff --git a/src/webviews/documentdb/collectionView/queryInsightsTab/components/optimizationCards/ImprovementCard.tsx b/src/webviews/documentdb/collectionView/queryInsightsTab/components/optimizationCards/ImprovementCard.tsx index 09e00e8d6..f617a09f9 100644 --- a/src/webviews/documentdb/collectionView/queryInsightsTab/components/optimizationCards/ImprovementCard.tsx +++ b/src/webviews/documentdb/collectionView/queryInsightsTab/components/optimizationCards/ImprovementCard.tsx @@ -21,6 +21,7 @@ import { ArrowTrendingSparkleRegular } from '@fluentui/react-icons'; // import { CopyRegular } from '@fluentui/react-icons'; import * as l10n from '@vscode/l10n'; import { useState } from 'react'; +import { Announcer } from '../../../../../components/accessibility'; import { type ImprovementCard as ImprovementCardConfig } from '../../../types/queryInsights'; import './baseOptimizationCard.scss'; @@ -277,13 +278,32 @@ export function ImprovementCard({ )} + + + + + {/* Action Buttons */}
{config.primaryButton && ( +

+ +
+

What the guidelines require

+
+
+ + + WCAG 2.2 SC 1.4.3 · text + + — 4.5:1 + +

+ Normal-size text must reach 4.5:1; only large text gets 3:1. The small + Ab marker and literal { } type glyph are treated as text here, so + use 4.5:1. +

+ + WCAG says not to round before deciding pass/fail; the matrix compares full precision and + rounds only the displayed ratio. + +
+
+ + + WCAG 2.2 SC 1.4.11 · non-text + + — 3:1 + +

+ Meaningful icons and visual component/state indicators need 3:1 against adjacent colors. + This is the basis for the info icon and focus-indicator target. +

+
+
+ + + WCAG 2.2 SC 2.4.13 · focus appearance (AAA) + + +

+ In addition to 3:1 focused-vs-unfocused contrast on the same pixels, the visible indicator + needs area at least equal to a 2 CSS-pixel perimeter. Width alone does not prove a pass. + Fluent's + createFocusOutlineStyle uses a 2px border with colorStrokeFocus2; + its forced-colors rule uses the system Highlight color, which this page does + not emulate. +

+
+
+
+
+

What the issues and closeout notes asked to verify

+
+
+ #775 · Table focus outline +

+ Original report: about 1.948:1 in Light 2026 and 1.857:1 in Dark 2026; expected at least + 3:1. It suggests a contrasting 2px+ outline or outline plus shadow. +

+ + Closeout asks for the actual keyboard indicator against adjacent colors on header/body cells + and selected rows, pointer away from hover, plus an installed Windows contrast theme. Keep + measured values/screenshots; a keyboard journey or forced-colors emulation alone is not + enough. This is parked until the grid update lands. + +
+
+ #382 · “Ab” marker text +

+ Original report: 2.8479:1 against a 4.5:1 expectation. The request is to retest the actual + type-marker text at 4.5:1, including focused/selected states where relevant. +

+ + The closeout notes that announcing the type does not fix visual contrast; a badge is parked, + and no new tooltip or unique CodeWithScope symbol is needed for this criterion. + +
+
+ #771 · Info and { } glyphs +

+ The info icon indicates tooltip availability and is expected to reach 3:1. The issue also + flags the Table { } icon as a similar symptom. +

+ + Closeout asks to keep both non-text checks (3:1) in Light/Dark 2026 without assuming one + root cause. #382 separately owns the Ab text check at 4.5:1. + +
+
+ #778 · Focused Table-row text symptom +

+ The original issue is primarily the native Connection String Quick Pick (reported around + 3.44:1 Light / 3.20:1 Dark). Separately, it notes focused Table-row text below 4.5:1 in Dark + 2026. +

+ + Closeout keeps the Quick Pick with upstream VS Code (microsoft/vscode#325289) and requests an independent installed-Table retest against the real focused-row + background after the grid update. This row-text symptom is distinct from #775's outline. + +
+
+
+
+

Loading captured themes and branch styles…

+
+

+ Green/red status is accompanied by an explicit ratio and threshold. Single-color focus previews use the + width slider; “two-tone” stays 1px VS Code focusBorder plus 1px Fluent focus2. The query icon and Fluent + focus tokens come from the extension's actual Fluent theme factory. Hover and Windows forced-colors are + not simulated. +

+ + + + diff --git a/docs/ai-and-plans/features/accessibility/theme-captures/probe-extension/extension.js b/docs/ai-and-plans/features/accessibility/theme-captures/probe-extension/extension.js new file mode 100644 index 000000000..a3eca51ef --- /dev/null +++ b/docs/ai-and-plans/features/accessibility/theme-captures/probe-extension/extension.js @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +// Development-only probe. It opens one webview and writes the `--vscode-*` CSS variables that +// VS Code injects into that webview, together with the theme kind and the media-query flags, +// to `$PROBE_OUT/.json`, then writes `.done`. +// It is loaded with `--extensionDevelopmentPath` by `../capture-themes.mjs`; it is never packaged. + +const vscode = require('vscode'); +const fs = require('fs'); +const path = require('path'); + +function html() { + return `

probe

`; +} + +exports.activate = function activate(context) { + const outDir = process.env.PROBE_OUT; + const label = process.env.PROBE_LABEL; + if (!outDir || !label) { + throw new Error('PROBE_OUT and PROBE_LABEL must be set (see capture-themes.mjs).'); + } + + const panel = vscode.window.createWebviewPanel('a11yThemeProbe', 'probe', vscode.ViewColumn.One, { + enableScripts: true, + }); + panel.webview.html = html(); + panel.webview.onDidReceiveMessage((msg) => { + const wb = vscode.workspace.getConfiguration('workbench'); + const win = vscode.workspace.getConfiguration('window'); + const out = { + label, + vscodeVersion: vscode.version, + appName: vscode.env.appName, + configuredTheme: wb.get('colorTheme'), + preferredLight: wb.get('preferredLightColorTheme'), + preferredDark: wb.get('preferredDarkColorTheme'), + activeColorThemeKind: vscode.window.activeColorTheme.kind, + colorCustomizations: wb.inspect('colorCustomizations'), + iconTheme: wb.get('iconTheme'), + autoDetectColorScheme: win.get('autoDetectColorScheme'), + autoDetectHighContrast: win.get('autoDetectHighContrast'), + ...msg, + }; + fs.writeFileSync(path.join(outDir, `${label}.json`), JSON.stringify(out, null, 2)); + fs.writeFileSync(path.join(outDir, `${label}.done`), 'ok'); + }); + context.subscriptions.push(panel); +}; diff --git a/docs/ai-and-plans/features/accessibility/theme-captures/probe-extension/package.json b/docs/ai-and-plans/features/accessibility/theme-captures/probe-extension/package.json new file mode 100644 index 000000000..8067d8397 --- /dev/null +++ b/docs/ai-and-plans/features/accessibility/theme-captures/probe-extension/package.json @@ -0,0 +1,14 @@ +{ + "name": "documentdb-a11y-theme-probe", + "displayName": "DocumentDB a11y theme probe (development only)", + "publisher": "local", + "version": "0.0.1", + "private": true, + "engines": { + "vscode": "^1.100.0" + }, + "main": "./extension.js", + "activationEvents": [ + "onStartupFinished" + ] +} diff --git a/docs/ai-and-plans/features/accessibility/theme-captures/type-marker-proposals.html b/docs/ai-and-plans/features/accessibility/theme-captures/type-marker-proposals.html new file mode 100644 index 000000000..30b47bf81 --- /dev/null +++ b/docs/ai-and-plans/features/accessibility/theme-captures/type-marker-proposals.html @@ -0,0 +1,515 @@ + + + + + + DocumentDB Table type-marker proposals + + + + +
+

Table type-marker proposals

+

+ Covers the Ab marker (#382) and the { } glyph (#771). Both are the same + TypedValueCell span, at font-size: smaller; its opacity was 0.4 and + is 0.8 since decision 0012. Each column below sets its own opacity. + Ratios are calculated from theme definitions (VS Code 1.147.0 captures, no color + customizations) and this branch's real component; they are not measured in an installed VS Code. +

+
+

+ Target: 4.5:1, WCAG 2.2 SC 1.4.3. The marker is small text that tells the user the + value's type, so the large-text and incidental exceptions do not apply. The target holds in every + row state, hover included. +

+

+ Already settled: Table focus ring = Fluent colorStrokeFocus2, 2px. Query Insights info + icon = descriptionForeground. Opacity is composited over the row background before the + ratio is computed. Hover is shown as a static preview. +

+
+
+
+ + + 80% +
+

Updates the “Your value” column and its summary row.

+
+
+

Worst case across all four themes and row states

+
+
+

Loading captured themes…

+

+ Forced colors is not emulated. With any opacity below 1, Windows forced colors still dims the system + text color, as it does today at 40%. +

+
+ + + From 739fe11f3e8cb640431ad122386ff3faf4a24cf3 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 20:35:14 +0100 Subject: [PATCH 28/52] Use Fluent's focus color for the Table focus ring (#775) focusBorder falls to 2.26-3.26:1 against Dark 2026 headers and selected rows, under the 3:1 non-text minimum. Fluent's colorStrokeFocus2 is the color the extension's other Fluent controls already use and stays at 11.97:1 or more in every captured theme. RDG already draws the ring at Fluent's 2px. The mapping stays inside the forced-colors: none block, so forced-colors mode is unchanged. The ring no longer follows a user's focusBorder customization. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../collectionView/components/resultsTab/dataGridTheme.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/webviews/documentdb/collectionView/components/resultsTab/dataGridTheme.scss b/src/webviews/documentdb/collectionView/components/resultsTab/dataGridTheme.scss index 5e5335fde..93d3e3188 100644 --- a/src/webviews/documentdb/collectionView/components/resultsTab/dataGridTheme.scss +++ b/src/webviews/documentdb/collectionView/components/resultsTab/dataGridTheme.scss @@ -90,8 +90,10 @@ --vscode-list-activeSelectionForeground, var(--vscode-list-inactiveSelectionForeground, var(--vscode-editor-foreground)) ); - --rdg-selection-color: var(--vscode-focusBorder); - --rdg-checkbox-focus-color: var(--vscode-focusBorder); + // Fluent's focus color, as on the extension's other Fluent controls. focusBorder is under + // 3:1 on Dark 2026 rows (#775). RDG already draws the ring at Fluent's 2px. + --rdg-selection-color: var(--colorStrokeFocus2, var(--vscode-focusBorder)); + --rdg-checkbox-focus-color: var(--colorStrokeFocus2, var(--vscode-focusBorder)); :is(.disableHighlightOnHover, body.vscode-reduce-motion) & { --rdg-row-hover-background-color: var(--rdg-background-color); From f48c5b770a5ed47ea50df256a039941d3f572780 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 20:35:14 +0100 Subject: [PATCH 29/52] Raise Table type-marker opacity to meet text contrast (#382, #771) At 40% of the row color the Ab and { } markers measured 2.27-3.81:1 against their rows, under the 4.5:1 text minimum. At 80% the weakest case is 5.74:1 (Dark 2026, hovered row). The marker keeps inheriting the row color, so selected rows and theme overrides still apply. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../collectionView/components/resultsTab/TypedValueCell.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/webviews/documentdb/collectionView/components/resultsTab/TypedValueCell.tsx b/src/webviews/documentdb/collectionView/components/resultsTab/TypedValueCell.tsx index b0e6c6b2a..a5db28248 100644 --- a/src/webviews/documentdb/collectionView/components/resultsTab/TypedValueCell.tsx +++ b/src/webviews/documentdb/collectionView/components/resultsTab/TypedValueCell.tsx @@ -59,7 +59,9 @@ const useStyles = makeStyles({ marginInlineStart: 'auto', paddingInlineStart: '3px', fontSize: 'smaller', - opacity: 0.4, + // Inherits the row color, so it follows selection and theme overrides. Below about 0.67 + // the marker drops under 4.5:1 on hovered and selected rows in Dark 2026 (#382, #771). + opacity: 0.8, }, srOnly: { position: 'absolute', From d29f871b49bae15de062b5183b668f25ba103736 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 20:35:14 +0100 Subject: [PATCH 30/52] Draw the Query Insights info glyph in descriptionForeground (#771) The glyph inherited colorNeutralForeground4 at 60% opacity, 2.34:1 on the card in Light 2026, under the 3:1 non-text minimum. Solid descriptionForeground is 5.47:1 or more on the card fill in every captured theme and follows the user's theme. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/vscode-ext-webview-fluentui/CHANGELOG.md | 4 ++++ .../src/components/MetricGrid/MetricCard.tsx | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/vscode-ext-webview-fluentui/CHANGELOG.md b/packages/vscode-ext-webview-fluentui/CHANGELOG.md index a1d1e9cf1..b46cdd980 100644 --- a/packages/vscode-ext-webview-fluentui/CHANGELOG.md +++ b/packages/vscode-ext-webview-fluentui/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- `MetricCard`'s info glyph is now solid `descriptionForeground` instead of the label color at 60% opacity, which fell under the 3:1 non-text contrast minimum in light themes ([#771](https://github.com/microsoft/vscode-documentdb/issues/771)). Outside VS Code it falls back to `colorNeutralForeground4`. + ## 1.3.0 - The `@fluentui/react-components` peer accepts both 9.74.x and 9.75.1 through 9.75.x. diff --git a/packages/vscode-ext-webview-fluentui/src/components/MetricGrid/MetricCard.tsx b/packages/vscode-ext-webview-fluentui/src/components/MetricGrid/MetricCard.tsx index b913a4d98..0cc8c7154 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/MetricGrid/MetricCard.tsx +++ b/packages/vscode-ext-webview-fluentui/src/components/MetricGrid/MetricCard.tsx @@ -40,7 +40,13 @@ const useStyles = makeStyles({ textOverflow: 'ellipsis', }, labelWithGlyph: { display: 'inline-flex', alignItems: 'center' }, - glyph: { fontSize: '12px', opacity: 0.6, marginLeft: '4px' }, + // A solid theme color rather than a faded label color: at 60% opacity the glyph fell under the + // 3:1 non-text contrast minimum in Light themes. + glyph: { + fontSize: '12px', + marginLeft: '4px', + color: `var(--vscode-descriptionForeground, ${tokens.colorNeutralForeground4})`, + }, // The slot is what stops the skeleton to value swap from shifting everything below it, so its // height is reserved rather than derived from the content. value: { From 9e814216d2289a2815563bd07f3d7dce67027c5b Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 20:35:14 +0100 Subject: [PATCH 31/52] Record contrast decisions for #775, #382 and #771 Adds decisions 0010-0012 with the operator's choices and the calculated ratios, and updates the feature status. Installed-workbench verification is still pending. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../features/accessibility/README.md | 26 ++++++-- .../features/accessibility/decisions.md | 64 +++++++++++++++++++ 2 files changed, 84 insertions(+), 6 deletions(-) diff --git a/docs/ai-and-plans/features/accessibility/README.md b/docs/ai-and-plans/features/accessibility/README.md index 50a03ecc0..3592c4929 100644 --- a/docs/ai-and-plans/features/accessibility/README.md +++ b/docs/ai-and-plans/features/accessibility/README.md @@ -42,8 +42,8 @@ Status as of 2026-12-02, based on the branch commits, PR scope and session histo | Item | Issues | Status in #1147 | Remaining work | | --------------------------------- | --------------------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| 1. Grid/tree keyboard interaction | #383, #775, #776 | Parked; not addressed by this PR | Grid update merged; reassess navigation, focus contrast and non-drag resizing against it. | -| 2. Visual contrast | #382, #771, table symptom of #778 | Parked; not addressed by this PR | Grid update merged; reassess the reported grid and Query Insights contrast. | +| 1. Grid/tree keyboard interaction | #383, #775, #776 | #775 focus contrast addressed; #383 and #776 not part of it | Verify the #775 focus ring in the workbench. Grid update merged; reassess navigation and non-drag resizing against it. | +| 2. Visual contrast | #382, #771, table symptom of #778 | Addressed | Verify in the installed workbench in Light 2026, Dark 2026 and both high-contrast themes. | | 3. Playground keyboard workflow | #773, #774 | Addressed | Verify in the installed workbench; confirm tester configuration and whether keyboard-only `auto` needs a further decision. | | 4. New Document focus | #770, #769 | Partially addressed: #770 implemented; #769 not addressed | Verify initial focus in the workbench; reproduce and classify the F6 target before choosing a fix. | | 5. Explorer accessible names | #768 | Addressed for Documents; Indexes guarded | Verify both names with assistive technology; contributor reply remains pending. | @@ -52,7 +52,8 @@ Status as of 2026-12-02, based on the branch commits, PR scope and session histo ### 1. Collection grid/tree keyboard interaction -**Status:** parked in #1147; grid update merged, reassessment pending. +**Status:** #775 addressed by [decision 0010](./decisions.md); workbench verification +pending. #383 and #776 are not part of that change. **Issues:** [#383](https://github.com/microsoft/vscode-documentdb/issues/383), [#775](https://github.com/microsoft/vscode-documentdb/issues/775), [#776](https://github.com/microsoft/vscode-documentdb/issues/776). @@ -70,8 +71,8 @@ still pending. #383 is the severity-1 functionality blocker in the issue reports ### 2. Collection and Query Insights visual contrast -**Status:** parked in #1147, including the Query Insights portion; grid update merged, -reassessment pending. +**Status:** addressed after measuring the merged grid against captured themes +([decisions 0010-0012](./decisions.md)); installed-workbench verification pending. **Issues:** [#382](https://github.com/microsoft/vscode-documentdb/issues/382), [#771](https://github.com/microsoft/vscode-documentdb/issues/771). @@ -84,7 +85,20 @@ reassessment pending. outside extension control. These reports belong together as a visual-contrast pass; the issues do not establish -a shared implementation root cause. +a shared implementation root cause. The first-pass theme captures, collection +recipe and browser comparison page are in +[theme-captures](./theme-captures/README.md); they are evidence inputs, not an +accessibility sign-off or a replacement for installed-workbench verification. + +Outcome, **calculated from theme definitions** (VS Code 1.147.0 Light 2026, Dark 2026, +Default High Contrast and Default High Contrast Light, no color customizations): + +| Element | Change | Weakest case | +| --------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------- | +| Table `Ab` and `{ }` type markers (one `TypedValueCell`) | Opacity 0.4 to 0.8, still the row color | 5.74:1, Dark 2026 hovered row (needs 4.5:1) | +| Query Insights info glyph (`MetricCard`) | `descriptionForeground`, no opacity | 5.47:1, High Contrast Light (needs 3:1) | +| Table cell focus ring (#775) | Fluent `colorStrokeFocus2`, 2px as before | 11.97:1, High Contrast selected cell (needs 3:1) | +| Focused table-row text (#778) | None; focus adds only an outline | 8.12:1, Dark 2026 hovered row (needs 4.5:1) | ### 3. Query Playground keyboard workflow diff --git a/docs/ai-and-plans/features/accessibility/decisions.md b/docs/ai-and-plans/features/accessibility/decisions.md index d251664a5..65e489d3d 100644 --- a/docs/ai-and-plans/features/accessibility/decisions.md +++ b/docs/ai-and-plans/features/accessibility/decisions.md @@ -20,6 +20,9 @@ created: 2026-11-27 | 0007 | Playground telemetry groups indistinguishable invocation surfaces | Accepted | Amends the plan's five-surface attribution requirement | 2026-11-27 | — | | 0008 | Declare keyborg directly for the Document focus helper | Accepted | Rejects relying on the transitive dependency | 2026-11-27 | — | | 0009 | Preserve undefined metadata for truthful completion summaries | Accepted | Preserve rendered text while retaining the existing flag | 2026-11-27 | — | +| 0010 | Table focus ring uses Fluent's focus color at 2px | Accepted | Picks the single Fluent color over a two-tone ring | 2026-12-02 | — | +| 0011 | Query Insights info glyph uses `descriptionForeground` | Accepted | Replaces the faded label color; no opacity | 2026-12-02 | — | +| 0012 | Table type markers at 80% opacity of the row color | Accepted | Picked over solid and `descriptionForeground` | 2026-12-02 | — | > Entries below are **semantically** immutable: append new entries rather than > rewriting old ones, and record reversals as a new entry plus a status change @@ -192,3 +195,64 @@ for completion descriptions. **Alternatives not used.** Inferring absence from null or a missing type can give an incorrect answer. Restoring a different printable value during deserialization would risk changing existing rendered output instead of preserving it. + +## 0010 — Table focus ring uses Fluent's focus color at 2px + +**Context.** #775 asks for a Table focus indicator of at least 3:1 against adjacent +colors (WCAG 2.2 SC 1.4.11). The grid drew a 2px inset outline in `focusBorder`. +Calculated from the VS Code 1.147.0 theme captures in +[theme-captures](./theme-captures/README.md), `focusBorder` gives 2.26-3.26:1 in +Dark 2026 and fails on headers and selected rows. + +**Decision.** The operator asked the cell ring to match "the 'weight' of the fluent focus +ring used already throughout the extension", settled the width with "if fluent is 2px, +we'll go for 2px", and chose "the fluent focus color". `dataGridTheme.scss` sets +`--rdg-selection-color` and `--rdg-checkbox-focus-color` to `colorStrokeFocus2`, with +`focusBorder` as the fallback outside a Fluent provider. RDG's ring was already 2px, the +width of Fluent's `createFocusOutlineStyle`. + +**Calculated result.** At least 12.90:1 in Dark 2026, 15.21:1 in Light 2026 and 11.97:1 +in Default High Contrast (selected cell). Forced-colors mode is unchanged: the mapping +sits inside the existing `forced-colors: none` block. + +**Consequence.** Like the other Fluent controls in the extension, the ring follows the +Fluent theme rather than a user's `focusBorder` customization. + +**Alternatives not used.** A two-tone ring, since one color passes everywhere. Keeping +`focusBorder`, which fails in Dark 2026. + +## 0011 — Query Insights info glyph uses `descriptionForeground` + +**Context.** #771 asks for the Query Insights information icons at 3:1 or more. The +`MetricCard` glyph inherited `colorNeutralForeground4` at 60% opacity: 2.34:1 in Light +2026, calculated. + +**Decision.** The operator chose `descriptionForeground`, with 80% opacity as the fallback +if it failed anywhere. It does not fail, so the glyph is solid +`var(--vscode-descriptionForeground)`, with `colorNeutralForeground4` as the fallback +outside VS Code. The glyph always sits on the card fill (`colorNeutralBackground1`); the +card is not interactive, so it has no hover or selected fill. + +**Calculated result.** 6.29:1 Light 2026, 5.53:1 Dark 2026, 9.96:1 Default High +Contrast, 5.47:1 Default High Contrast Light. + +## 0012 — Table type markers at 80% opacity of the row color + +**Context.** #382 (`Ab`) and #771 (`{ }`) report the same `TypedValueCell` span, which +inherited the row color at 40% opacity. It is text, so it needs 4.5:1; at 40% it failed in +every captured theme and row state (2.27-3.81:1). + +**Decision.** The operator chose 80%, "unless you have a better proposal". +[type-marker-proposals.html](./theme-captures/type-marker-proposals.html) compared the +candidates and none was better, so the span keeps the row color (and with it selected-row +colors and theme overrides) at `opacity: 0.8`. + +**Calculated result.** At least 5.74:1 (Dark 2026, hovered row). The lowest opacity that +passes in every captured theme and row state is about 67%. + +**Alternatives not used.** + +- 70%: passes at 4.75:1, a thin margin for a small glyph. +- `descriptionForeground`: 3.84:1 on a hovered selected row in Dark 2026, because it does + not follow the selection foreground. +- Solid: passes (8.12:1) but no longer reads as secondary to the value. From 7ae981cc9c878aecef5323a055e571496dda9ae7 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 20:38:26 +0100 Subject: [PATCH 32/52] Format accessibility status table Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../features/accessibility/README.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/ai-and-plans/features/accessibility/README.md b/docs/ai-and-plans/features/accessibility/README.md index 3592c4929..bbb4d94b1 100644 --- a/docs/ai-and-plans/features/accessibility/README.md +++ b/docs/ai-and-plans/features/accessibility/README.md @@ -40,15 +40,15 @@ for this branch. Status as of 2026-12-02, based on the branch commits, PR scope and session history. "Addressed in PR" means implemented, **not** verified by accessibility testers. -| Item | Issues | Status in #1147 | Remaining work | -| --------------------------------- | --------------------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| Item | Issues | Status in #1147 | Remaining work | +| --------------------------------- | --------------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | | 1. Grid/tree keyboard interaction | #383, #775, #776 | #775 focus contrast addressed; #383 and #776 not part of it | Verify the #775 focus ring in the workbench. Grid update merged; reassess navigation and non-drag resizing against it. | -| 2. Visual contrast | #382, #771, table symptom of #778 | Addressed | Verify in the installed workbench in Light 2026, Dark 2026 and both high-contrast themes. | -| 3. Playground keyboard workflow | #773, #774 | Addressed | Verify in the installed workbench; confirm tester configuration and whether keyboard-only `auto` needs a further decision. | -| 4. New Document focus | #770, #769 | Partially addressed: #770 implemented; #769 not addressed | Verify initial focus in the workbench; reproduce and classify the F6 target before choosing a fix. | -| 5. Explorer accessible names | #768 | Addressed for Documents; Indexes guarded | Verify both names with assistive technology; contributor reply remains pending. | -| 6. Index-creation announcement | #772 | Addressed | Verify actual screen-reader announcements and focus retention. | -| 7. Accessibility manual | — | Addressed | Keep documentation aligned with the verified behavior. | +| 2. Visual contrast | #382, #771, table symptom of #778 | Addressed | Verify in the installed workbench in Light 2026, Dark 2026 and both high-contrast themes. | +| 3. Playground keyboard workflow | #773, #774 | Addressed | Verify in the installed workbench; confirm tester configuration and whether keyboard-only `auto` needs a further decision. | +| 4. New Document focus | #770, #769 | Partially addressed: #770 implemented; #769 not addressed | Verify initial focus in the workbench; reproduce and classify the F6 target before choosing a fix. | +| 5. Explorer accessible names | #768 | Addressed for Documents; Indexes guarded | Verify both names with assistive technology; contributor reply remains pending. | +| 6. Index-creation announcement | #772 | Addressed | Verify actual screen-reader announcements and focus retention. | +| 7. Accessibility manual | — | Addressed | Keep documentation aligned with the verified behavior. | ### 1. Collection grid/tree keyboard interaction @@ -93,12 +93,12 @@ accessibility sign-off or a replacement for installed-workbench verification. Outcome, **calculated from theme definitions** (VS Code 1.147.0 Light 2026, Dark 2026, Default High Contrast and Default High Contrast Light, no color customizations): -| Element | Change | Weakest case | -| --------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------- | -| Table `Ab` and `{ }` type markers (one `TypedValueCell`) | Opacity 0.4 to 0.8, still the row color | 5.74:1, Dark 2026 hovered row (needs 4.5:1) | -| Query Insights info glyph (`MetricCard`) | `descriptionForeground`, no opacity | 5.47:1, High Contrast Light (needs 3:1) | -| Table cell focus ring (#775) | Fluent `colorStrokeFocus2`, 2px as before | 11.97:1, High Contrast selected cell (needs 3:1) | -| Focused table-row text (#778) | None; focus adds only an outline | 8.12:1, Dark 2026 hovered row (needs 4.5:1) | +| Element | Change | Weakest case | +| -------------------------------------------------------- | ----------------------------------------- | ------------------------------------------------ | +| Table `Ab` and `{ }` type markers (one `TypedValueCell`) | Opacity 0.4 to 0.8, still the row color | 5.74:1, Dark 2026 hovered row (needs 4.5:1) | +| Query Insights info glyph (`MetricCard`) | `descriptionForeground`, no opacity | 5.47:1, High Contrast Light (needs 3:1) | +| Table cell focus ring (#775) | Fluent `colorStrokeFocus2`, 2px as before | 11.97:1, High Contrast selected cell (needs 3:1) | +| Focused table-row text (#778) | None; focus adds only an outline | 8.12:1, Dark 2026 hovered row (needs 4.5:1) | ### 3. Query Playground keyboard workflow From 6848bb90284a55ff2de2d3ec8df3fabcf20f4bdb Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 21:08:22 +0100 Subject: [PATCH 33/52] Draw Query Insights N/A placeholders in descriptionForeground The N/A values in the metric cards, the summary cell and the failed plan summary were drawn in a disabled or tertiary color at 50% opacity. Calculated from the VS Code 1.147.0 theme definitions, that was 1.36:1 to 3.82:1 in Light 2026, Dark 2026 and both high-contrast themes, under the 4.5:1 text minimum. N/A is content, not a disabled control, so the WCAG exemption for inactive components does not apply, and opacity also survives forced-colors mode. Solid descriptionForeground, the color already chosen for the info glyph, gives 5.47:1 to 9.96:1. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/components/MetricGrid/MetricCard.tsx | 4 +++- .../components/queryPlanSummary/QueryPlanSummary.tsx | 3 +-- .../components/summaryCard/SummaryCard.scss | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/vscode-ext-webview-fluentui/src/components/MetricGrid/MetricCard.tsx b/packages/vscode-ext-webview-fluentui/src/components/MetricGrid/MetricCard.tsx index 0cc8c7154..5b3242a76 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/MetricGrid/MetricCard.tsx +++ b/packages/vscode-ext-webview-fluentui/src/components/MetricGrid/MetricCard.tsx @@ -60,7 +60,9 @@ const useStyles = makeStyles({ }, valueLarge: { fontSize: '28px', lineHeight: '32px', minHeight: '32px' }, valueSmall: { fontSize: '14px', lineHeight: '20px', minHeight: '20px' }, - unavailable: { opacity: 0.5, color: tokens.colorNeutralForegroundDisabled }, + // "N/A" is content, not a disabled control, so it needs 4.5:1. The disabled color at half + // opacity fell to about 1.4:1, and opacity also survives forced-colors mode. + unavailable: { color: `var(--vscode-descriptionForeground, ${tokens.colorNeutralForeground3})` }, tooltip: { padding: '8px' }, tooltipTitle: { fontWeight: 600, fontSize: '16px', marginBottom: '12px' }, tooltipBody: { whiteSpace: 'pre-line' }, diff --git a/src/webviews/documentdb/collectionView/queryInsightsTab/components/queryPlanSummary/QueryPlanSummary.tsx b/src/webviews/documentdb/collectionView/queryInsightsTab/components/queryPlanSummary/QueryPlanSummary.tsx index d1222ed6c..f34e8c26a 100644 --- a/src/webviews/documentdb/collectionView/queryInsightsTab/components/queryPlanSummary/QueryPlanSummary.tsx +++ b/src/webviews/documentdb/collectionView/queryInsightsTab/components/queryPlanSummary/QueryPlanSummary.tsx @@ -107,8 +107,7 @@ export const QueryPlanSummary: React.FC = ({ {l10n.t('N/A')} diff --git a/src/webviews/documentdb/collectionView/queryInsightsTab/components/summaryCard/SummaryCard.scss b/src/webviews/documentdb/collectionView/queryInsightsTab/components/summaryCard/SummaryCard.scss index b42a2e269..ab2efc3f3 100644 --- a/src/webviews/documentdb/collectionView/queryInsightsTab/components/summaryCard/SummaryCard.scss +++ b/src/webviews/documentdb/collectionView/queryInsightsTab/components/summaryCard/SummaryCard.scss @@ -34,8 +34,8 @@ } } -// Styling for null value placeholders (N/A, Not Available, etc.) +// Null value placeholders (N/A, Not Available, etc.) are content, not disabled controls, so they +// need 4.5:1: no opacity, and not the disabled color. .nullValue { - opacity: 0.5; - color: var(--vscode-disabledForeground); + color: var(--vscode-descriptionForeground, var(--colorNeutralForeground3)); } From 7def850a599bb0527afd1daa45e9e5c3dd7219c0 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 21:08:23 +0100 Subject: [PATCH 34/52] Draw the index key direction at full badge color The direction in an index field badge (an arrow, or a word such as text, hashed or 2dsphere) was the badge color at 80% on the tinted badge: 3.52:1 in Light 2026 and 3.71:1 in High Contrast Light, under 4.5:1. The badge pair starts at about 5:1, so it has no headroom for opacity. At full color it matches the field name: 4.96:1 to 21:1. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../documentdb/collectionView/indexesTab/indexesTab.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss b/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss index d5e0305ad..36781b1b9 100644 --- a/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss +++ b/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss @@ -352,9 +352,10 @@ font-family: var(--fontFamilyMonospace); } + // Full badge color: the tinted badge leaves no contrast headroom for opacity, and the + // direction is sometimes a word (text, hashed, 2dsphere). .keyBadgeDir { margin-left: 6px; - opacity: 0.8; } // Present-only facts list (definition list). From 98d38161e6460c1fc323b9f44c082b207b82c77a Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 21:08:23 +0100 Subject: [PATCH 35/52] Use Fluent's 2px focus ring on the expand/collapse button The button drew a 1px ring in --vscode-focusBorder, which is semi-transparent in Dark 2026 and fell to 2.79:1 on a hovered Indexes table row (1.76:1 in High Contrast). It now uses colorStrokeFocus2 at strokeWidthThick, the ring already used by the Table and the rest of the extension, falling back to focusBorder outside a Fluent provider. The forced-colors Highlight rule is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/webviews/components/expandCollapseButton.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/webviews/components/expandCollapseButton.scss b/src/webviews/components/expandCollapseButton.scss index f7607ecdf..fbe1276cd 100644 --- a/src/webviews/components/expandCollapseButton.scss +++ b/src/webviews/components/expandCollapseButton.scss @@ -29,9 +29,11 @@ color: var(--colorNeutralForeground3Pressed, currentColor); } + // Fluent's 2px focus ring, as on the rest of the extension. `--vscode-focusBorder` is + // semi-transparent in some themes and fell under 3:1 on a hovered row. &:focus-visible { - outline: 1px solid var(--vscode-focusBorder); - outline-offset: -1px; + outline: var(--strokeWidthThick, 2px) solid var(--colorStrokeFocus2, var(--vscode-focusBorder)); + outline-offset: calc(-1 * var(--strokeWidthThick, 2px)); } .expandCollapseButtonIcon { From 88e281a44e7f124aef1ce5733c720c5890963afe Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 21:27:23 +0100 Subject: [PATCH 36/52] Step up in nested Table results with Backspace Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ai-and-plans/features/data-grid/README.md | 2 + .../ai-and-plans/features/data-grid/design.md | 8 +- docs/user-manual/collection-view-querying.md | 10 +- .../collectionView/CollectionView.test.tsx | 189 +++++++++++++++++- .../collectionView/CollectionView.tsx | 126 ++++++++---- .../resultsTab/DataViewPanelTable.tsx | 38 +++- 6 files changed, 318 insertions(+), 55 deletions(-) diff --git a/docs/ai-and-plans/features/data-grid/README.md b/docs/ai-and-plans/features/data-grid/README.md index d92a5822d..601d628f6 100644 --- a/docs/ai-and-plans/features/data-grid/README.md +++ b/docs/ai-and-plans/features/data-grid/README.md @@ -32,6 +32,8 @@ released extension version or completion of the remaining handover gates. arbitrary-depth document model rather than using RDG's `TreeDataGrid`. - Mouse Back inside a nested Table result steps up one embedded-object level, like Level Up. It does not change result pages; root-level, other views and other mouse buttons are unchanged. +- Plain Backspace on a nested Table cell or header also steps up one level. From a cell, focus + returns to the same document's object cell when available; from a header, it stays on the header row. - Results Tree and Indexes share `ExpandCollapseButton`, a compact Fluent-tree-style rotating chevron. Tree keeps cell-owned keyboard focus; Indexes keeps a normally tabbable button. - Each Tree depth adds Fluent's `spacingHorizontalXXL` (24 px), independent of the font; leaves diff --git a/docs/ai-and-plans/features/data-grid/design.md b/docs/ai-and-plans/features/data-grid/design.md index f96d1558e..95d70cd5b 100644 --- a/docs/ai-and-plans/features/data-grid/design.md +++ b/docs/ai-and-plans/features/data-grid/design.md @@ -64,7 +64,7 @@ the successful response matching the current query, request, and destination pat once, after the Table page is committed, to column 0—the same row's root `_id` cell—using its `rowKey`, not its previous column or numeric index. It does not select the row. -The pending focus restoration is permanently cancelled if focus leaves the initiating results +The pending step-in focus restoration is permanently cancelled if focus leaves the initiating results grid, the query or navigation supersedes the request, the load fails, the row disappears, or the view unmounts. A stale intent cannot fire on a later load. Pointer step-in has no new focus behavior. The handler rejects stale pages, the root `_id` column, `_id` fields, and non-object @@ -77,6 +77,12 @@ the current field path is nested. Capture-phase handling keeps that gesture out mouse handlers; its matching release and auxiliary click are consumed even after reaching root. Other mouse buttons, result paging, other views and input outside the results area are unchanged. +Plain Backspace from a focused cell or column header in a nested Table invokes Level Up once per +press. Key repeats, modified keys, editing, and keys already handled by a popup do not navigate. +On the matching parent page, a cell returns to the exited object on the same row, then falls back +to that row's `_id`, the first row's `_id`, or a header if there are no rows. A header stays in +the header row. Focus is not restored if the user moved it while the page was loading. + Long cell values ellipsize independently of the BSON type indicator; the full value text remains in the DOM, with no additional per-cell Tab stop. For defined values, visually hidden text puts the full BSON type before the value in the focused cell's accessible name, for example diff --git a/docs/user-manual/collection-view-querying.md b/docs/user-manual/collection-view-querying.md index 47d070a0c..0feef05c8 100644 --- a/docs/user-manual/collection-view-querying.md +++ b/docs/user-manual/collection-view-querying.md @@ -243,10 +243,12 @@ This is a significant improvement over earlier versions of the extension, which In **Table View**, focus an object cell and press **Enter**, or double-click the cell, to step into that field. After **Enter**, focus moves to the same document row's `_id` cell, so you can continue -with the arrow keys or press **Space** to select that row. Mouse step-in is unchanged. Use -**Level Up** to return one level, activate an ancestor breadcrumb to jump back to it, or choose -**Root Level** to return to the document root. The help beside the navigation controls describes -these actions. +with the arrow keys or press **Space** to select that row. To return one level, press +**Backspace** on a cell or column header in a nested table, or use **Level Up**. After +**Backspace** from a cell, focus returns to the object cell in the same document if available, +or to another cell in the grid. From a column header, focus stays in the header row. Activate an +ancestor breadcrumb to jump back to it, or choose **Root Level** to return to the document root. +The help beside the navigation controls describes the breadcrumb and Level Up actions. In **Tree View**, focus an expandable **Field** cell and press **Enter** to expand or collapse it. The chevron button beside the field also toggles expansion. New results start collapsed. If a diff --git a/src/webviews/documentdb/collectionView/CollectionView.test.tsx b/src/webviews/documentdb/collectionView/CollectionView.test.tsx index 351275594..f47428f8f 100644 --- a/src/webviews/documentdb/collectionView/CollectionView.test.tsx +++ b/src/webviews/documentdb/collectionView/CollectionView.test.tsx @@ -66,6 +66,7 @@ const nestedPage: TablePage = { }; const boundaries = vi.hoisted(() => ({ + useRealTable: false, latestTableProps: undefined as TableHostProps | undefined, announcerMounts: [] as { readonly message: string; @@ -177,9 +178,13 @@ vi.mock('../../query-language-support', () => ({ setCompletionContext: vi.fn() } vi.mock('@fluentui/react-icons', () => ({ EmojiRegular: (): null => null })); vi.mock('@fluentui/react-components', () => ({ Button: ({ children }: { readonly children?: ReactNode }): React.JSX.Element => , + makeStyles: () => (): Record => ({}), ProgressBar: (): React.JSX.Element =>
, + Skeleton: ({ children }: { readonly children?: ReactNode }): React.JSX.Element =>
{children}
, + SkeletonItem: (): null => null, Tab: ({ children }: { readonly children?: ReactNode }): React.JSX.Element => , TabList: ({ children }: { readonly children?: ReactNode }): React.JSX.Element =>
{children}
, + Tooltip: ({ children }: { readonly children: React.JSX.Element }): React.JSX.Element => children, })); vi.mock('./components/queryEditor/QueryEditor', () => ({ QueryEditor: ({ onExecuteRequest }: { readonly onExecuteRequest: () => void }): React.JSX.Element => ( @@ -188,13 +193,17 @@ vi.mock('./components/queryEditor/QueryEditor', () => ({ ), })); -vi.mock('./components/resultsTab/DataViewPanelTable', async () => { +vi.mock('./components/resultsTab/DataViewPanelTable', async (importOriginal) => { const { useContext } = await import('react'); const { CollectionViewContext: ActualContext } = await import('./collectionViewContext'); + const { DataViewPanelTable } = await importOriginal(); return { - DataViewPanelTable: (props: TableHostProps): React.JSX.Element => { + DataViewPanelTable: (props: Parameters[0]): React.JSX.Element => { boundaries.latestTableProps = props; const [, setContext] = useContext(ActualContext); + if (boundaries.useRealTable) { + return ; + } return (