From 767c0b74652b3d11e412cccc6d23f3e0860e126b Mon Sep 17 00:00:00 2001 From: tnaum-ms <171359267+tnaum-ms@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:17:35 +0000 Subject: [PATCH 1/9] Initial plan From 7e67e81e1078cddfa42223301c7cba5c89eb19fe Mon Sep 17 00:00:00 2001 From: tnaum-ms <171359267+tnaum-ms@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:41:15 +0000 Subject: [PATCH 2/9] Extend hover highlight opt-out across owned rows Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- .../ai-and-plans/features/data-grid/README.md | 5 +- .../features/data-grid/decisions.md | 6 +- .../ai-and-plans/features/data-grid/design.md | 25 +++++++- docs/user-manual/collection-view-querying.md | 8 ++- .../src/components/StatusList/README.md | 5 ++ .../components/StatusList/StatusList.test.tsx | 18 ++++++ .../src/components/StatusList/StatusList.tsx | 11 +++- .../components/StatusList/StatusList.types.ts | 5 +- .../clusterDashboard/ClusterDashboard.tsx | 6 +- .../clusterDashboard/clusterDashboard.scss | 7 ++- .../clusterDashboardController.test.ts | 20 +++++++ .../clusterDashboardController.ts | 11 +++- .../collectionView/CollectionView.test.tsx | 32 ++++++++++ .../collectionView/CollectionView.tsx | 6 +- .../collectionView/indexesTab/indexesTab.scss | 8 ++- .../ConnectionDiagnostics.tsx | 2 +- .../connectionDiagnostics.scss | 5 ++ .../connectionDiagnosticsController.test.ts | 15 +++++ .../connectionDiagnosticsController.ts | 4 ++ .../connectionDiagnosticsTypes.ts | 2 + .../localQuickStart/LocalQuickStart.tsx | 8 ++- .../localQuickStart/localQuickStart.scss | 5 ++ .../localQuickStartController.test.ts | 58 +++++++++++++++++++ .../localQuickStartController.ts | 11 +++- 24 files changed, 258 insertions(+), 25 deletions(-) create mode 100644 src/webviews/documentdb/localQuickStart/localQuickStartController.test.ts diff --git a/docs/ai-and-plans/features/data-grid/README.md b/docs/ai-and-plans/features/data-grid/README.md index d92a5822d..ec8887825 100644 --- a/docs/ai-and-plans/features/data-grid/README.md +++ b/docs/ai-and-plans/features/data-grid/README.md @@ -64,8 +64,9 @@ 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 and status-list 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..88ccba01d 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 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..b772135a2 100644 --- a/docs/ai-and-plans/features/data-grid/design.md +++ b/docs/ai-and-plans/features/data-grid/design.md @@ -173,9 +173,28 @@ 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 | + +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, expanders and native VS Code context +menus are not row/item tracking and are excluded. 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/user-manual/collection-view-querying.md b/docs/user-manual/collection-view-querying.md index 0bc7451e9..7a3970b65 100644 --- a/docs/user-manual/collection-view-querying.md +++ b/docs/user-manual/collection-view-querying.md @@ -273,9 +273,11 @@ 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 reopen the affected view. The preference +also applies to Indexes, Cluster Dashboard namespace rows, Connection Diagnostics check rows and +Local Quick Start status 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/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md b/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md index 712b908a1..00a59035b 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md @@ -182,6 +182,11 @@ gets a `colorTransparentStrokeInteractive` outline instead, as Fluent's subtle c - **`: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. +- **An explicit `false` is an opt-out, not omission.** It keeps the padding and keyboard-focus + feedback while removing pointer feedback. Omit the prop to get neither behaviour. +- Pointer-only colours use the `--documentdb-status-list-hover-background` and + `--documentdb-status-list-hover-outline` fallbacks, so a VS Code webview can set those inherited + variables from its live reduced-motion body class. - Off by default; turn it on when rows carry an `aside`. ## Details content 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..bff6da19e 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 @@ -205,6 +205,24 @@ describe('StatusList', () => { expect(await rowsMarkup(true)).toBe(await rowsMarkup(false)); }); + test('explicit hover opt-out keeps row focus layout while removing pointer tracking', async () => { + const classes = async (highlight: boolean | undefined): Promise => { + const { root } = await renderSurface( + + + , + ); + return (root.getAttribute('class') ?? '').split(' ').filter(Boolean); + }; + + const inherited = await classes(undefined); + const disabled = await classes(false); + const enabled = await classes(true); + + expect(disabled.length).toBeGreaterThan(inherited.length); + expect(disabled.length).toBeLessThan(enabled.length); + }); + describe('disclosure', () => { const disclosureRow = (extra: Partial = {}): ReactElement => ( 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..65c826485 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx @@ -35,11 +35,17 @@ const useStyles = makeStyles({ }, // `: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, }, }, + highlightRowsOnHover: { + '& > [role="listitem"]:hover:not(:has(:focus-visible))': { + backgroundColor: `var(--documentdb-status-list-hover-background, ${tokens.colorNeutralBackground2})`, + outlineColor: `var(--documentdb-status-list-hover-outline, ${tokens.colorTransparentStrokeInteractive})`, + }, + }, }); /** @@ -80,7 +86,8 @@ export const StatusList = ({
{ /** * 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. + * an `aside` far from their label, so the eye can follow a row across a wide list. An explicit + * `false` keeps the row layout and keyboard-focus feedback while omitting pointer tracking. + * `undefined` omits both behaviours. */ readonly highlightRowsOnHover?: boolean; /** `StatusListItem` rows. */ 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..2e93be2f1 100644 --- a/src/webviews/documentdb/clusterDashboard/clusterDashboard.scss +++ b/src/webviews/documentdb/clusterDashboard/clusterDashboard.scss @@ -804,10 +804,15 @@ $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, + body.vscode-reduce-motion & .namespaceRow:hover { + background-color: transparent; + } + // 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..2a16fe93b 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,12 @@ 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..fb941db8d 100644 --- a/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss +++ b/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss @@ -225,9 +225,11 @@ } /* 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)); + body:not(.vscode-reduce-motion) .collectionView:not(.disableHighlightOnHover) & { + .rowEven:hover > td, + .rowOdd:hover > td { + background-color: var(--vscode-list-hoverBackground, var(--colorSubtleBackgroundHover)); + } } /* 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..d83af76c8 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 + highlightRowsOnHover={configuration.disableHighlightOnHover !== true} > {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..cb69969b3 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,8 @@ 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..e8025af31 100644 --- a/src/webviews/documentdb/localQuickStart/LocalQuickStart.tsx +++ b/src/webviews/documentdb/localQuickStart/LocalQuickStart.tsx @@ -2301,7 +2301,11 @@ export const LocalQuickStart = (): JSX.Element => { const setup = ( <> - + {PROVISION_STAGES.map((stage) => ( { {PROVISION_STAGES.map((stage) => ( 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..285482688 100644 --- a/src/webviews/documentdb/localQuickStart/localQuickStartController.ts +++ b/src/webviews/documentdb/localQuickStart/localQuickStartController.ts @@ -7,7 +7,9 @@ import * as vscode from 'vscode'; import { type DeepLinkTelemetry } from '../../../deepLinks/deepLinkTelemetry'; import { API } from '../../../DocumentDBExperiences'; import { ext } from '../../../extensionVariables'; +import { SettingsService } from '../../../services/SettingsService'; import { type InstanceState, type QuickStartWizardPhase } from '../../../services/localQuickStart/quickStartTypes'; +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,12 @@ 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: { From 3cbc702070d6128886872c420d767e0007038e67 Mon Sep 17 00:00:00 2001 From: tnaum-ms <171359267+tnaum-ms@users.noreply.github.com> Date: Wed, 2 Dec 2026 15:09:15 +0000 Subject: [PATCH 3/9] Finalize hover rollout review fixes Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- .../ai-and-plans/features/data-grid/README.md | 5 ++- .../features/data-grid/decisions.md | 4 +- .../ai-and-plans/features/data-grid/design.md | 21 ++++++---- .../08-hover-opt-out-rollout-review.md | 41 +++++++++++++++++++ docs/user-manual/collection-view-querying.md | 7 ++-- .../vscode-ext-webview-fluentui/CHANGELOG.md | 1 + .../src/components/StatusList/README.md | 6 +-- .../components/StatusList/StatusList.test.tsx | 18 -------- .../src/components/StatusList/StatusList.tsx | 4 +- .../components/StatusList/StatusList.types.ts | 5 +-- .../clusterDashboard/clusterDashboard.scss | 5 ++- .../clusterDashboardController.ts | 3 +- .../collectionView/indexesTab/indexesTab.scss | 11 ++++- .../ConnectionDiagnostics.tsx | 5 ++- .../connectionDiagnostics.scss | 4 +- .../connectionDiagnosticsController.ts | 3 +- .../localQuickStart/LocalQuickStart.tsx | 14 +++++-- .../localQuickStart/localQuickStart.scss | 10 ++++- .../localQuickStartController.ts | 5 +-- 19 files changed, 114 insertions(+), 58 deletions(-) create mode 100644 docs/ai-and-plans/features/data-grid/iterations/08-hover-opt-out-rollout-review.md diff --git a/docs/ai-and-plans/features/data-grid/README.md b/docs/ai-and-plans/features/data-grid/README.md index ec8887825..fc5343b48 100644 --- a/docs/ai-and-plans/features/data-grid/README.md +++ b/docs/ai-and-plans/features/data-grid/README.md @@ -65,8 +65,9 @@ released extension version or completion of the remaining handover gates. - 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 hover-only row/item feedback - in the owned grid, Indexes, dashboard and status-list surfaces, retaining keyboard feedback and - Results selection. A polite Escape hint is frozen once per confirmed grid entry. + 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 88ccba01d..149a191f2 100644 --- a/docs/ai-and-plans/features/data-grid/decisions.md +++ b/docs/ai-and-plans/features/data-grid/decisions.md @@ -224,8 +224,8 @@ not the earlier migration gates. and selection feedback. The setting is `documentDB.accessibility.disableHighlightOnHover`, default `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 rows. Workbench-rendered surfaces and - control/link/tool-tip hover states stay outside its scope. + 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 b772135a2..6e903691c 100644 --- a/docs/ai-and-plans/features/data-grid/design.md +++ b/docs/ai-and-plans/features/data-grid/design.md @@ -183,18 +183,21 @@ tracks the mouse in React state. The owning extension component controls the vis 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 | +| 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, expanders and native VS Code context -menus are not row/item tracking and are excluded. Workbench-owned tree views, quick picks, -notifications and menus are also excluded because the extension does not own their rendering. +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..3677cacdc --- /dev/null +++ b/docs/ai-and-plans/features/data-grid/iterations/08-hover-opt-out-rollout-review.md @@ -0,0 +1,41 @@ +--- +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. + +## 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/user-manual/collection-view-querying.md b/docs/user-manual/collection-view-querying.md index 7a3970b65..e389f6e45 100644 --- a/docs/user-manual/collection-view-querying.md +++ b/docs/user-manual/collection-view-querying.md @@ -274,10 +274,11 @@ A brief polite Escape hint is announced once on entry to Table or Tree, not on e Switching windows alone does not repeat the hint. To suppress hover-only row or item highlights in Collection View, enable -`documentDB.accessibility.disableHighlightOnHover` and reopen the affected view. The preference +`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 rows. Reduced motion suppresses these highlights immediately, even when -the setting is off. Focus, selection, actionable controls and keyboard feedback remain visible. +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/packages/vscode-ext-webview-fluentui/CHANGELOG.md b/packages/vscode-ext-webview-fluentui/CHANGELOG.md index a1d1e9cf1..4afa64f14 100644 --- a/packages/vscode-ext-webview-fluentui/CHANGELOG.md +++ b/packages/vscode-ext-webview-fluentui/CHANGELOG.md @@ -11,6 +11,7 @@ - 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. +- `StatusList` pointer colours and transition now read `--documentdb-status-list-hover-background`, `--documentdb-status-list-hover-outline`, and `--documentdb-status-list-hover-transition`. Consumers can suppress pointer-only feedback live while retaining the same keyboard-focus fill. ## 1.2.0 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 00a59035b..1b689d3d3 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md @@ -182,11 +182,11 @@ gets a `colorTransparentStrokeInteractive` outline instead, as Fluent's subtle c - **`: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. -- **An explicit `false` is an opt-out, not omission.** It keeps the padding and keyboard-focus - feedback while removing pointer feedback. Omit the prop to get neither behaviour. - Pointer-only colours use the `--documentdb-status-list-hover-background` and `--documentdb-status-list-hover-outline` fallbacks, so a VS Code webview can set those inherited - variables from its live reduced-motion body class. + variables from its live reduced-motion body class. The matching + `--documentdb-status-list-hover-transition` variable lets that class remove the colour transition + immediately as well. - Off by default; turn it on when rows carry an `aside`. ## Details content 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 bff6da19e..12ff4cd74 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 @@ -205,24 +205,6 @@ describe('StatusList', () => { expect(await rowsMarkup(true)).toBe(await rowsMarkup(false)); }); - test('explicit hover opt-out keeps row focus layout while removing pointer tracking', async () => { - const classes = async (highlight: boolean | undefined): Promise => { - const { root } = await renderSurface( - - - , - ); - return (root.getAttribute('class') ?? '').split(' ').filter(Boolean); - }; - - const inherited = await classes(undefined); - const disabled = await classes(false); - const enabled = await classes(true); - - expect(disabled.length).toBeGreaterThan(inherited.length); - expect(disabled.length).toBeLessThan(enabled.length); - }); - describe('disclosure', () => { const disclosureRow = (extra: Partial = {}): ReactElement => ( 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 65c826485..840a413d1 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx @@ -29,7 +29,7 @@ const useStyles = makeStyles({ outline: `${tokens.strokeWidthThin} solid transparent`, outlineOffset: `calc(-1 * ${tokens.strokeWidthThin})`, transitionProperty: 'background-color', - transitionDuration: tokens.durationFaster, + transitionDuration: `var(--documentdb-status-list-hover-transition, ${tokens.durationFaster})`, transitionTimingFunction: tokens.curveEasyEase, '@media (prefers-reduced-motion: reduce)': { transitionDuration: '0.01ms' }, }, @@ -86,7 +86,7 @@ export const StatusList = ({
{ /** * 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. An explicit - * `false` keeps the row layout and keyboard-focus feedback while omitting pointer tracking. - * `undefined` omits both behaviours. + * an `aside` far from their label, so the eye can follow a row across a wide list. Off by + * default; the layout and focus feedback are omitted with it. */ readonly highlightRowsOnHover?: boolean; /** `StatusListItem` rows. */ diff --git a/src/webviews/documentdb/clusterDashboard/clusterDashboard.scss b/src/webviews/documentdb/clusterDashboard/clusterDashboard.scss index 2e93be2f1..8c4d92947 100644 --- a/src/webviews/documentdb/clusterDashboard/clusterDashboard.scss +++ b/src/webviews/documentdb/clusterDashboard/clusterDashboard.scss @@ -808,9 +808,10 @@ $content-gutter: var(--spacingHorizontalMNudge); // 10px background-color: var(--colorNeutralBackground1Hover); } - &:is(.disableHighlightOnHover) .namespaceRow:hover, - body.vscode-reduce-motion & .namespaceRow:hover { + &: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. diff --git a/src/webviews/documentdb/clusterDashboard/clusterDashboardController.ts b/src/webviews/documentdb/clusterDashboard/clusterDashboardController.ts index 2a16fe93b..e5925c2c8 100644 --- a/src/webviews/documentdb/clusterDashboard/clusterDashboardController.ts +++ b/src/webviews/documentdb/clusterDashboard/clusterDashboardController.ts @@ -357,8 +357,7 @@ export function openClusterDashboardWebview( initialData = { ...initialData, dashboardSessionId: randomUUID(), - disableHighlightOnHover: - SettingsService.getSetting(settingsKeys.disableHighlightOnHover) ?? false, + disableHighlightOnHover: SettingsService.getSetting(settingsKeys.disableHighlightOnHover) ?? false, }; // Declared before `trpcContext` because that context closes over it, and assigned after, diff --git a/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss b/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss index fb941db8d..e489e0757 100644 --- a/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss +++ b/src/webviews/documentdb/collectionView/indexesTab/indexesTab.scss @@ -225,13 +225,22 @@ } /* Adaptive list hover, on the cells so primary and detail rows respond evenly. */ - body:not(.vscode-reduce-motion) .collectionView:not(.disableHighlightOnHover) & { + :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. */ .rowEven:not(.fieldsDetailRow):active > td, .rowOdd:not(.fieldsDetailRow):active > td { diff --git a/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx b/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx index d83af76c8..5be506517 100644 --- a/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx +++ b/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx @@ -554,7 +554,10 @@ export const ConnectionDiagnostics = (): JSX.Element => { id={CHECKS_LIST_ID} ariaLabel={l10n.t('Connection checks')} statusLabels={words} - highlightRowsOnHover={configuration.disableHighlightOnHover !== true} + highlightRowsOnHover + className={ + configuration.disableHighlightOnHover === true ? 'disableHighlightOnHover' : undefined + } > {panelRowIds.map((id) => ( (settingsKeys.disableHighlightOnHover) ?? false, + disableHighlightOnHover: SettingsService.getSetting(settingsKeys.disableHighlightOnHover) ?? false, }, context, viewColumn: vscode.ViewColumn.Active, diff --git a/src/webviews/documentdb/localQuickStart/LocalQuickStart.tsx b/src/webviews/documentdb/localQuickStart/LocalQuickStart.tsx index e8025af31..f811e0635 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} - +
@@ -2304,7 +2310,8 @@ export const LocalQuickStart = (): JSX.Element => { {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.ts b/src/webviews/documentdb/localQuickStart/localQuickStartController.ts index 285482688..1434c4977 100644 --- a/src/webviews/documentdb/localQuickStart/localQuickStartController.ts +++ b/src/webviews/documentdb/localQuickStart/localQuickStartController.ts @@ -7,8 +7,8 @@ import * as vscode from 'vscode'; import { type DeepLinkTelemetry } from '../../../deepLinks/deepLinkTelemetry'; import { API } from '../../../DocumentDBExperiences'; import { ext } from '../../../extensionVariables'; -import { SettingsService } from '../../../services/SettingsService'; 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'; @@ -71,8 +71,7 @@ export function openLocalQuickStartWebview( config: { ...initialData, feedbackPermitted: isFeedbackPermitted(), - disableHighlightOnHover: - SettingsService.getSetting(settingsKeys.disableHighlightOnHover) ?? false, + disableHighlightOnHover: SettingsService.getSetting(settingsKeys.disableHighlightOnHover) ?? false, }, context: trpcContext, viewColumn: vscode.ViewColumn.Active, From 49ebeb48d183b1a38f192c305f17ec2dd00553aa Mon Sep 17 00:00:00 2001 From: tnaum-ms <171359267+tnaum-ms@users.noreply.github.com> Date: Wed, 2 Dec 2026 15:38:51 +0000 Subject: [PATCH 4/9] Fix C01: neutralize StatusList hover policy API Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- .../08-hover-opt-out-rollout-review.md | 9 +++++++ .../vscode-ext-webview-fluentui/CHANGELOG.md | 2 +- .../src/components/StatusList/README.md | 11 +++++---- .../components/StatusList/StatusList.test.tsx | 24 +++++++++++++++++++ .../src/components/StatusList/StatusList.tsx | 11 +++++---- .../components/StatusList/StatusList.types.ts | 5 ++++ .../ConnectionDiagnostics.tsx | 4 +--- .../connectionDiagnostics.scss | 9 ++++--- .../localQuickStart/LocalQuickStart.tsx | 4 ++-- .../localQuickStart/localQuickStart.scss | 9 ++++--- 10 files changed, 63 insertions(+), 25 deletions(-) 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 index 3677cacdc..b6e374f64 100644 --- 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 @@ -21,6 +21,15 @@ StatusList rows and the Local Quick Start table. No other extension-owned row/it 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. + ## Author decisions - Keep the shared accessibility setting; do not add view-specific settings. diff --git a/packages/vscode-ext-webview-fluentui/CHANGELOG.md b/packages/vscode-ext-webview-fluentui/CHANGELOG.md index 4afa64f14..89559af37 100644 --- a/packages/vscode-ext-webview-fluentui/CHANGELOG.md +++ b/packages/vscode-ext-webview-fluentui/CHANGELOG.md @@ -11,7 +11,7 @@ - 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. -- `StatusList` pointer colours and transition now read `--documentdb-status-list-hover-background`, `--documentdb-status-list-hover-outline`, and `--documentdb-status-list-hover-transition`. Consumers can suppress pointer-only feedback live while retaining the same keyboard-focus fill. +- Added `disableHighlightOnHover` to `StatusList`. It suppresses pointer-only row highlighting without changing the row layout or keyboard-focus fill. 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. ## 1.2.0 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 1b689d3d3..e3b477c57 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md @@ -182,11 +182,12 @@ gets a `colorTransparentStrokeInteractive` outline instead, as Fluent's subtle c - **`: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. -- Pointer-only colours use the `--documentdb-status-list-hover-background` and - `--documentdb-status-list-hover-outline` fallbacks, so a VS Code webview can set those inherited - variables from its live reduced-motion body class. The matching - `--documentdb-status-list-hover-transition` variable lets that class remove the colour transition - immediately as well. +- `disableHighlightOnHover` keeps the row layout and keyboard-focus feedback while omitting only + pointer highlighting. This is useful for a setting read when a panel opens. +- 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. - Off by default; turn it on when rows carry an `aside`. ## Details content 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..54da23e3f 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( @@ -205,6 +217,18 @@ describe('StatusList', () => { expect(await rowsMarkup(true)).toBe(await rowsMarkup(false)); }); + test('disableHighlightOnHover removes pointer styles but keeps keyboard-focus styles', async () => { + const { root } = await renderSurface( + + + , + ); + + const styles = stylesFor(root); + expect(styles).toContain(':has(:focus-visible)'); + expect(styles).not.toContain(':hover'); + }); + describe('disclosure', () => { const disclosureRow = (extra: Partial = {}): ReactElement => ( 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 840a413d1..323efcb48 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx @@ -29,7 +29,7 @@ const useStyles = makeStyles({ outline: `${tokens.strokeWidthThin} solid transparent`, outlineOffset: `calc(-1 * ${tokens.strokeWidthThin})`, transitionProperty: 'background-color', - transitionDuration: `var(--documentdb-status-list-hover-transition, ${tokens.durationFaster})`, + transitionDuration: `var(--status-list-row-hover-transition, ${tokens.durationFaster})`, transitionTimingFunction: tokens.curveEasyEase, '@media (prefers-reduced-motion: reduce)': { transitionDuration: '0.01ms' }, }, @@ -42,8 +42,8 @@ const useStyles = makeStyles({ }, highlightRowsOnHover: { '& > [role="listitem"]:hover:not(:has(:focus-visible))': { - backgroundColor: `var(--documentdb-status-list-hover-background, ${tokens.colorNeutralBackground2})`, - outlineColor: `var(--documentdb-status-list-hover-outline, ${tokens.colorTransparentStrokeInteractive})`, + backgroundColor: `var(--status-list-row-hover-background, ${tokens.colorNeutralBackground2})`, + outlineColor: `var(--status-list-row-hover-outline, ${tokens.colorTransparentStrokeInteractive})`, }, }, }); @@ -70,6 +70,7 @@ export const StatusList = ({ ariaLabel, statusLabels, highlightRowsOnHover, + disableHighlightOnHover, children, className, ...rest @@ -87,7 +88,9 @@ export const StatusList = ({ className={mergeClasses( styles.list, highlightRowsOnHover === true ? styles.highlightRows : undefined, - highlightRowsOnHover === true ? styles.highlightRowsOnHover : undefined, + highlightRowsOnHover === true && disableHighlightOnHover !== true + ? styles.highlightRowsOnHover + : undefined, className, )} role="list" 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 605b020d5..0b3683668 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 @@ -29,6 +29,11 @@ export interface StatusListProps extends ComponentPropsWithoutRef<'div'> { * default; the layout and focus feedback are omitted with it. */ readonly highlightRowsOnHover?: boolean; + /** + * Suppress pointer-only row highlighting while retaining the row layout and keyboard-focus + * feedback from `highlightRowsOnHover`. + */ + readonly disableHighlightOnHover?: boolean; /** `StatusListItem` rows. */ readonly children: ReactNode; } diff --git a/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx b/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx index 5be506517..6ee6d5d1f 100644 --- a/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx +++ b/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx @@ -555,9 +555,7 @@ export const ConnectionDiagnostics = (): JSX.Element => { ariaLabel={l10n.t('Connection checks')} statusLabels={words} highlightRowsOnHover - className={ - configuration.disableHighlightOnHover === true ? 'disableHighlightOnHover' : undefined - } + disableHighlightOnHover={configuration.disableHighlightOnHover === true} > {panelRowIds.map((id) => ( { ariaLabel={l10n.t('Setup progress')} statusLabels={stageStatusLabels} highlightRowsOnHover - className={configuration.disableHighlightOnHover === true ? 'disableHighlightOnHover' : undefined} + disableHighlightOnHover={configuration.disableHighlightOnHover === true} > {PROVISION_STAGES.map((stage) => ( { ariaLabel={l10n.t('Completed setup steps')} statusLabels={stageStatusLabels} highlightRowsOnHover - className={configuration.disableHighlightOnHover === true ? 'disableHighlightOnHover' : undefined} + disableHighlightOnHover={configuration.disableHighlightOnHover === true} > {PROVISION_STAGES.map((stage) => ( tbody > tr:hover:not(:active), From 09b838022c5010e6ecb0425543ffec994e1ca7dd Mon Sep 17 00:00:00 2001 From: tnaum-ms <171359267+tnaum-ms@users.noreply.github.com> Date: Wed, 2 Dec 2026 16:27:13 +0000 Subject: [PATCH 5/9] Fix C02: bump webview Fluent UI package Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- .../iterations/08-hover-opt-out-rollout-review.md | 3 +++ .../features/webview-fluentui-package/README.md | 7 +++++-- package-lock.json | 2 +- packages/vscode-ext-webview-fluentui/CHANGELOG.md | 6 ++++-- packages/vscode-ext-webview-fluentui/package.json | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) 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 index b6e374f64..b0a9c4959 100644 --- 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 @@ -30,6 +30,9 @@ retaining row layout and keyboard focus. Its CSS customization points use compon `--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. 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..cb5403a43 100644 --- a/docs/ai-and-plans/features/webview-fluentui-package/README.md +++ b/docs/ai-and-plans/features/webview-fluentui-package/README.md @@ -152,12 +152,15 @@ 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 `1.4.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 `1.4.0` adds an explicit `StatusList.disableHighlightOnHover` control and neutral +custom properties for pointer-only row hover colors and transition. See the +[package changelog](../../../../packages/vscode-ext-webview-fluentui/CHANGELOG.md#140). The earlier `1.1.0` changes include: @@ -168,7 +171,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 prepared `1.3.0` and `1.4.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/package-lock.json b/package-lock.json index 8e82121a6..de3ec675a 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": "1.4.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 89559af37..aa95af062 100644 --- a/packages/vscode-ext-webview-fluentui/CHANGELOG.md +++ b/packages/vscode-ext-webview-fluentui/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.4.0 + +- Added `disableHighlightOnHover` to `StatusList`. It suppresses pointer-only row highlighting without changing the row layout or keyboard-focus fill. 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. + ## 1.3.0 - The `@fluentui/react-components` peer accepts both 9.74.x and 9.75.1 through 9.75.x. @@ -11,8 +15,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. -- Added `disableHighlightOnHover` to `StatusList`. It suppresses pointer-only row highlighting without changing the row layout or keyboard-focus fill. 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. - ## 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/package.json b/packages/vscode-ext-webview-fluentui/package.json index e4aed2376..17fbffbf3 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": "1.4.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", From bf1758b393fc433822740f5dce055da49fab8ae8 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 22:36:20 +0000 Subject: [PATCH 6/9] Replace StatusList hover flags with explicit row highlight modes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/ai-and-plans/README.md | 2 +- .../webview-fluentui-package/README.md | 13 ++++--- .../webview-fluentui-package/design.md | 4 ++ package-lock.json | 2 +- .../vscode-ext-webview-fluentui/CHANGELOG.md | 5 ++- .../vscode-ext-webview-fluentui/README.md | 3 +- .../vscode-ext-webview-fluentui/package.json | 2 +- .../src/components/StatusList/README.md | 23 ++++++----- .../components/StatusList/StatusList.test.tsx | 39 ++++++++----------- .../src/components/StatusList/StatusList.tsx | 17 ++++---- .../components/StatusList/StatusList.types.ts | 16 +++----- .../ConnectionDiagnostics.tsx | 3 +- .../localQuickStart/LocalQuickStart.tsx | 6 +-- 13 files changed, 67 insertions(+), 68 deletions(-) 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/webview-fluentui-package/README.md b/docs/ai-and-plans/features/webview-fluentui-package/README.md index cb5403a43..7929ce39b 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,15 +152,16 @@ 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.4.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 `1.4.0` adds an explicit `StatusList.disableHighlightOnHover` control and neutral -custom properties for pointer-only row hover colors and transition. See the -[package changelog](../../../../packages/vscode-ext-webview-fluentui/CHANGELOG.md#140). +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. 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: @@ -171,7 +172,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` and `1.4.0` have 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..c4a5dceab 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,10 @@ 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. + `./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/package-lock.json b/package-lock.json index de3ec675a..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.4.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 aa95af062..97fa32026 100644 --- a/packages/vscode-ext-webview-fluentui/CHANGELOG.md +++ b/packages/vscode-ext-webview-fluentui/CHANGELOG.md @@ -1,8 +1,9 @@ # Changelog -## 1.4.0 +## 2.0.0 -- Added `disableHighlightOnHover` to `StatusList`. It suppresses pointer-only row highlighting without changing the row layout or keyboard-focus fill. 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` 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. ## 1.3.0 diff --git a/packages/vscode-ext-webview-fluentui/README.md b/packages/vscode-ext-webview-fluentui/README.md index f7434024f..4635866ef 100644 --- a/packages/vscode-ext-webview-fluentui/README.md +++ b/packages/vscode-ext-webview-fluentui/README.md @@ -171,7 +171,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 17fbffbf3..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.4.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 e3b477c57..fdb4362f0 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md @@ -168,27 +168,32 @@ 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. +Set on `StatusList` to choose when to highlight a whole row: + +| 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. -- `disableHighlightOnHover` keeps the row layout and keyboard-focus feedback while omitting only - pointer highlighting. This is useful for a setting read when a panel opens. - 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. -- Off by default; turn it on when rows carry an `aside`. ## Details content 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 54da23e3f..8355febee 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 @@ -202,31 +202,26 @@ 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; - }; - - expect(await rowsMarkup(true)).toBe(await rowsMarkup(false)); - }); - - test('disableHighlightOnHover removes pointer styles but keeps keyboard-focus styles', async () => { - const { root } = await renderSurface( - - + 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/); + + await rerender( + + {row} , ); - const styles = stylesFor(root); - expect(styles).toContain(':has(:focus-visible)'); - expect(styles).not.toContain(':hover'); + 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 323efcb48..5f2bc153d 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx @@ -33,6 +33,8 @@ const useStyles = makeStyles({ 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"]:has(:focus-visible)': { @@ -40,8 +42,9 @@ const useStyles = makeStyles({ outlineColor: tokens.colorTransparentStrokeInteractive, }, }, - highlightRowsOnHover: { - '& > [role="listitem"]:hover:not(:has(:focus-visible))': { + 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})`, }, @@ -69,8 +72,7 @@ const useStyles = makeStyles({ export const StatusList = ({ ariaLabel, statusLabels, - highlightRowsOnHover, - disableHighlightOnHover, + rowHighlight = 'none', children, className, ...rest @@ -87,10 +89,9 @@ export const StatusList = ({
{ */ 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 and focus feedback are omitted with it. + * 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; - /** - * Suppress pointer-only row highlighting while retaining the row layout and keyboard-focus - * feedback from `highlightRowsOnHover`. - */ - readonly disableHighlightOnHover?: boolean; + readonly rowHighlight?: 'none' | 'hover' | 'focus' | 'hover-and-focus'; /** `StatusListItem` rows. */ readonly children: ReactNode; } @@ -63,7 +57,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/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx b/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx index 6ee6d5d1f..8645f1708 100644 --- a/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx +++ b/src/webviews/documentdb/connectionDiagnostics/ConnectionDiagnostics.tsx @@ -554,8 +554,7 @@ export const ConnectionDiagnostics = (): JSX.Element => { id={CHECKS_LIST_ID} ariaLabel={l10n.t('Connection checks')} statusLabels={words} - highlightRowsOnHover - disableHighlightOnHover={configuration.disableHighlightOnHover === true} + rowHighlight={configuration.disableHighlightOnHover === true ? 'focus' : 'hover-and-focus'} > {panelRowIds.map((id) => ( { {PROVISION_STAGES.map((stage) => ( { {PROVISION_STAGES.map((stage) => ( Date: Wed, 2 Dec 2026 22:57:35 +0000 Subject: [PATCH 7/9] Protect StatusList roles and document the 2.0 migration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../webview-fluentui-package/README.md | 3 ++- .../webview-fluentui-package/design.md | 4 ++- .../vscode-ext-webview-fluentui/CHANGELOG.md | 2 ++ .../vscode-ext-webview-fluentui/README.md | 25 +++++++++++++++++++ .../src/components/StatusList/README.md | 7 ++++-- .../components/StatusList/StatusList.test.tsx | 13 ++++++++++ .../src/components/StatusList/StatusList.tsx | 2 +- .../components/StatusList/StatusList.types.ts | 9 ++++--- .../components/StatusList/StatusListItem.tsx | 2 +- .../src/components/StatusList/index.ts | 1 + .../src/components/index.ts | 1 + .../type-tests/statusListContract.ts | 15 +++++++++++ 12 files changed, 75 insertions(+), 9 deletions(-) create mode 100644 packages/vscode-ext-webview-fluentui/type-tests/statusListContract.ts 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 7929ce39b..71ab1329b 100644 --- a/docs/ai-and-plans/features/webview-fluentui-package/README.md +++ b/docs/ai-and-plans/features/webview-fluentui-package/README.md @@ -159,7 +159,8 @@ details-content components, an aside slot and optional row highlighting. It also `@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. It also adds neutral custom properties +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). 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 c4a5dceab..e0e981860 100644 --- a/docs/ai-and-plans/features/webview-fluentui-package/design.md +++ b/docs/ai-and-plans/features/webview-fluentui-package/design.md @@ -39,7 +39,9 @@ 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. +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 diff --git a/packages/vscode-ext-webview-fluentui/CHANGELOG.md b/packages/vscode-ext-webview-fluentui/CHANGELOG.md index 97fa32026..127d8be6c 100644 --- a/packages/vscode-ext-webview-fluentui/CHANGELOG.md +++ b/packages/vscode-ext-webview-fluentui/CHANGELOG.md @@ -4,6 +4,8 @@ - **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 diff --git a/packages/vscode-ext-webview-fluentui/README.md b/packages/vscode-ext-webview-fluentui/README.md index 4635866ef..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 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 fdb4362f0..6b91e0252 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md @@ -172,7 +172,10 @@ the far end of a wide list is hard to match to its row; use `rowHighlight` to he ## `rowHighlight` -Set on `StatusList` to choose when to highlight a whole row: +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 | | --------------------- | -------------------- | ------------------------------------- | @@ -399,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 8355febee..6166570dd 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 @@ -55,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( 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 5f2bc153d..c531903e2 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/StatusList.tsx @@ -94,9 +94,9 @@ export const StatusList = ({ (rowHighlight === 'focus' || rowHighlight === 'hover-and-focus') && styles.focusHighlight, className, )} - role="list" aria-label={ariaLabel} {...rest} + role="list" > {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 739788d98..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; /** @@ -27,12 +30,12 @@ export interface StatusListProps extends ComponentPropsWithoutRef<'div'> { * focus, or on either trigger. Defaults to `none`. Controls keep their own focus indicators * in every mode. */ - readonly rowHighlight?: 'none' | 'hover' | 'focus' | 'hover-and-focus'; + 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; /** 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(); From 46097a9dce3e00a06b9492965871c702692e3b3b Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 23:03:09 +0000 Subject: [PATCH 8/9] chore: prettier-fix --- .../src/components/StatusList/README.md | 12 ++++++------ .../src/components/StatusList/StatusList.test.tsx | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) 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 6b91e0252..afe0a35f5 100644 --- a/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md +++ b/packages/vscode-ext-webview-fluentui/src/components/StatusList/README.md @@ -177,12 +177,12 @@ Replacing `highlightRowsOnHover` or `disableHighlightOnHover`? See [Migrating to 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 | +| 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` 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 6166570dd..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 @@ -221,7 +221,9 @@ describe('StatusList', () => { ['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 row = ( + Details} /> + ); const { root, rerender } = await renderSurface({row}); const markup = root.innerHTML; expect(stylesFor(root)).not.toMatch(/:hover|:focus-visible/); From 2e3f6475b5f7c13900433a7c5f185b88ab32546a Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Wed, 2 Dec 2026 23:07:01 +0000 Subject: [PATCH 9/9] chore: lint fix --- .../type-tests/statusListContract.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vscode-ext-webview-fluentui/type-tests/statusListContract.ts b/packages/vscode-ext-webview-fluentui/type-tests/statusListContract.ts index 6d4386e25..a6671bfff 100644 --- a/packages/vscode-ext-webview-fluentui/type-tests/statusListContract.ts +++ b/packages/vscode-ext-webview-fluentui/type-tests/statusListContract.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import type { - StatusListItemProps, - StatusListProps, - StatusListRowHighlight, +import { + type StatusListItemProps, + type StatusListProps, + type StatusListRowHighlight, } from '@microsoft/vscode-ext-webview-fluentui/components'; import { expectTypeOf } from 'vitest';