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

refactor(sbb-dialog): introduce inner components and header animation #2231

Merged
merged 67 commits into from
Apr 10, 2024

Conversation

dauriamarco
Copy link
Contributor

@dauriamarco dauriamarco commented Nov 24, 2023

BEGIN_COMMIT_OVERRIDE
fix(sbb-dialog): fix accessibility with option to hide the header on scroll

BREAKING CHANGE: The sbb-dialog component now needs the dedicated inner elements sbb-dialog-title, sbb-dialog-content, and sbb-dialog-actions. Use these components to respectively provide a title, a content and, optionally, a footer with an action group. Moreover, the full-screen variant (which occurred when no title was provided to the dialog) has been removed. To achieve a full-screen overlay, please use the new sbb-overlay component.
As a migration help, consider the following example. Old: <sbb-dialog title-content="Title"><p>Dialog content.</p><sbb-action-group slot="action-group">...</sbb-action-group></sbb-dialog>.
New: <sbb-dialog><sbb-dialog-title>Title</sbb-dialog-title><sbb-dialog-content><p>Dialog content</p></sbb-dialog-content><sbb-dialog-actions>...</sbb-dialog-actions></sbb-dialog>.
Previously, a full-screen dialog was displayed if no title was provided to the dialog component:
<sbb-dialog><p>Dialog content.</p></sbb-dialog>. To achieve the same, it is now mandatory to use the sbb-overlay component: <sbb-overlay><p>Overlay content.</p></sbb-overlay>.
END_COMMIT_OVERRIDE

Closes #2019

BREAKING CHANGE: The sbb-dialog component now supports the dedicated inner elements sbb-dialog-title, sbb-dialog-content, and sbb-dialog-actions. Use these components to respectively provide a title, a content and, optionally, a footer with an action group. Moreover, the full-screen variant (which occurred when no title was provided to the dialog) has been removed. To achieve a full-screen overlay, please use the sbb-overlay component.
This was the previous implementation:

<sbb-dialog title-content="Title">
  <p>Dialog content.</p>
  <sbb-action-group slot="action-group">...</sbb-action-group>
</sbb-dialog>

This is the new implementation:

<sbb-dialog>
  <sbb-dialog-title>Title</sbb-dialog-title>
  <sbb-dialog-content>Dialog content</sbb-dialog-content>
  <sbb-dialog-actions>...</sbb-dialog-actions>
</sbb-dialog>

Previously, a full-screen dialog was displayed if no title was provided to the dialog component:

<sbb-dialog>
  <p>Dialog content.</p>
</sbb-dialog>

It is now possible to use an sbb-overlay component to display the same variant:

<sbb-overlay>
  <p>Overlay content.</p>
</sbb-overlay>

@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2023

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (main@6315899). Click here to learn what that means.

Files Patch % Lines
src/components/core/dom/breakpoint.ts 85.71% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2231   +/-   ##
=======================================
  Coverage        ?   93.18%           
=======================================
  Files           ?      309           
  Lines           ?    25307           
  Branches        ?     2056           
=======================================
  Hits            ?    23582           
  Misses          ?     1693           
  Partials        ?       32           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot requested a deployment to preview-pr2231 November 25, 2023 22:02 In progress
@dauriamarco dauriamarco marked this pull request as draft November 27, 2023 08:09
@dauriamarco dauriamarco marked this pull request as ready for review November 27, 2023 11:36
@dauriamarco dauriamarco force-pushed the feat/dialog-header-hide-animation branch 2 times, most recently from 804100f to 8ae6662 Compare November 27, 2023 11:45
@github-actions github-actions bot requested a deployment to preview-pr2231 November 27, 2023 11:54 In progress
@dauriamarco dauriamarco force-pushed the feat/dialog-header-hide-animation branch from 8ae6662 to f8814bf Compare November 28, 2023 11:57
@github-actions github-actions bot requested a deployment to preview-pr2231 November 28, 2023 12:05 In progress
Copy link
Contributor

@jeripeierSBB jeripeierSBB 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 addressing this!
Code looks ok so far, but testing it in real life, the initial scrolling looks buggy for me as it forces the user to scroll down at least the height of the header. Is this really intended?

Please also wait for approval of @mcilurzo

src/components/dialog/dialog.scss Outdated Show resolved Hide resolved
src/components/dialog/dialog.scss Outdated Show resolved Hide resolved
src/components/dialog/dialog.stories.ts Outdated Show resolved Hide resolved
src/components/dialog/dialog.ts Outdated Show resolved Hide resolved
@dauriamarco
Copy link
Contributor Author

Thanks for addressing this! Code looks ok so far, but testing it in real life, the initial scrolling looks buggy for me as it forces the user to scroll down at least the height of the header. Is this really intended?

Please also wait for approval of @mcilurzo

@jeripeierSBB Yes, I know what you mean, but I have already shown it to Manuel and it is fine with him. But if you want we can show it to him again and discuss it, although I can't think of any other possible alternatives at the moment.

@dauriamarco dauriamarco force-pushed the feat/dialog-header-hide-animation branch from f8814bf to 1242542 Compare December 12, 2023 15:06
@jeripeierSBB jeripeierSBB self-requested a review December 12, 2023 15:30
Copy link
Contributor

@jeripeierSBB jeripeierSBB left a comment

Choose a reason for hiding this comment

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

From coding perspective it looks good for me :). Not sure, but if Manuel really is aware of, maybe we can accept it like it is. Maybe a second opinion of @kyubisation?

@dauriamarco dauriamarco force-pushed the feat/dialog-header-hide-animation branch 5 times, most recently from 0700430 to bac5d1c Compare December 15, 2023 23:39
@github-actions github-actions bot requested a deployment to preview-pr2231 December 18, 2023 10:35 In progress
@dauriamarco dauriamarco force-pushed the feat/dialog-header-hide-animation branch from 9a40e4b to c6984bd Compare December 18, 2023 15:10
@github-actions github-actions bot requested a deployment to preview-pr2231 December 18, 2023 15:21 In progress
@github-actions github-actions bot requested a deployment to preview-pr2231 December 19, 2023 10:24 In progress
@jeripeierSBB
Copy link
Contributor

We would like to discuss with @mcilurzo if there is the need of a property to opt out of the header hiding feature. potentially providing a breakpoint range from where it stops or starts... to be discussed.

@dauriamarco dauriamarco force-pushed the feat/dialog-header-hide-animation branch from fae5632 to f30bb00 Compare December 19, 2023 17:53
@dauriamarco dauriamarco force-pushed the feat/dialog-header-hide-animation branch from 15fea8d to e37dea0 Compare April 4, 2024 08:38
@dauriamarco dauriamarco force-pushed the feat/dialog-header-hide-animation branch from 63a9d68 to bff75f2 Compare April 4, 2024 09:06
@github-actions github-actions bot temporarily deployed to preview-pr2231 April 4, 2024 09:15 Inactive
@jeripeierSBB jeripeierSBB removed the pr: blocked Pull request is blocked either for merging or reviewing label Apr 8, 2024
@github-actions github-actions bot temporarily deployed to preview-pr2231 April 8, 2024 12:16 Inactive
src/components/dialog/dialog-content/readme.md Outdated Show resolved Hide resolved
src/components/dialog/dialog-title/dialog-title.ts Outdated Show resolved Hide resolved
src/components/dialog/dialog-title/readme.md Show resolved Hide resolved
src/components/dialog/dialog-title/readme.md Outdated Show resolved Hide resolved
src/components/dialog/dialog/dialog.ts Outdated Show resolved Hide resolved
src/components/dialog/dialog/dialog.ts Outdated Show resolved Hide resolved
src/components/dialog/dialog/dialog.ts Outdated Show resolved Hide resolved
src/components/dialog/dialog/readme.md Outdated Show resolved Hide resolved
src/storybook/pages/home/home--logged-in.stories.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to preview-pr2231 April 10, 2024 07:57 Inactive
@github-actions github-actions bot temporarily deployed to preview-pr2231 April 10, 2024 08:15 Inactive
@github-actions github-actions bot temporarily deployed to preview-pr2231 April 10, 2024 09:05 Inactive
@github-actions github-actions bot temporarily deployed to preview-pr2231 April 10, 2024 10:49 Inactive
Copy link
Contributor

@jeripeierSBB jeripeierSBB 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!!

@github-actions github-actions bot added pr: lead review approved Pull request has been approved by a lead review and removed pr: lead review required A lead review is required for this pull request labels Apr 10, 2024
@jeripeierSBB jeripeierSBB merged commit 159f536 into main Apr 10, 2024
36 checks passed
@jeripeierSBB jeripeierSBB deleted the feat/dialog-header-hide-animation branch April 10, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: lead review approved Pull request has been approved by a lead review pr: peer review approved Pull request has been approved by a peer review pr: ux review approved Pull request has been approved by a ux review preview-available
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: SBB-Dialog Content is not scrollable / accessible
7 participants