Skip to content

Conversation

manuhabitela
Copy link
Collaborator

@manuhabitela manuhabitela commented Aug 19, 2025

Context

Some interactive elements are currently not usable with keyboard, or not correctly described for assistive technologies like screen readers. That makes the right panel sometimes impossible to use without a mouse.

Proposed solution

  • Check every interactive element contained in the right panel under the "table" top tab
  • make sure they are keyboard-focusable and keyboard-actionable
  • make sure they have explicit alt text in case of icon buttons or lacking visual context

This PR does not fix everything as some components will require more specific work (like custom selects), but this should include all the rather quick-and-easy fixes.

Has this been tested?

I didn't add specific keyboard-nav tests, not sure it's really valuable on a case by case basis.

  • 👍 yes, I added tests to the test suite
  • 💭 no, because this PR is a draft and still needs work
  • 🙅 no, because this is not relevant here
  • 🙋 no, because I need help

Screenshots / Screencasts

@manuhabitela
Copy link
Collaborator Author

manuhabitela commented Aug 19, 2025

Most stuff in the table config tab should be handled for now. I'll add some code to handle the other table subtabs. And maybe I'll end up here for this PR in order to not have too many unrelated things.

I'll split everything in its own commit to better understand when I'm finished. But these are mostly straight-forward changes.

@manuhabitela manuhabitela force-pushed the creator-panel-kb branch 4 times, most recently from 461be66 to 00050c0 Compare August 21, 2025 13:23
@manuhabitela manuhabitela changed the title Right panel: make most items keyboard-usable Right panel table tab: make most items keyboard-usable Aug 21, 2025
@manuhabitela
Copy link
Collaborator Author

manuhabitela commented Aug 21, 2025

So, this is close to be ready for review I think.

I need to fix some remaining tests and verify a few things manually, but I shouldn't work on any more thing besides that.

Every change is in a contained commit.

Noticeable things:

  • the changes on the mapped fields/visible columns sections ; and the changes on the sort&filter UI, are a bit heavier than the rest. If you think they would be better in other PRs I can split things. But you can already filter out each commit to help on the review.
  • I made the choice to have draggable containers/items render a <ul> and <li>s as I feel it would be a better default. I need to verify this assumption more before continuing, it matches the usage in the right panel but I didn't check everywhere.
  • I noticed what I think is a bug in weaseljs where I stumbled upon an infinite loop. I went around it for now instead of actually fixing something (see commit (right panel) sort item dots menu: prevent infinite loop bug)

@manuhabitela manuhabitela force-pushed the creator-panel-kb branch 3 times, most recently from d19c139 to 56c6cb6 Compare August 26, 2025 15:24
this helps screen reader users correctly understand what the inputs are
for. Without this, they might miss the description of the inputs
depending on how they navigate with their SR.
adding some 'group' roles around … groups of related inputs, help screen
readers users a bit by better understanding the related and unrelated
inputs following each others.
- the grid option checkbox labels were not actually tied to their
inputs. Now they are so that they are correctly vocalized by screen
readers

- add a group role around the section to help SR users
- tie inputs and labels together in the code for better screen reader
support
- make sure we can focus everything with keyboard correctly (before, we
could focus the "expand all rows" checkbox even while it was visually
hidden, now it is disabled and those unfocusable when hidden)
- better expose semantics to screen readers (grouping inputs, labelling
them correctly)
- make sure to correctly explain to screen readers the meaning of the
button visually labelled with the widget name, as it's not obvious what
it does without visual hints
- make sure everything is kb focusable
before this commit, we could not press the space key to trigger the
"open configuration" button of a custom widget (which is in the right
panel). this was because the viewAsCard command, mapped on the space
key, was always enabled.
Now the command is enabled only when we focus the widget, allowing to
correctly use the space key in the right panel for that specific case.
The "mapped fields" (in a form) and the "visible columns" (in a table)
sections in the right panel are can now be correctly navigated through
with keyboard, and expose correct information to screen readers (ie.
icon buttons have alt texts).
- put the keyboard-focus-highlight class in its own variable to prevent
errors
- add the class to simple list items so that more things show their
focus ring when needed by default
the linkSelect menu helper is seemlingly only used by controls
for the chart config in the right panel. With the tabindex
removal, it prevented keyboard users to focus this select
for I guess a reason we can challenge. Lets just make them
kb focusable normally like other selects.
in a few cases, `<li>` tags were rendered as `<div>` children, something
that doesn't make much sense. The containers were actually list
containers, so we might as well use actual `<ul>` els so that screen
reader users get the benefits of it correctly.
these improve screen reader users like a tiny bit when dealing with
things in a draggable list. they better get the relation between
elements in each draggable row, and can navigate through the items
quicker if needed
lots of stuff in the sort and filter UI in the right panel was not
keyboard focusable or hard to understand with a screen reader.

it's still not ideal with a screen reader because there are lots of
interactions, but at least now everything is focusable and correctly
text-labelled.
it seems there is a bug in weasel when a menu is composed of
non-selectable items. If we open a sort item dots menu and try to use
the arrow down/up keys, it goes into an infinite loop.

As a workaround for now, prevent keyboard selection. Not ideal but at
least it doesn't crash.
funny bug: the 'Remove' icon codename was wrongfully passed to the
translation system. When using Grist in French for example, this
resulted in the system trying to find a "Retirer" icon (French
translation for "Remove"). That obviously didn't work and made a gray
square appear in place of a bin icon.
@manuhabitela
Copy link
Collaborator Author

manuhabitela commented Aug 27, 2025

After a bit of manual testing and e2e tests, this is ready for review on my hand 👍

Stumbled upon a small, rather unrelated bug, but allowed myself to include here (see commit (chartview) fix chart field remove icon not working when not in English).

@manuhabitela manuhabitela added the preview Launch preview deployment of this PR label Aug 27, 2025
@manuhabitela manuhabitela moved this from In Progress to Needs Internal Feedback in French administration Board Aug 27, 2025
@manuhabitela manuhabitela removed their assignment Aug 27, 2025
@manuhabitela manuhabitela marked this pull request as ready for review August 27, 2025 15:14
Copy link
Contributor

Deployed commit dd56b596eb88280258b8f8a6200589af02050cbd as https://grist-manuhabitela-grist-core-creator-panel-kb.fly.dev (until 2025-09-26T15:18:37.900Z)

Copy link
Collaborator

@hexaltation hexaltation left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks for all this improvements that gathered together make a big PR :)

@hexaltation hexaltation moved this from Needs Internal Feedback to Needs feedback in French administration Board Sep 2, 2025
@georgegevoian georgegevoian self-requested a review September 3, 2025 18:56
Copy link
Contributor

@georgegevoian georgegevoian left a comment

Choose a reason for hiding this comment

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

Thanks for these improvements @manuhabitela.

Notes so far from testing:

  • Visible/hidden fields appears disabled when editing card layout, but if you change focus to creator panel and use the keyboard to navigate to it, you can still interact with it. (It's intentionally disabled because the card layout editor can't currently reconcile changes made after it was opened.)

cssFieldLabel(dom.text(col.label)),
cssRemoveIcon(
t('Remove'),
'Remove',
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing that!

@manuhabitela manuhabitela moved this from Needs feedback to In Progress in French administration Board Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility gouv.fr preview Launch preview deployment of this PR
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants