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

SelectPanel2: Use html dialog #4020

Merged
merged 15 commits into from
Dec 20, 2023
Merged

Conversation

siddharthkp
Copy link
Member

@siddharthkp siddharthkp commented Dec 5, 2023

selectpanel-dialog.mov

Alt text: When a SelectPanel is opened, it renders a dialog with a focus trap, you see that the accessibility panel only shows a dialog. Pressing the Esc key closes the panel. Looking at the elements panel, you can see that the dialog is rendered in a top layer


Question for @maximedegreve related to html dialog:

[Answered] We decided clicking outside the panel should not close the panel, we still hold the same opinion? Is there something we can do to make this not feel like a bug? See demo in storybook.

Update: If the user clicks outside, we nudge the user to use the actions in the footer. See demo

Copy link

changeset-bot bot commented Dec 5, 2023

🦋 Changeset detected

Latest commit: a8430d4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@siddharthkp siddharthkp added the skip changeset This change does not need a changelog label Dec 5, 2023
@siddharthkp siddharthkp self-assigned this Dec 5, 2023
Copy link
Contributor

github-actions bot commented Dec 5, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 104.75 KB (0%)
dist/browser.umd.js 105.3 KB (0%)

@maximedegreve
Copy link
Contributor

Hey @siddharthkp

I've previously raised this concern within Slack as well.

The cancel and save buttons are visually clear to indicate confirming is required in the dialog. However, this pattern isn't obvious to everyone, which can be frustrating. This is particularly true for long-time users, who have been on our platform for over 10 years and may find these changes annoying. Additionally, clicking on the background without any response can make it seem as though we've deliberately worsened the user experience, especially for those who are not familiar with those accessible patterns.

The best thing I think we can do now is introducing a gelatine or bounce effect on the buttons when this annoyance occurs? This could be an interesting and engaging way to guide users towards understanding and adopting the new behavior, without giving the impression that we've overlooked something that is an accessibility requirement.

Jellatine.mov

@github-actions github-actions bot temporarily deployed to storybook-preview-4020 December 19, 2023 14:45 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4020 December 19, 2023 15:33 Inactive
@siddharthkp siddharthkp marked this pull request as ready for review December 19, 2023 15:37
@siddharthkp siddharthkp requested review from a team, pksjce and broccolinisoup and removed request for pksjce December 19, 2023 15:37
@siddharthkp siddharthkp removed the skip changeset This change does not need a changelog label Dec 19, 2023
@github-actions github-actions bot temporarily deployed to storybook-preview-4020 December 19, 2023 16:22 Inactive
'::backdrop': {background: 'transparent'},

'& [data-selectpanel-primary-actions]': {
animation: footerAnimationEnabled ? 'selectpanel-gelatine 0.5s linear' : 'none',
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 this feels a little nicer when we speed it up to 350ms

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

Here's a video to compare durations:

animation-duration.mov

Copy link
Contributor

Choose a reason for hiding this comment

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

Love that you actually did this in the end! ❤️

Copy link
Contributor

Choose a reason for hiding this comment

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

I couldn't see it in the code but is it disabled when reduced motion is on?

@mperrotti
Copy link
Contributor

I really like @maximedegreve's suggestion to "highlight" the buttons when somebody tries to close by clicking the background scrim.

I think we should also add this functionality to Dialog. @maximedegreve and other reviewers - how do you feel about this? This doesn't have to be part of this PR - we could create a follow-up issue or PR to do this.

Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

Looks great ✨ - just left a few notes

src/drafts/SelectPanel2/SelectPanel.tsx Show resolved Hide resolved
src/drafts/SelectPanel2/SelectPanel.tsx Show resolved Hide resolved
@siddharthkp siddharthkp added this pull request to the merge queue Dec 20, 2023
Merged via the queue into main with commit c2a53a0 Dec 20, 2023
30 checks passed
@siddharthkp siddharthkp deleted the drafts-selectpanel-html-dialog branch December 20, 2023 15:35
@primer primer bot mentioned this pull request Dec 20, 2023
broccolinisoup added a commit that referenced this pull request Dec 21, 2023
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.

4 participants