Skip to content

[EuiResizableButton] Export as generic component; Add alignIndicator prop - #7087

Merged
cee-chen merged 15 commits into
elastic:mainfrom
cee-chen:resizable-button-backlog
Aug 17, 2023
Merged

cee-chen merged 15 commits into
elastic:mainfrom
cee-chen:resizable-button-backlog

Conversation

@cee-chen

@cee-chen cee-chen commented Aug 16, 2023 •

Copy link
Copy Markdown
Contributor

Summary

As always, I recommend following along by commit.

QA

Docs

Storybook

General checklist

  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs (using @default if default values are missing) and playground toggles
  • Added documentation
  • Added or updated jest and cypress tests
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine

Copy link
Copy Markdown
Contributor

- I browse Firefox at a 1.25x magnification, so this is particularly noticeable for me 🙈
@cee-chen
cee-chen force-pushed the resizable-button-backlog branch from a01b3ef to e20fc16 Compare August 16, 2023 02:30
- Safari treats focus differently that both Chrome and Firefox do
@cee-chen
cee-chen requested review from a team and breehall August 16, 2023 02:48
@cee-chen
cee-chen marked this pull request as ready for review August 16, 2023 02:48
@kibanamachine

Copy link
Copy Markdown
Contributor

@1Copenut 1Copenut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I looked through the commits one at a time and ran through manual QA as advised. I took the new component for a drive with screen readers, and found one what looks like a bug, and an improvement opportunity for SR-only help text.

  1. The custom resize button kept losing the screen reader cursor when I pressed left_arrow or right_arrow when browsing with Safari + VO. None of the other screen readers or Firefox + VO did this, just Safari. Best way to verify the issue is turn on Safari, turn on VO, and navigate to the drag handle. Then press left or right arrow a few times and it should start announcing the "Demo TS", one letter at a time. This doesn't appear to be happening with existing resizable container handles.
  2. The resizable button helper text say to press left or right, up or down. We've been migrating other helper text to be more explicit and say left arrow or right arrow. Small detail and maybe an improvement ticket.
  3. NVDA and JAWS require users to enter Focus Mode and Forms Mode respectively to use the arrow keys to resize a container. In NVDA, this switch to Focus Mode "chirped" as I expected it because I had to toggle it manually. JAWS also required a manual toggle to Forms Mode, but didn't "chirp" like it normally does when entering Forms Mode. I'm not sure there's an action to take here, but something to keep in mind that we might want to further expand helper text to allude to Forms/Focus mode.

@cee-chen

cee-chen commented Aug 16, 2023 •

Copy link
Copy Markdown
Contributor Author

@1Copenut Thanks for the awesome screen reader testing! Just to clarify, can you confirm whether those issues are also the case in the other EuiResizableContainer examples on the page?

EDIT: 🤦 Sorry, just read the last sentence in your 1. - I guess this question only applies to 3. in that case

@cee-chen
cee-chen requested a review from 1Copenut August 16, 2023 19:18
@cee-chen

Copy link
Copy Markdown
Contributor Author

1. and 2. should be addressed with the last two commits! I'm super unfamiliar w/ the focus/forms mode and I'm not totally sure what to do there - should we skip for now?

@kibanamachine

Copy link
Copy Markdown
Contributor

@1Copenut

Copy link
Copy Markdown
Contributor

I'm super unfamiliar w/ the focus/forms mode and I'm not totally sure what to do there - should we skip for now?

Yes, I think we can skip these for now. NVDA and JAWS have a visual browse mode for traversing pages using arrow keys. When they encounter forms, they drop into Focus (NVDA) or Forms (JAWS) mode that modifies how the arrow keys behave. When you're in Focus/Forms mode, you can use arrows to traverse through a radio group, select options, etc.

Typically screen readers do a good job picking up on what should be in Focus/Forms mode, but sometimes we have controls like these resizable handles that need interacted with in that mode, so users have to manually opt in. It's a typical use pattern, so we can move ahead as we are and if users ask for more clarification, we can extend the help text.

I love Leonie Watson's article Understanding screen reader interaction modes for comparing the modes and refer back to it often.

@1Copenut 1Copenut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 Screen readers are working as expected now. I left a comment about my third point that we can move ahead as we are, with a link to an article about the various modes of travel in NVDA and JAWS. Thanks @cee-chen !

@cee-chen cee-chen changed the title [EuiResizableButton] Export as generic component; Add alignHandle prop [EuiResizableButton] Export as generic component; Add alignIndicator prop Aug 17, 2023
@cee-chen
cee-chen force-pushed the resizable-button-backlog branch from f77733c to 957008b Compare August 17, 2023 02:11
@cee-chen
cee-chen enabled auto-merge (squash) August 17, 2023 02:11
@cee-chen

Copy link
Copy Markdown
Contributor Author

buildkite test this

@kibanamachine

Copy link
Copy Markdown
Contributor

@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

@cee-chen
cee-chen merged commit 8b87849 into elastic:main Aug 17, 2023
@cee-chen
cee-chen deleted the resizable-button-backlog branch August 17, 2023 03:08
breehall added a commit to elastic/kibana that referenced this pull request Aug 23, 2023
`87.1.0` ➡️ `87.2.0`

## [`87.2.0`](https://github.com/elastic/eui/tree/v87.2.0)

- `EuiResizableButton` is now available as a generic top-level export
([#7087](elastic/eui#7087))
- Added new `alignIndicator` prop to `EuiResizableButton`. Defaults to
`center`, and can now additionally be configured to `start` and `end`
([#7087](elastic/eui#7087))
- Updated `useGeneratedHtmlId` hook to use `React.useId` as the source
of unique identifiers when available
([#7095](elastic/eui#7095))

**CSS-in-JS conversions**

- Converted `EuiResizableButton` to Emotion; Removed
`$euiResizableButtonTransitionSpeed` and `$euiResizableButtonSize`
([#7081](elastic/eui#7081))
- Converted `EuiResizableCollapseButton` to Emotion
([#7091](elastic/eui#7091))

---------

Co-authored-by: Cee Chen <[email protected]>
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.

Export the EuiResizable button [EuiResizableContainer] Configurable position for EuiResizableButton indicator

4 participants