Skip to content

Add a prop to handle key down on a cell#153

Merged
severo merged 49 commits intomasterfrom
open-cell-with-keyboard
May 10, 2025
Merged

Add a prop to handle key down on a cell#153
severo merged 49 commits intomasterfrom
open-cell-with-keyboard

Conversation

@severo
Copy link
Copy Markdown
Contributor

@severo severo commented May 6, 2025

severo added 30 commits May 5, 2025 22:40
Note that we remove the unused top pending state
@severo severo requested a review from Copilot May 6, 2025 13:22
@severo severo changed the base branch from master to navigate-through-keyboard May 6, 2025 13:22
@severo severo requested review from bleakley and platypii May 6, 2025 13:22
Copy link
Copy Markdown
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 navigation support to various table components by introducing a new prop to handle key down events on cells and updating the navigation context accordingly. Key changes include:

  • Creation and integration of the CellsNavigationContext and corresponding hooks to manage focus and navigation.
  • Updates to TableHeader, RowHeader, TableCorner, Cell, and ColumnHeader components to pass and utilize aria indices and keydown event handlers.
  • Enhancements in HighTable and related tests to support keyboard interactions and assistive navigation.

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/hooks/useCellsNavigation.tsx New hook and context providing keyboard navigation support for table cells.
src/components/TableHeader/TableHeader.tsx & .test.tsx Updated to include ariaRowIndex and correct aria indices for header cells.
src/components/TableCorner/TableCorner.tsx Adjusted to require ariaRowIndex and integrate cell navigation on click.
src/components/RowHeader/RowHeader.tsx Updated to require ariaRowIndex and use cell navigation hook.
src/components/HighTable/HighTable.tsx & .test.tsx Integrated the navigation context; handled scroll focus and cell key down events.
src/components/ColumnResizer/ColumnResizer.tsx Made the resizer keyboard accessible with new aria attributes and key event handling.
src/components/ColumnHeader/ColumnHeader.tsx & .test.tsx Updated to include ariaRowIndex and utilize cell navigation for header clicks.
src/components/Cell/Cell.tsx Added onKeyDown prop and integrated cell navigation for consistent focus behavior.
Files not reviewed (1)
  • src/components/HighTable/HighTable.module.css: Language not supported
Comments suppressed due to low confidence (1)

src/components/ColumnResizer/ColumnResizer.tsx:107

  • [nitpick] Consider making the 'keyboardShiftWidth' value configurable via a component prop instead of being hardcoded. This would allow more flexibility for different use cases and improve maintainability.
if (e.key === 'ArrowRight') { setWidth?.(Math.max(minWidth, width + keyboardShiftWidth)) }

Base automatically changed from navigate-through-keyboard to master May 10, 2025 07:48
@severo severo merged commit 4ca43b7 into master May 10, 2025
10 checks passed
@severo severo deleted the open-cell-with-keyboard branch May 10, 2025 07:56
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.

3 participants