diff --git a/docs/ai-and-plans/README.md b/docs/ai-and-plans/README.md index 9e0ffeddf..c1618b5ea 100644 --- a/docs/ai-and-plans/README.md +++ b/docs/ai-and-plans/README.md @@ -33,7 +33,7 @@ treat `status: historical` or `status: superseded` as current. | [atlas-discovery](./features/atlas-discovery/README.md) | MongoDB Atlas discovery: Admin API auth, discovery tree, credentials | shipped | | [kubernetes-discovery](./features/kubernetes-discovery/README.md) | Kubernetes service discovery and connect-time reachability providers | shipped | | [webview-ext-package](./features/webview-ext-package/README.md) | `@microsoft/vscode-ext-webview`: the extracted webview transport package | published preview | -| [webview-fluentui-package](./features/webview-fluentui-package/README.md) | `@microsoft/vscode-ext-webview-fluentui`: Fluent theming and reusable components for webviews | 1.3.0 prepared | +| [webview-fluentui-package](./features/webview-fluentui-package/README.md) | `@microsoft/vscode-ext-webview-fluentui`: Fluent theming and reusable components for webviews | 2.0.0 prepared | | [connections-tree](./features/connections-tree/README.md) | The Connections view: node item counts, connection load performance | shipped | | [no-auth](./features/no-auth/README.md) | Credential-free connections and connection-string TLS handling | shipped | | [managed-identities](./features/managed-identities/README.md) | Explicit managed identity authentication from Azure VMs | PR #886 | diff --git a/docs/ai-and-plans/features/data-grid/README.md b/docs/ai-and-plans/features/data-grid/README.md index d92a5822d..fc5343b48 100644 --- a/docs/ai-and-plans/features/data-grid/README.md +++ b/docs/ai-and-plans/features/data-grid/README.md @@ -64,8 +64,10 @@ released extension version or completion of the remaining handover gates. Table arrays retain `array[N]`. Tree containers show direct field/element counts. - Native platform Copy copies the active cell's display text, including a preview, without type decorations. Read-only cells do not offer substring selection; typed copy is future work. -- The hover opt-out setting or effective reduced motion suppresses Table/Tree hover highlights, - retaining focus and selection. A polite Escape hint is frozen once per confirmed grid entry. +- The hover opt-out setting or effective reduced motion suppresses hover-only row/item feedback + in the owned grid, Indexes, dashboard, status-list and Local Quick Start setup-table surfaces, + retaining keyboard feedback and Results selection. A polite Escape hint is frozen once per + confirmed grid entry. The exact VS Code support declaration is `^1.123.0` in the root `package.json` (minimum `1.123.0`). A9's isolated VSIX install and activation on VS Code 1.123.0 passed, but did not diff --git a/docs/ai-and-plans/features/data-grid/decisions.md b/docs/ai-and-plans/features/data-grid/decisions.md index c7a4087ec..149a191f2 100644 --- a/docs/ai-and-plans/features/data-grid/decisions.md +++ b/docs/ai-and-plans/features/data-grid/decisions.md @@ -222,8 +222,10 @@ not the earlier migration gates. - **Item 6 — either preference suppresses hover.** Disable pointer tracking in Table and Tree when the extension opt-out is true **or** reduced motion is enabled. Preserve keyboard focus and selection feedback. The setting is `documentDB.accessibility.disableHighlightOnHover`, default - `false`; the setting description must say reduced motion overrides it. Reuse this rule in - the later rollout to other surfaces. + `false`; the setting description must say reduced motion overrides it. The follow-up rollout + reuses this rule for Collection View Indexes, Cluster Dashboard namespace rows, Connection + Diagnostics check rows and Local Quick Start status and setup-setting rows. Workbench-rendered + surfaces and control/link/tool-tip hover states stay outside its scope. - **Item 7 — keep the Escape hint on entry.** Announce it once per entry to Table or Tree, not on each cell move. With Table rows selected, Escape clears selection before a second press exits. NVDA/Narrator checks verify delivery; they do not reopen the feature decision. diff --git a/docs/ai-and-plans/features/data-grid/design.md b/docs/ai-and-plans/features/data-grid/design.md index f96d1558e..6e903691c 100644 --- a/docs/ai-and-plans/features/data-grid/design.md +++ b/docs/ai-and-plans/features/data-grid/design.md @@ -173,9 +173,31 @@ scrolling, not selection or expansion. Per [decision 0006](./decisions.md#0006---ux-review-sizing-gate-previews-copy-and-hover), either `documentDB.accessibility.disableHighlightOnHover` (default `false`) or effective reduced motion suppresses hover-only row backgrounds and selected-row hover foregrounds. -Focus and selection remain visible. The extension setting applies when Collection View -reopens; VS Code's `body.vscode-reduce-motion` class takes effect live. Other surfaces -are outside this rollout. +Focus and selection remain visible. The extension setting applies when an affected webview +reopens; VS Code's `body.vscode-reduce-motion` class takes effect live. + +### Extension-owned hover inventory + +Pointer presence itself comes from the browser's `:hover` or RDG's row rendering. No view +tracks the mouse in React state. The owning extension component controls the visual feedback, +so every surface below applies the same condition: hover is shown only when the setting is +off and VS Code has not added `body.vscode-reduce-motion`. + +| Surface | Owning component / pointer tracking | Off + normal | On + normal | Off + reduced | On + reduced | +| ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| Results Table and Tree | RDG renders rows; `dataGridTheme.scss` owns background and selected-foreground variables | Hover background and selected hover foreground | Base background; selected foreground remains the inactive selection color | Same as setting on | Same as setting on | +| Collection View Indexes rows | Fluent `TableRow` in `IndexTable`; `indexesTab.scss` owns the row-cell `:hover` | Hover background | Alternating base background | Alternating base background | Alternating base background | +| Cluster Dashboard namespace rows | Fluent `TableRow` in `NamespaceTable`; `clusterDashboard.scss` owns the row `:hover` | Hover background | Base background | Base background | Base background | +| Connection Diagnostics check rows and Local Quick Start status rows | Package `StatusList`; Griffel owns the `listitem` `:hover`; each consumer supplies the setting state | Hover background | No pointer background; keyboard-focus background remains | No pointer background; keyboard-focus background remains | No pointer background; keyboard-focus background remains | +| Local Quick Start setup-setting and editor rows | Fluent `TableRow`; `localQuickStart.scss` owns the suppression of Fluent's row `:hover` | Hover background and foreground | Base background and foreground | Base background and foreground | Base background and foreground | + +The last two StatusList consumers do not have row selection. Index and namespace rows have +action controls, whose own hover, pressed and focus states are intentionally unchanged. +Links, tooltips, form controls, Fluent buttons/cards/menus/options, expanders and Monaco +widgets are not row/item tracking and are excluded. Dashboard row actions intentionally retain +their own hover and focus feedback. Native VS Code context menus, workbench-owned tree views, +quick picks, notifications and menus are also excluded because the extension does not own +their rendering. Table and Tree mount a polite Escape hint once per confirmed grid entry. Its message is chosen from the entry view/selection and stays frozen during cell moves or selection changes, diff --git a/docs/ai-and-plans/features/data-grid/iterations/08-hover-opt-out-rollout-review.md b/docs/ai-and-plans/features/data-grid/iterations/08-hover-opt-out-rollout-review.md new file mode 100644 index 000000000..b0a9c4959 --- /dev/null +++ b/docs/ai-and-plans/features/data-grid/iterations/08-hover-opt-out-rollout-review.md @@ -0,0 +1,53 @@ +--- +kind: ai-review +status: completed +created: 2026-12-02 +--- + +# Hover opt-out rollout pre-review + +## Stage 1 + +The initial review found three medium-severity issues: + +1. Fluent Table hover background or foreground could remain visible under the opt-out in + Indexes and Cluster Dashboard. +2. The Indexes hover selector outranked its pressed-state selector. +3. Local Quick Start's setup-settings table was missing from the rollout. + +All three were valid and fixed. The validation pass found no remaining code defects. Browser +checks confirmed the setting and live reduced-motion cases for Results, Indexes, Dashboard, +StatusList rows and the Local Quick Start table. No other extension-owned row/item hover +surfaces were found. Native VS Code controls and workbench-rendered trees, menus, quick picks +and notifications remain excluded. + +## PR feedback + +### C01 — Shareable component API + +`StatusList` now exposes `disableHighlightOnHover`, which suppresses pointer-only feedback while +retaining row layout and keyboard focus. Its CSS customization points use component-neutral +`--status-list-*` names. Consumers continue to carry VS Code's live reduced-motion instruction +through those variables, rather than using a DocumentDB-specific class or variable namespace. + +The package is bumped from `1.3.0` to `1.4.0`, and the changelog entry for this additive API is +recorded under `1.4.0` rather than modifying the existing `1.3.0` entry. + +## Author decisions + +- Keep the shared accessibility setting; do not add view-specific settings. +- Keep pointer-only hover disabled only for the combination + `disableHighlightOnHover || body.vscode-reduce-motion`. +- Preserve Table selection, selected foreground, keyboard focus, pressed feedback, action + controls, links and tooltips. +- Preserve the existing read-on-open configuration semantics. The reduced-motion body class + remains live. + +## Verification + +- Focused hover tests: 68 passed. +- Build and strict test type checks passed. +- Browser-computed styles verified hover, opt-out and reduced-motion behavior. +- Full runtime suite passed after restoring lockfile-pinned dependencies: 10,161 passed, + 1 skipped. +- Packaging passed. diff --git a/docs/ai-and-plans/features/webview-fluentui-package/README.md b/docs/ai-and-plans/features/webview-fluentui-package/README.md index 02147b5a5..71ab1329b 100644 --- a/docs/ai-and-plans/features/webview-fluentui-package/README.md +++ b/docs/ai-and-plans/features/webview-fluentui-package/README.md @@ -10,7 +10,7 @@ code: # `@microsoft/vscode-ext-webview-fluentui` -**Status:** 1.3.0 prepared; 1.2.0 is the latest published version; increments 1-6 implemented and accepted · **Created:** 2026-08-18 +**Status:** 2.0.0 prepared; 1.2.0 is the latest published version; increments 1-6 implemented and accepted · **Created:** 2026-08-18 > The React theming layer and a small set of components, extracted so other VS Code extensions can > make Fluent UI look correct inside a webview without rebuilding it. @@ -152,12 +152,17 @@ increment 4 work log; no screen-reader transcript or exact operator test matrix On 2026-11-24 the operator confirmed a successful extension debug review with Fluent components 9.75.2 and icons 2.0.345. -The package manifest is now `1.3.0`; the latest published version is `1.2.0`. +The package manifest is now `2.0.0`; the latest published version is `1.2.0`. The prepared `1.3.0` adds the `StatusList` skipped state, expandable disclosures with motion, details-content components, an aside slot and optional row highlighting. It also adds `@fluentui/react-motion-components-preview` (`^0.15.6`) as a peer and widens the `@fluentui/react-components` peer to `~9.74 || ~9.75.1`. See the [package changelog](../../../../packages/vscode-ext-webview-fluentui/CHANGELOG.md#130). +The prepared `2.0.0` replaces the row-highlight booleans with `StatusList.rowHighlight`: hover and +visible keyboard focus can each be enabled without the other. The mode type is exported as +`StatusListRowHighlight`, and the list and its items own their ARIA roles. It also adds neutral custom properties +for pointer-only row hover colors and transition. See the +[package changelog](../../../../packages/vscode-ext-webview-fluentui/CHANGELOG.md#200). The earlier `1.1.0` changes include: @@ -168,7 +173,7 @@ The earlier `1.1.0` changes include: changes. Preview versions were already being published; the absence of `private: true` remains intentional -(0027). The prepared `1.3.0` has not been published to the registry. +(0027). The changes prepared since `1.2.0` have not been published to the registry. During extraction, the operator confirmed there were no external package consumers. Breaking API changes were permitted before the `1.0.0` release-version bump (0029); that permission does not diff --git a/docs/ai-and-plans/features/webview-fluentui-package/design.md b/docs/ai-and-plans/features/webview-fluentui-package/design.md index e39ae3a3c..e0e981860 100644 --- a/docs/ai-and-plans/features/webview-fluentui-package/design.md +++ b/docs/ai-and-plans/features/webview-fluentui-package/design.md @@ -37,6 +37,12 @@ Three entries. Not in v1: `./tokens` (0008), `./styles.css` (0010), `./testing`. +`StatusList.rowHighlight` selects whole-row highlighting (`none`, `hover`, `focus`, or `hover-and-focus`). +Hover and visible keyboard focus are independent triggers; neither changes the indicators on controls +inside a row. Consumers map their accessibility settings to the appropriate mode. The list and its +items own their `list` and `listitem` roles so forwarded DOM props cannot break the list semantics or +the role-based row highlighting. + `./monaco` is Fluent-free on purpose. It shares the colour source, not the adaptation - see §3 - and its data is structurally assignable to `monaco.editor.IStandaloneThemeData` so that the consumer needs no cast and the package needs no Monaco dependency. diff --git a/docs/user-manual/collection-view-querying.md b/docs/user-manual/collection-view-querying.md index 0bc7451e9..e389f6e45 100644 --- a/docs/user-manual/collection-view-querying.md +++ b/docs/user-manual/collection-view-querying.md @@ -273,9 +273,12 @@ view picker immediately; in Tree View it exits immediately as well. A popup that A brief polite Escape hint is announced once on entry to Table or Tree, not on each cell move. Switching windows alone does not repeat the hint. -To suppress row hover highlights in Table and Tree, enable -`documentDB.accessibility.disableHighlightOnHover` and reopen Collection View. Reduced motion -also suppresses these highlights, even when the setting is off. Focus and selection remain visible. +To suppress hover-only row or item highlights in Collection View, enable +`documentDB.accessibility.disableHighlightOnHover` and close and reopen the affected view. The preference +also applies to Indexes, Cluster Dashboard namespace rows, Connection Diagnostics check rows and +Local Quick Start status and setup-setting rows. Reduced motion suppresses these highlights +immediately, even when the setting is off. Focus, selection, actionable controls and keyboard +feedback remain visible. ### Table Column Widths diff --git a/package-lock.json b/package-lock.json index 8e82121a6..4e5221f99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19279,7 +19279,7 @@ }, "packages/vscode-ext-webview-fluentui": { "name": "@microsoft/vscode-ext-webview-fluentui", - "version": "1.3.0", + "version": "2.0.0", "license": "MIT", "devDependencies": { "@fluentui/react-progress": "~9.5.3", diff --git a/packages/vscode-ext-webview-fluentui/CHANGELOG.md b/packages/vscode-ext-webview-fluentui/CHANGELOG.md index a1d1e9cf1..127d8be6c 100644 --- a/packages/vscode-ext-webview-fluentui/CHANGELOG.md +++ b/packages/vscode-ext-webview-fluentui/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 2.0.0 + +- **Breaking:** `StatusList` replaces `highlightRowsOnHover` and `disableHighlightOnHover` with [`rowHighlight`](./src/components/StatusList/README.md#rowhighlight). Migrate `highlightRowsOnHover` to `rowHighlight="hover-and-focus"`, or to `"focus"` if both booleans were true. If highlighting was off, omit the prop (the default is `"none"`). Use `"hover"` for pointer-only row highlighting; controls keep their own focus indicators in every mode. +- Pointer colours and transition read `--status-list-row-hover-background`, `--status-list-row-hover-outline`, and `--status-list-row-hover-transition`, allowing consumers to apply a live reduced-motion state. +- **Breaking:** `StatusList` and `StatusListItem` no longer accept a `role` prop. Remove overrides; their roles are always `list` and `listitem`. +- Exported the `StatusListRowHighlight` type from `@microsoft/vscode-ext-webview-fluentui/components` for consumers that expose the same highlight modes. + ## 1.3.0 - The `@fluentui/react-components` peer accepts both 9.74.x and 9.75.1 through 9.75.x. @@ -11,7 +18,6 @@ - The disclosure region sets its content's base type (`fontSizeBase200`, `lineHeightBase200`, `colorNeutralForeground1`), renders `code` as `fontFamilyMonospace` without the chip VS Code's webview default stylesheet gives it, and adds `spacingVerticalXXS` above and below the content inside the left rule. Plain content renders at base200; pass `` for larger text, though the README advises against it. - Added an optional `aside` to `StatusListItem`: a short value, such as a duration `Badge`, at the end of the label line. It keeps its line while the label wraps, and its box is the label line's height, so a small badge does not make the row taller. The package formats nothing. - Added `highlightRowsOnHover` to `StatusList`: it shades the row under the pointer, and the row whose control has keyboard focus (`:focus-visible`), with the subtle `colorNeutralBackground2`, and outlines it with `colorTransparentStrokeInteractive` for high contrast. Padding with an equal negative margin keeps the layout unchanged. Off by default. - ## 1.2.0 - Added `contentMaxWidth` to `ContainerBody` and `Wizard`, accepting CSS maximum-width values or pixel numbers. Omit the prop or use `"none"` for no width cap. diff --git a/packages/vscode-ext-webview-fluentui/README.md b/packages/vscode-ext-webview-fluentui/README.md index f7434024f..632a18f3a 100644 --- a/packages/vscode-ext-webview-fluentui/README.md +++ b/packages/vscode-ext-webview-fluentui/README.md @@ -13,6 +13,31 @@ style the production collection, document, and query views that people use every Its sibling, [`@microsoft/vscode-ext-webview`](https://github.com/microsoft/vscode-documentdb/blob/main/packages/vscode-ext-webview/README.md), carries the transport (tRPC over `postMessage`). Neither package in this pairing depends on the other. +## Migrating to 2.0.0 + +On `StatusList`, replace `highlightRowsOnHover` and `disableHighlightOnHover` with `rowHighlight`. +If you never passed either prop, no change to row highlighting is needed. + +| Old `highlightRowsOnHover` | Old `disableHighlightOnHover` | New `rowHighlight` | +| -------------------------- | ----------------------------- | -------------------- | +| Omitted or `false` | Any value | Omit it, or `"none"` | +| `true` | Omitted or `false` | `"hover-and-focus"` | +| `true` | `true` | `"focus"` | + +If a preference controls hover, keep the preference and change only how you pass it to the list: + +```diff +- ++ +``` + +Use `rowHighlight="hover"` if you want pointer-only row shading. It has no equivalent in the old +API. In every mode, buttons and links inside the row keep their own focus indicators. + +Remove any `role` prop from `StatusList` or `StatusListItem`. They always render `role="list"` +and `role="listitem"`, respectively. If another role belongs to the surrounding UI, put it on +a separate element instead of replacing the list semantics. + ## Theming Two theming layers derive from the same live VS Code theme: **Fluent theming**, for every Fluent UI @@ -171,7 +196,8 @@ content, over a footer pinned to the bottom. `StepList` is a step indicator that overflow menu and never hides the current step. `StatusList` is a bordered list of stages, each with a status glyph and a line of evidence, an optional short value (such as a duration) at the end of its label line, and optional expandable details whose content follows a -documented type scale. `Wizard` is all three of those assembled into a +documented type scale. Its [`rowHighlight`](./src/components/StatusList/README.md#rowhighlight) +prop selects pointer hover, visible keyboard focus, both, or neither. `Wizard` is all three of those assembled into a complete wizard surface, for the common case where you do not want to wire them yourself. `MetricGrid` and `MetricCard` are a dashboard strip: one measurement per card, told apart from "loading" and "unavailable" without the layout moving, in a grid that goes from one column to four. diff --git a/packages/vscode-ext-webview-fluentui/package.json b/packages/vscode-ext-webview-fluentui/package.json index e4aed2376..984263ead 100644 --- a/packages/vscode-ext-webview-fluentui/package.json +++ b/packages/vscode-ext-webview-fluentui/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/vscode-ext-webview-fluentui", - "version": "1.3.0", + "version": "2.0.0", "description": "Makes Fluent UI look native inside a VS Code webview: a React theming layer that tracks the user's active workbench theme, plus a small set of provider-agnostic components.", "type": "module", "main": "dist/index.js", diff --git a/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md b/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md index 712b908a1..afe0a35f5 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md @@ -168,21 +168,35 @@ the label without making the row taller. The package formats nothing: units, rounding and locale belong to the consumer, as with `detail`. Use squared (`shape="rounded"`) badges, like the rest of the extension's webviews. A value pinned to -the far end of a wide list is hard to match to its row; turn on `highlightRowsOnHover`. +the far end of a wide list is hard to match to its row; use `rowHighlight` to help readers follow it. -## `highlightRowsOnHover` +## `rowHighlight` -Set on `StatusList`. It shades the row under the pointer, and the row whose control has keyboard -focus, with `colorNeutralBackground2`, which the adaptive theme maps to VS Code's alternating-row -colour: the subtlest surface that still follows the theme. High contrast, where a shade cannot show, -gets a `colorTransparentStrokeInteractive` outline instead, as Fluent's subtle controls do. +Replacing `highlightRowsOnHover` or `disableHighlightOnHover`? See [Migrating to 2.0.0](../../../README.md#migrating-to-200). + +Set on `StatusList` to choose when to highlight a whole row. To type the same choice in a wrapper, +use `import type { StatusListRowHighlight } from '@microsoft/vscode-ext-webview-fluentui/components'`. + +| Value | Pointer over the row | Visible keyboard focus inside the row | +| ------------------- | -------------------- | ------------------------------------- | +| `'none'` (default) | No | No | +| `'hover'` | Yes | No | +| `'focus'` | No | Yes | +| `'hover-and-focus'` | Yes | Yes | + +This affects only the row, not the focus indicator on a button or link inside it. Highlighted rows +use `colorNeutralBackground2` (VS Code's alternating-row colour) and a `colorTransparentStrokeInteractive` +outline for high contrast. - **The layout does not move.** Each row gains padding and an equal negative margin, so the shade has room while every row stays where it was. - **`:focus-visible`, not `:focus-within`.** A mouse click on a row's control would otherwise leave that row shaded while the pointer shades another. - **It is not a click target.** The cursor stays the default; only controls inside the row act. -- Off by default; turn it on when rows carry an `aside`. +- Pointer-only colours use the `--status-list-row-hover-background` and + `--status-list-row-hover-outline` fallbacks, so a webview can set those inherited variables from + its live reduced-motion state. The matching `--status-list-row-hover-transition` variable lets + that state remove the colour transition immediately as well. ## Details content @@ -388,7 +402,7 @@ lists and secondary notes), see the DocumentDB extension's Diagnose connection p ## Accessibility -- The list is `role="list"`, each row `role="listitem"`. +- The list owns `role="list"` and each row owns `role="listitem"`; neither role can be overridden. - **A row carries no `aria-label`.** The status is a visually-hidden word appended to the label instead. A row-level label would make anything interactive inside `detail` unreachable, and `detail` takes arbitrary content, so that is a guarantee rather than an observation. diff --git a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.test.tsx b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.test.tsx index 12ff4cd74..0514f04ef 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.test.tsx +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.test.tsx @@ -12,6 +12,18 @@ import { StatusList, StatusListItem, type StatusListItemDisclosure } from './ind beforeAll(installTestEnvironment); afterEach(cleanupSurfaces); +const stylesFor = (element: Element): string => + [...document.querySelectorAll('style')] + .map((style) => + style.textContent !== null && style.textContent !== '' + ? style.textContent + : [...(style.sheet?.cssRules ?? [])].map((rule) => rule.cssText).join('\n'), + ) + .join('\n') + .split('}') + .filter((block) => [...element.classList].some((name) => block.includes(`.${name}`))) + .join('}'); + describe('StatusList', () => { test('voices the status as a word after the label, and gives the row no aria-label', async () => { const { root } = await renderSurface( @@ -43,6 +55,19 @@ describe('StatusList', () => { expect(rows[1]?.textContent).toBe('Abbild, pending'); }); + test('forwarded DOM props cannot replace the list or item role', async () => { + const forwarded = { role: 'presentation', title: 'Checks' }; + const { root } = await renderSurface( + + + , + ); + + expect(root.getAttribute('role')).toBe('list'); + expect(root.firstElementChild?.getAttribute('role')).toBe('listitem'); + expect(root.firstElementChild?.getAttribute('title')).toBe('Checks'); + }); + test('detail renders arbitrary content, and interactive content inside it stays reachable', async () => { const { root } = await renderSurface( @@ -190,19 +215,28 @@ describe('StatusList', () => { expect(labelLine?.textContent).toBe('Authentication, warningDetails4.38 s'); }); - test('highlightRowsOnHover never changes the markup of its rows', async () => { - // The shade is CSS on the list (Griffel classes, which this renderer does not emit); the rows' - // structure, and so their layout and accessible text, stay the same. - const rowsMarkup = async (highlight: boolean): Promise => { - const { root } = await renderSurface( - - - , - ); - return root.querySelector('[role="list"]')?.innerHTML; - }; + test.each([ + ['none', false, false], + ['hover', true, false], + ['focus', false, true], + ['hover-and-focus', true, true], + ] as const)('rowHighlight="%s" preserves rows and enables the requested triggers', async (mode, hover, focus) => { + const row = ( + Details} /> + ); + const { root, rerender } = await renderSurface({row}); + const markup = root.innerHTML; + expect(stylesFor(root)).not.toMatch(/:hover|:focus-visible/); - expect(await rowsMarkup(true)).toBe(await rowsMarkup(false)); + await rerender( + + {row} + , + ); + const styles = stylesFor(root); + expect(styles.includes(':hover')).toBe(hover); + expect(styles.includes(':has(:focus-visible)')).toBe(focus); + expect(root.innerHTML).toBe(markup); }); describe('disclosure', () => { diff --git a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx index 9c14e6e07..c531903e2 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx @@ -29,17 +29,26 @@ const useStyles = makeStyles({ outline: `${tokens.strokeWidthThin} solid transparent`, outlineOffset: `calc(-1 * ${tokens.strokeWidthThin})`, transitionProperty: 'background-color', - transitionDuration: tokens.durationFaster, + transitionDuration: `var(--status-list-row-hover-transition, ${tokens.durationFaster})`, transitionTimingFunction: tokens.curveEasyEase, '@media (prefers-reduced-motion: reduce)': { transitionDuration: '0.01ms' }, }, + }, + focusHighlight: { // `:focus-visible`, not `:focus-within`: a mouse click on a row's control must not leave that // row shaded while the pointer shades another one. - '& > [role="listitem"]:hover, & > [role="listitem"]:has(:focus-visible)': { + '& > [role="listitem"]:has(:focus-visible)': { backgroundColor: tokens.colorNeutralBackground2, outlineColor: tokens.colorTransparentStrokeInteractive, }, }, + hoverHighlight: { + // Let the focus cue win when both triggers match, even if hover colours are transparent. + '& > [role="listitem"]:where(:hover)': { + backgroundColor: `var(--status-list-row-hover-background, ${tokens.colorNeutralBackground2})`, + outlineColor: `var(--status-list-row-hover-outline, ${tokens.colorTransparentStrokeInteractive})`, + }, + }, }); /** @@ -63,7 +72,7 @@ const useStyles = makeStyles({ export const StatusList = ({ ariaLabel, statusLabels, - highlightRowsOnHover, + rowHighlight = 'none', children, className, ...rest @@ -80,12 +89,14 @@ export const StatusList = ({
{children}
diff --git a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.types.ts b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.types.ts index 5219bbb51..8d5e166a1 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.types.ts +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.types.ts @@ -14,7 +14,10 @@ import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from 'react'; */ export type StatusListItemStatus = 'pending' | 'active' | 'done' | 'error' | 'warning' | 'skipped'; -export interface StatusListProps extends ComponentPropsWithoutRef<'div'> { +/** Which interactions highlight a whole status row, independently of its controls' focus indicators. */ +export type StatusListRowHighlight = 'none' | 'hover' | 'focus' | 'hover-and-focus'; + +export interface StatusListProps extends Omit, 'role'> { /** Accessible name of the list. */ readonly ariaLabel: string; /** @@ -23,17 +26,16 @@ export interface StatusListProps extends ComponentPropsWithoutRef<'div'> { */ readonly statusLabels?: Partial>; /** - * Shade the row under the pointer, and the row whose control has keyboard focus, with Fluent's - * subtle `colorNeutralBackground2` (VS Code's alternating-row colour). Turn it on when rows carry - * an `aside` far from their label, so the eye can follow a row across a wide list. Off by - * default; the layout is the same either way. + * When to highlight a row: on pointer hover, when a control inside it has visible keyboard + * focus, or on either trigger. Defaults to `none`. Controls keep their own focus indicators + * in every mode. */ - readonly highlightRowsOnHover?: boolean; + readonly rowHighlight?: StatusListRowHighlight; /** `StatusListItem` rows. */ readonly children: ReactNode; } -export interface StatusListItemProps extends ComponentPropsWithoutRef<'div'> { +export interface StatusListItemProps extends Omit, 'role'> { readonly label: ReactNode; readonly status: StatusListItemStatus; /** @@ -58,7 +60,7 @@ export interface StatusListItemProps extends ComponentPropsWithoutRef<'div'> { * A short value at the end of the label line, for example a duration in a `Badge`. It stays on * one line and the label wraps before it does. Named after `TreeItemLayout`'s `aside` slot. The * package formats nothing: units, rounding and locale belong to the consumer. In a wide list, - * pair it with `StatusList`'s `highlightRowsOnHover`. + * pair it with `StatusList`'s `rowHighlight` to help readers follow the row. */ readonly aside?: ReactNode; } diff --git a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusListItem.tsx b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusListItem.tsx index 71236ac29..830867a41 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusListItem.tsx +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusListItem.tsx @@ -222,7 +222,7 @@ export const StatusListItem = ({ const hasAside = aside !== undefined && aside !== null && aside !== false && aside !== ''; return ( -
+
{icon}
().toEqualTypeOf(); +expectTypeOf>().toBeNever(); +expectTypeOf>().toBeNever(); diff --git a/src/webviews/documentdb/clusterDashboard/ClusterDashboard.tsx b/src/webviews/documentdb/clusterDashboard/ClusterDashboard.tsx index b9f81aef0..7c8272119 100644 --- a/src/webviews/documentdb/clusterDashboard/ClusterDashboard.tsx +++ b/src/webviews/documentdb/clusterDashboard/ClusterDashboard.tsx @@ -598,7 +598,11 @@ export const ClusterDashboard = (): JSX.Element => { isCreatingNamespace; return ( -
+
{isBusy && } {/* diff --git a/src/webviews/documentdb/clusterDashboard/clusterDashboard.scss b/src/webviews/documentdb/clusterDashboard/clusterDashboard.scss index 91822c385..8c4d92947 100644 --- a/src/webviews/documentdb/clusterDashboard/clusterDashboard.scss +++ b/src/webviews/documentdb/clusterDashboard/clusterDashboard.scss @@ -804,10 +804,16 @@ $content-gutter: var(--spacingHorizontalMNudge); // 10px flex: 0 0 16px; } - .namespaceRow:hover { + body:not(.vscode-reduce-motion) &:not(.disableHighlightOnHover) .namespaceRow:hover { background-color: var(--colorNeutralBackground1Hover); } + &:is(.disableHighlightOnHover) .namespaceRow:hover:not(:active), + body.vscode-reduce-motion & .namespaceRow:hover:not(:active) { + background-color: transparent; + color: var(--colorNeutralForeground1); + } + // Both levels are destinations; the trailing button remains the keyboard-reachable action. .namespaceRowClickable { cursor: pointer; diff --git a/src/webviews/documentdb/clusterDashboard/clusterDashboardController.test.ts b/src/webviews/documentdb/clusterDashboard/clusterDashboardController.test.ts index 071e87eba..8c5e6b3f0 100644 --- a/src/webviews/documentdb/clusterDashboard/clusterDashboardController.test.ts +++ b/src/webviews/documentdb/clusterDashboard/clusterDashboardController.test.ts @@ -26,6 +26,11 @@ vi.mock('../../../extensionVariables', () => ({ ext: { context: { extensionUri: { scheme: 'file', path: '/extension' } } }, })); +const settings = vi.hoisted(() => new Map()); +vi.mock('../../../services/SettingsService', () => ({ + SettingsService: { getSetting: vi.fn((key: string) => settings.get(key)) }, +})); + vi.mock('../../_integration/openAppWebview', () => ({ openAppWebview: vi.fn(() => createFakeController()), })); @@ -41,6 +46,7 @@ vi.mock('./resolveNamespaceNode', () => ({ import * as vscode from 'vscode'; import { openCollectionViewInternal } from '../../../commands/openCollectionView/openCollectionView'; +import { settingsKeys } from '../../../settingsKeys'; import { openAppWebview } from '../../_integration/openAppWebview'; import { CLUSTER_DASHBOARD_CONTEXT_MENU_COMMANDS } from './clusterDashboardContextMenu'; import { openClusterDashboardWebview, registerClusterDashboardContextMenuCommands } from './clusterDashboardController'; @@ -93,6 +99,20 @@ function open(clusterId: string, selectedDatabaseName?: string): FakeController } describe('openClusterDashboardWebview panel lifecycle', () => { + it('passes the hover-highlight opt-out read when the panel opens', (): void => { + settings.set(settingsKeys.disableHighlightOnHover, true); + + const controller = open('hover-disabled'); + + expect(openAppWebview).toHaveBeenCalledWith( + expect.objectContaining({ + config: expect.objectContaining({ disableHighlightOnHover: true }), + }), + ); + controller.dispose(); + settings.clear(); + }); + it('attributes the original session without retagging it when another URL reuses the panel', (): void => { vi.clearAllMocks(); const config = { diff --git a/src/webviews/documentdb/clusterDashboard/clusterDashboardController.ts b/src/webviews/documentdb/clusterDashboard/clusterDashboardController.ts index 9dbce2e0e..e5925c2c8 100644 --- a/src/webviews/documentdb/clusterDashboard/clusterDashboardController.ts +++ b/src/webviews/documentdb/clusterDashboard/clusterDashboardController.ts @@ -12,6 +12,8 @@ import { type DeepLinkTelemetry } from '../../../deepLinks/deepLinkTelemetry'; import { openCollectionViewInternal } from '../../../commands/openCollectionView/openCollectionView'; import { API } from '../../../DocumentDBExperiences'; import { ext } from '../../../extensionVariables'; +import { SettingsService } from '../../../services/SettingsService'; +import { settingsKeys } from '../../../settingsKeys'; import { openAppWebview, type AppWebviewController } from '../../_integration/openAppWebview'; import { CLUSTER_DASHBOARD_CONTEXT_MENU_COMMANDS, @@ -75,6 +77,8 @@ export type ClusterDashboardWebviewConfigurationType = { /** Polling cadence of the live health tiles, in milliseconds. */ refreshIntervalMs: number; feedbackPermitted?: boolean; + /** Applied only when the panel opens, like other webview configuration settings. */ + disableHighlightOnHover?: boolean; /** Azure resource facts, when the cluster came from an Azure-backed tree node. */ azure?: ClusterDashboardAzureInfo; /** Database selected from the tree when opening the dashboard, if any. */ @@ -350,7 +354,11 @@ export function openClusterDashboardWebview( // Assigned here rather than by the caller so a reveal of an existing panel cannot mint a // second id for the same session. - initialData = { ...initialData, dashboardSessionId: randomUUID() }; + initialData = { + ...initialData, + dashboardSessionId: randomUUID(), + disableHighlightOnHover: SettingsService.getSetting(settingsKeys.disableHighlightOnHover) ?? false, + }; // Declared before `trpcContext` because that context closes over it, and assigned after, // because `openAppWebview` needs the context. `const` is not available for that ordering. diff --git a/src/webviews/documentdb/collectionView/CollectionView.test.tsx b/src/webviews/documentdb/collectionView/CollectionView.test.tsx index 351275594..6c78ed9a3 100644 --- a/src/webviews/documentdb/collectionView/CollectionView.test.tsx +++ b/src/webviews/documentdb/collectionView/CollectionView.test.tsx @@ -74,6 +74,10 @@ const boundaries = vi.hoisted(() => ({ }[], })); +const webviewConfiguration = vi.hoisted(() => ({ + disableHighlightOnHover: false, +})); + const client = vi.hoisted(() => { const tableResults: TablePage[] = []; const tableRequests: DeferredTableRequest[] = []; @@ -143,6 +147,7 @@ vi.mock('@microsoft/vscode-ext-webview/react', () => ({ initialDocumentView: Views.TABLE, defaultPageSize: 50, enableAIQueryGeneration: false, + disableHighlightOnHover: webviewConfiguration.disableHighlightOnHover, }), })); vi.mock('../../_integration/useTrpcClient', () => ({ useTrpcClient: () => client.trpc })); @@ -431,6 +436,8 @@ beforeEach(() => { client.tableRequests.length = 0; boundaries.latestTableProps = undefined; boundaries.announcerMounts.length = 0; + webviewConfiguration.disableHighlightOnHover = false; + document.body.classList.remove('vscode-reduce-motion'); vi.clearAllMocks(); }); @@ -440,6 +447,31 @@ afterEach(async () => { mounted = false; } host?.remove(); + document.body.classList.remove('vscode-reduce-motion'); +}); + +describe('CollectionView hover highlight policy', (): void => { + it.each([ + { setting: false, reducedMotion: false, disabled: false }, + { setting: true, reducedMotion: false, disabled: true }, + { setting: false, reducedMotion: true, disabled: true }, + { setting: true, reducedMotion: true, disabled: true }, + ])( + 'applies the same effective condition for setting=$setting and reducedMotion=$reducedMotion', + async ({ setting, reducedMotion, disabled }): Promise => { + webviewConfiguration.disableHighlightOnHover = setting; + document.body.classList.toggle('vscode-reduce-motion', reducedMotion); + + await render(); + + const settingDisabled = host + .querySelector('.collectionView') + ?.classList.contains('disableHighlightOnHover'); + const effectiveDisabled = + settingDisabled === true || document.body.classList.contains('vscode-reduce-motion'); + expect(effectiveDisabled).toBe(disabled); + }, + ); }); describe('CollectionView mouse Back step-up', (): void => { diff --git a/src/webviews/documentdb/collectionView/CollectionView.tsx b/src/webviews/documentdb/collectionView/CollectionView.tsx index e406a6fcb..e51af619e 100644 --- a/src/webviews/documentdb/collectionView/CollectionView.tsx +++ b/src/webviews/documentdb/collectionView/CollectionView.tsx @@ -971,7 +971,11 @@ export const CollectionView = (): JSX.Element => { return ( -
+
{currentContext.isLoading && ( )} diff --git a/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss b/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss index d5e0305ad..e489e0757 100644 --- a/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss +++ b/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss @@ -225,9 +225,20 @@ } /* Adaptive list hover, on the cells so primary and detail rows respond evenly. */ - .rowEven:hover > td, - .rowOdd:hover > td { - background-color: var(--vscode-list-hoverBackground, var(--colorSubtleBackgroundHover)); + :where(body:not(.vscode-reduce-motion) .collectionView:not(.disableHighlightOnHover)) & { + .rowEven:hover > td, + .rowOdd:hover > td { + background-color: var(--vscode-list-hoverBackground, var(--colorSubtleBackgroundHover)); + } + } + + .collectionView.disableHighlightOnHover &, + body.vscode-reduce-motion & { + .rowEven:hover:not(:active), + .rowOdd:hover:not(:active) { + background-color: transparent; + color: var(--colorNeutralForeground1); + } } /* Pressed fill; must stay after hover, both selectors have equal specificity. */ diff --git a/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx b/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx index 9fdee4f71..8645f1708 100644 --- a/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx +++ b/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx @@ -554,7 +554,7 @@ export const ConnectionDiagnostics = (): JSX.Element => { id={CHECKS_LIST_ID} ariaLabel={l10n.t('Connection checks')} statusLabels={words} - highlightRowsOnHover + rowHighlight={configuration.disableHighlightOnHover === true ? 'focus' : 'hover-and-focus'} > {panelRowIds.map((id) => ( ({ openAppWebview: vi.fn() })); vi.mock('../../../utils/feedbackPermission', () => ({ isFeedbackPermitted: vi.fn(() => true) })); +const settings = vi.hoisted(() => new Map()); +vi.mock('../../../services/SettingsService', () => ({ + SettingsService: { getSetting: vi.fn((key: string) => settings.get(key)) }, +})); vi.mock('../../../extensionVariables', async () => { const vscodeMock = await import('vscode'); return { ext: { context: { extensionUri: vscodeMock.Uri.file('/fixture/extension') } } }; @@ -52,6 +57,7 @@ function open(clusterId: string, treeId?: string): ReturnType { beforeEach((): void => { vi.clearAllMocks(); + settings.clear(); opened.length = 0; vi.mocked(openAppWebview).mockImplementation( (options: OpenAppWebviewOptions): AppWebviewController => { @@ -119,6 +125,7 @@ describe('openConnectionDiagnostics', (): void => { connectionName: 'Connection fixture', diagnosticsSessionId: result.diagnosticsSessionId, feedbackPermitted: true, + disableHighlightOnHover: false, }); expect(opened[0].context).toMatchObject({ session: { subject: { target: { clusterId: 'fixture' }, entryPoint: 'contextMenu' } }, @@ -148,6 +155,14 @@ describe('openConnectionDiagnostics', (): void => { expect(opened[0].config.feedbackPermitted).toBe(false); }); + it('passes the hover-highlight opt-out read when the panel opens', (): void => { + settings.set(settingsKeys.disableHighlightOnHover, true); + + open('fixture'); + + expect(opened[0].config.disableHighlightOnHover).toBe(true); + }); + it.each([false, true])( 'reuses the panel with replacement credentials when availability was %s', async (initiallyAvailable): Promise => { diff --git a/src/webviews/documentdb/connectionDiagnostics/connectionDiagnosticsController.ts b/src/webviews/documentdb/connectionDiagnostics/connectionDiagnosticsController.ts index ac3860ed5..e052cd792 100644 --- a/src/webviews/documentdb/connectionDiagnostics/connectionDiagnosticsController.ts +++ b/src/webviews/documentdb/connectionDiagnostics/connectionDiagnosticsController.ts @@ -8,6 +8,8 @@ import * as vscode from 'vscode'; import { type DiagnosticsEntryPoint, type DiagnosticsTarget } from '../../../connectionDiagnostics/types'; import { API } from '../../../DocumentDBExperiences'; import { ext } from '../../../extensionVariables'; +import { SettingsService } from '../../../services/SettingsService'; +import { settingsKeys } from '../../../settingsKeys'; import { isFeedbackPermitted } from '../../../utils/feedbackPermission'; import { type AppWebviewController, openAppWebview } from '../../_integration/openAppWebview'; import { type RouterContext } from './connectionDiagnosticsRouter'; @@ -49,6 +51,7 @@ export function openConnectionDiagnostics(options: { target: DiagnosticsTarget; connectionName: target.displayName, diagnosticsSessionId: session.diagnosticsSessionId, feedbackPermitted: isFeedbackPermitted(), + disableHighlightOnHover: SettingsService.getSetting(settingsKeys.disableHighlightOnHover) ?? false, }, context, viewColumn: vscode.ViewColumn.Active, diff --git a/src/webviews/documentdb/connectionDiagnostics/connectionDiagnosticsTypes.ts b/src/webviews/documentdb/connectionDiagnostics/connectionDiagnosticsTypes.ts index 7e8fcb247..51570cb83 100644 --- a/src/webviews/documentdb/connectionDiagnostics/connectionDiagnosticsTypes.ts +++ b/src/webviews/documentdb/connectionDiagnostics/connectionDiagnosticsTypes.ts @@ -75,6 +75,8 @@ export interface ConnectionDiagnosticsConfiguration { readonly diagnosticsSessionId: string; /** Read when the panel opens; the host checks again when Give Feedback is clicked. */ readonly feedbackPermitted?: boolean; + /** Applied only when the panel opens, like other webview configuration settings. */ + readonly disableHighlightOnHover?: boolean; /** * How the panel paces settled rows (decision 0043). The extension never sets it, so the panel's * default applies; the view's tests and the static L2-dev fixtures turn pacing off with zeros. diff --git a/src/webviews/documentdb/localQuickStart/LocalQuickStart.tsx b/src/webviews/documentdb/localQuickStart/LocalQuickStart.tsx index bf4f09a42..ba7a0fb43 100644 --- a/src/webviews/documentdb/localQuickStart/LocalQuickStart.tsx +++ b/src/webviews/documentdb/localQuickStart/LocalQuickStart.tsx @@ -2074,7 +2074,13 @@ export const LocalQuickStart = (): JSX.Element => { {unreadableDataNotice} {dataRemovedNotice} {dataChoiceBlock} - +
@@ -2301,7 +2307,11 @@ export const LocalQuickStart = (): JSX.Element => { const setup = ( <> - + {PROVISION_STAGES.map((stage) => ( { {PROVISION_STAGES.map((stage) => ( tbody > tr:hover:not(:active), +body.vscode-reduce-motion .setupSettingsTable > tbody > tr:hover:not(:active) { + background-color: transparent; + color: var(--colorNeutralForeground1); +} diff --git a/src/webviews/documentdb/localQuickStart/localQuickStartController.test.ts b/src/webviews/documentdb/localQuickStart/localQuickStartController.test.ts new file mode 100644 index 000000000..86732e54d --- /dev/null +++ b/src/webviews/documentdb/localQuickStart/localQuickStartController.test.ts @@ -0,0 +1,58 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { settingsKeys } from '../../../settingsKeys'; +import { openAppWebview } from '../../_integration/openAppWebview'; +import { openLocalQuickStartWebview } from './localQuickStartController'; + +const settings = vi.hoisted(() => new Map()); + +vi.mock('vscode', () => ({ + ViewColumn: { Active: 1 }, + Uri: { joinPath: vi.fn() }, + l10n: { t: (message: string): string => message }, +})); +vi.mock('../../../extensionVariables', () => ({ + ext: { context: { extensionUri: {} } }, +})); +vi.mock('../../../services/SettingsService', () => ({ + SettingsService: { getSetting: vi.fn((key: string) => settings.get(key)) }, +})); +vi.mock('../../../utils/feedbackPermission', () => ({ isFeedbackPermitted: vi.fn(() => false) })); +vi.mock('../../_integration/openAppWebview', () => ({ + openAppWebview: vi.fn(() => ({ + onDisposed: vi.fn(), + panel: { dispose: vi.fn() }, + })), +})); +vi.mock('./wizardTelemetry', () => ({ + createWizardSession: vi.fn(() => ({ id: 'session' })), + reportWizardClosed: vi.fn(), +})); + +describe('openLocalQuickStartWebview', (): void => { + beforeEach((): void => { + settings.clear(); + vi.clearAllMocks(); + }); + + it.each([ + [undefined, false], + [true, true], + ])('reads hover opt-out %s when the panel opens', (setting, expected): void => { + if (setting !== undefined) { + settings.set(settingsKeys.disableHighlightOnHover, setting); + } + + openLocalQuickStartWebview({ id: 'quick-start' }); + + expect(openAppWebview).toHaveBeenCalledWith( + expect.objectContaining({ + config: expect.objectContaining({ disableHighlightOnHover: expected }), + }), + ); + }); +}); diff --git a/src/webviews/documentdb/localQuickStart/localQuickStartController.ts b/src/webviews/documentdb/localQuickStart/localQuickStartController.ts index ddd921474..1434c4977 100644 --- a/src/webviews/documentdb/localQuickStart/localQuickStartController.ts +++ b/src/webviews/documentdb/localQuickStart/localQuickStartController.ts @@ -8,6 +8,8 @@ import { type DeepLinkTelemetry } from '../../../deepLinks/deepLinkTelemetry'; import { API } from '../../../DocumentDBExperiences'; import { ext } from '../../../extensionVariables'; import { type InstanceState, type QuickStartWizardPhase } from '../../../services/localQuickStart/quickStartTypes'; +import { SettingsService } from '../../../services/SettingsService'; +import { settingsKeys } from '../../../settingsKeys'; import { isFeedbackPermitted } from '../../../utils/feedbackPermission'; import { type AppWebviewController, openAppWebview } from '../../_integration/openAppWebview'; import { type RouterContext } from './localQuickStartRouter'; @@ -16,6 +18,8 @@ import { createWizardSession, reportWizardClosed } from './wizardTelemetry'; export type LocalQuickStartConfigurationType = { id: string; feedbackPermitted?: boolean; + /** Applied only when the panel opens, like other webview configuration settings. */ + disableHighlightOnHover?: boolean; /** Instance status at open time, so the first render already knows which step and guard to show. */ initialInstanceState?: InstanceState; initialInstanceMissing?: boolean; @@ -64,7 +68,11 @@ export function openLocalQuickStartWebview( title: vscode.l10n.t('Your own DocumentDB'), webviewName: 'localQuickStart', panelViewType: 'vscode-documentdb-local-quick-start', - config: { ...initialData, feedbackPermitted: isFeedbackPermitted() }, + config: { + ...initialData, + feedbackPermitted: isFeedbackPermitted(), + disableHighlightOnHover: SettingsService.getSetting(settingsKeys.disableHighlightOnHover) ?? false, + }, context: trpcContext, viewColumn: vscode.ViewColumn.Active, icon: {