Repository navigation
Conversation
30fdd45 to
abc3f35
Compare
Describe preview media that has no text alternative of its own.
Arrow keys move focus and Enter selects, so the step is announced once.
Steps without a preview are buttons, with the current one marked.
Show an external-link icon and announce that the link opens a new window.
abc3f35 to
21f0bcf
Compare
PanchoutNathan
left a comment
There was a problem hiding this comment.
And to make a pass because the titles aren't necessarily centered with the icons in all the variations; I have the impression that the spacing has changed compared to the old version (and it might be good, but it really takes up a lot of space) + I have the impression that the font of the descriptions has changed, or at least the weight
| useEffect(() => { | ||
| const activeRef = stepRefs.current[currentStep]; | ||
| if (activeRef) { | ||
| activeRef.scrollIntoView({ behavior: "smooth", block: "nearest" }); | ||
| } | ||
| }, [currentStep]); |
There was a problem hiding this comment.
Regression: the scrollIntoView effect is gone. With Next / Previous the focus stays on the button, so react-aria does not scroll the list. In the "Many steps" story, steps 4 to 6 get selected outside the visible area (scrollTop stays at 0).
There was a problem hiding this comment.
indeed, fixed it thanks
| @@ -1,4 +1,18 @@ | |||
| import { useState, useRef, useEffect, useCallback } from "react"; | |||
| import { | |||
There was a problem hiding this comment.
The preview used to depend on the active step; hasPreview is now global. With mixed steps, a step without content shows an empty tabpanel that is focusable (no tabbable child) and announced by screen readers. Do we support this case? If not, we could document it in the story ("all steps or none") and add a dev console.warn, like for initialStep.
| @@ -1 +1 @@ | |||
| import { | |||
There was a problem hiding this comment.
When footerLink only has onClick, we render an <a> without href: no link role, not keyboard-focusable. This was already the case on main, but since the PR touches this element: we could render a <button type="button"> in that case, and keep the <a target="_blank"> (with the icon and "new window") only when there is an href. The button will need a CSS reset (background: none; border: 0; font: inherit; cursor: pointer).
|
Check Tab stops, arrows, Next announcements, footer actions and small screens.
Cover steps, preview content, footer actions, text-only mode and keyboard use.
| .c__onboarding-modal__sr-only { | ||
| position: absolute; | ||
| width: 1px; | ||
| height: 1px; | ||
| padding: 0; | ||
| margin: -1px; | ||
| overflow: hidden; | ||
| clip: rect(0, 0, 0, 0); | ||
| white-space: nowrap; | ||
| border: 0; | ||
| } |
There was a problem hiding this comment.
Can"t this class be generic for all components and named sr-only?
There was a problem hiding this comment.
Or what about .c__offscreen that already exists?
There was a problem hiding this comment.
Or what about .c__offscreen that already exists?
oh yes thanks
| renderOnboarding(); | ||
| const user = userEvent.setup(); | ||
|
|
||
| const compose = await screen.findByRole("tab", { name: "Compose" }); |
There was a problem hiding this comment.
Could you add steps with a description like in this test ? https://github.com/suitenumerique/ui-kit/blob/main/packages/ui-components/e2e/la-suite-support-form/la-suite-support-form.spec.tsx#L75-L113
We try to follow this pattern in new tests, to help understand the test, thx!
| }); | ||
|
|
||
| describe("in text-only mode", () => { | ||
| it("renders the steps as a list of buttons marking the current one", async () => { |
There was a problem hiding this comment.
ditto ( please make a pass on all e2e test )
| <div | ||
| {hasPreview && ( | ||
| <TabPanel | ||
| id={String(currentStep)} |
There was a problem hiding this comment.
During the 200ms fade, the panel is already named after the new step, but it still shows the old content and the old contentAlt. We could maybe derive aria-describedby from currentStep too, so at least name and description match?
There was a problem hiding this comment.
Done, the description now follows the selected step like the name, with a test checking it during the fade 👍
There was a problem hiding this comment.
a bit too verbose to me ^^
There was a problem hiding this comment.
Ditto tests step, we should maybe create a skill in this repo to guide the agents
There was a problem hiding this comment.
Done, every unit and e2e test now has numbered steps. I agree for a skill to guide agents on this format. could be a separate PR ?
There was a problem hiding this comment.
yep surely, not in this one


Purpose
Make the OnboardingModal usable with a keyboard and a screen reader:
contentAltwhen the preview media carries meaningThis replaces fix/a11y-onboarding-tablist, now that the Modal accessibility work is merged.
Proposal
Tabswith manual activation, like the tab variant of the Modal: arrows, Home and End move the focus; Enter, Space or a click selects the step.contentAlton steps, exposed as the panel description.hideContent,ReleaseNoteModal) as a list of buttons witharia-current="step", since there is no panel to control.currentStepSuffixandcontentRegionLabeltranslations.Tests
Unit tests:
src/components/onboarding-modal/index.spec.tsx(9 tests).Manual tests with keyboard and NVDA, in Storybook:
Components/OnboardingModal/Many steps
Components/OnboardingModal/With custom content
contentAltin browse mode.Components/OnboardingModal/Text only