Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdvancedTable Keyboard navigation doc update #2698

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

andgen404
Copy link
Contributor

@andgen404 andgen404 commented Feb 11, 2025

📌 Summary

This PR will add more content to the accessibility tab, which includes a video demonstration and documentation.

👀 ----> https://hds-website-git-advanced-table-keyboard-naviga-1680ef-hashicorp.vercel.app/components/table/advanced-table?tab=accessibility

🛠️ Detailed description

This is a follow-up to the work on the Advanced Table documentation. The accessibility tab will include a video and some documentation, giving consumers an overview of keyboard navigation within the Advanced Table component.

🔗 External links

Jira ticket: HDS-4390

Copy link

vercel bot commented Feb 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Mar 10, 2025 2:34pm
hds-website ✅ Ready (Inspect) Visit Preview Mar 10, 2025 2:34pm

@andgen404 andgen404 changed the title Advanced Table Keyboard navigation doc update AdvancedTable Keyboard navigation doc update Feb 11, 2025
@hashibot-hds hashibot-hds added the docs-website Content updates to the documentation website label Feb 11, 2025
Copy link
Contributor

@KristinLBradley KristinLBradley left a comment

Choose a reason for hiding this comment

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

Nice!

shleewhite
shleewhite previously approved these changes Feb 13, 2025
Copy link
Contributor

@shleewhite shleewhite left a comment

Choose a reason for hiding this comment

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

🚢 !

@andgen404 andgen404 marked this pull request as ready for review February 14, 2025 19:11
heatherlarsen
heatherlarsen previously approved these changes Mar 7, 2025
Copy link
Contributor

@heatherlarsen heatherlarsen left a comment

Choose a reason for hiding this comment

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

Left two nitpicks about the images, but otherwise this looks good 👍🏻

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this one missed getting the extra white space added to the bottom.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you may be using this image in two places. That might be okay if they both needed the extra white space, but I don't think the one directly above the "Row selection" section needs it because it's followed by a heading with extra white space built in.

Copy link
Contributor

@jorytindall jorytindall left a comment

Choose a reason for hiding this comment

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

I left a few small comments, there's also quite a few extra returns throughout (I didn't comment on all of them). They probably get stripped out during build, but good for consistency to remove those.

The Advanced Table supports two keyboard interaction modes: Navigation Mode and Action Mode. These modes allow users to move through table data and interact with elements using a keyboard.

### Navigation Mode

Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] There's an extra return in here

Suggested change

When a user tabs into the Advanced Table, the first cell is focused.

![Keyboard focus on the sortable 'Artist' column header with sorting controls active.](/assets/components/table/advanced-table/advanced-table-keyboard-navigation-tab.png)

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change


![Keyboard focus on 'The Beatles' row using the arrow key.](/assets/components/table/advanced-table/advanced-table-keyboard-navigation-arrow-key-down.png =402x*)

<Doc::Badge @type="neutral">Fn</Doc::Badge><Doc::Badge @type="neutral"><Hds::Icon @name="arrow-left" @title="Left arrow" /></Doc::Badge>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll second this, it also might work to just create images of each of these steps (maybe with a little border or differentiation), but up to you.

Arrow keys move focus to cells in the direction of the input. If the table extends beyond the screen, arrow keys allow movement to access hidden columns.

![Keyboard focus on 'The Beatles' row using the arrow key.](/assets/components/table/advanced-table/advanced-table-keyboard-navigation-arrow-key-down.png)

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Move focus to the first cell in the row.

![Keyboard focus on 'The Beatles' row using the arrow key.](/assets/components/table/advanced-table/advanced-table-keyboard-navigation-fn-left.png)

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change


<Doc::Badge @type="neutral">Enter</Doc::Badge>

Press Enter in Navigation Mode to enable Action Mode and interact with elements inside a cell. Focus will move to the first actionable element.
Copy link
Contributor

Choose a reason for hiding this comment

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

You say "inside a cell", but action mode works in any table element (and you use an image of a header in the next example). Should this be more generic?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think Andrew is correct with the current wording - with the advanced table you cant focus anything inside a cell until you press enter. The Advanced Table is by default 1 tab stop (so users can skip past it if they want). When you press enter you focus the first interactive element inside the cell and your focus is trapped within that cell until you press escape.

I agree it would be more consistent to use an image of a header cell here to follow with the rest of the action mode images, but definitely not a blocker to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-website Content updates to the documentation website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants