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

feat(design): improve sidebar component #2569

Merged
merged 29 commits into from
Dec 14, 2023
Merged

feat(design): improve sidebar component #2569

merged 29 commits into from
Dec 14, 2023

Conversation

xelaint
Copy link
Member

@xelaint xelaint commented Sep 22, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

  1. Sidebar is missing focus trapping. Users currently need to tab through the page to move focus into sidebar.
  2. Sidebar is missing custom header and footer components
  3. No documentation on sidebar features and usage

Fixes: #277, #2554

What is the new behavior?

  1. Add focus trapping behavior to sidebar so that focus moves to the first focusable element within a sidebar, specifically for over and under modes.
  2. Clean up animation and sidebar visibility so that closed sidebars are not focusable.
  3. Create sidebar header that includes a close button that can be hidden, a header title, and custom slotting for additional content. Add closeSidebar() method to header to link closing code to the close button.
  4. Create sidebar footer and add body div so that content in body can overflow naturally while allowing footer to stay at bottom of screen.
  5. Clean up design land sidebar
  6. Extensive documentation on sidebar features and usage

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@xelaint xelaint added package: design @daffodil/design status: awaiting review This PR is awaiting review labels Sep 22, 2023
@xelaint xelaint self-assigned this Sep 22, 2023
@xelaint xelaint requested a review from a team as a code owner September 22, 2023 18:25
@xelaint
Copy link
Member Author

xelaint commented Sep 22, 2023

This PR is dependent on #2570

@damienwebdev damienwebdev changed the title Sidebar updates feat: make sidebar accessible Sep 26, 2023
@damienwebdev damienwebdev changed the title feat: make sidebar accessible feat(design): document and make accessible Sep 26, 2023
@damienwebdev damienwebdev changed the title feat(design): document and make accessible feat(design): make sidebar accessible and document Sep 26, 2023
@damienwebdev damienwebdev changed the title feat(design): make sidebar accessible and document feat(design): make sidebar manage focus and document Sep 26, 2023
Copy link
Member

@damienwebdev damienwebdev left a comment

Choose a reason for hiding this comment

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

Documentation

  • Indicate the optionality of sidebar header and footer in docs.
  • Document class props of sidebar header
  • Document usage of Sidebar nav in various contexts.
  • Figure out the demo of the sidebar nav in different spots.
  • Read docs a few a times.
  • Add documentation about importing BrowserAnimationsModule or NoopAnimationsModule to use sidebar
  • Add documentation of sidebar with anchor scrolling element within body

Bugs

  • Right sidebar has a horizontal scroll bar in over/under
  • Anchor scrolling on page doesn't work because height is set on <daff-sidebar-viewport>. Solution is to set height on <daff-sidebar-viewport> only if sidebar is open and mode is under or over

API Considerations

  • Remove button from header, add slots instead.
  • Replace title with an ngIf

Tests

  • Test focusing code

Legibility

  • Review the clarity of the updateAnimationState in the sidebar viewport

@xelaint xelaint changed the title feat(design): make sidebar manage focus and document feat(design): make sidebar manage focus and add documentation Sep 26, 2023
@xelaint xelaint force-pushed the sidebar-updates branch 2 times, most recently from ea212b4 to 45759b8 Compare November 8, 2023 17:46
@xelaint
Copy link
Member Author

xelaint commented Nov 28, 2023

  • Clean up the sidebar viewport animation legibility
  • Add an example with sticky content
  • Height shift in examples for over and under sidebars
  • Make nav a separate animated block to prevent focus from scrolling page back to top
  • Make over and under sidebars position: fixed
  • Figure out how to stop body scroll when over and under sidebars are open without interferring with body height

@xelaint xelaint added status: wip This PR is WIP. It should be marked as a draft. and removed status: awaiting review This PR is awaiting review labels Dec 7, 2023
@xelaint xelaint force-pushed the sidebar-updates branch 2 times, most recently from 4ef7a3f to ddfcc8f Compare December 11, 2023 21:41
@xelaint
Copy link
Member Author

xelaint commented Dec 11, 2023

@damienwebdev I've updated navDesign to navPlacement and added documentation for this. This PR is good to go after you add your portion of the documentation.

In terms of showing the examples for navPlacement, the styles we have for a daff-sidebar-viewport that is inside of another daff-sidebar-viewport is preventing me from adding a working example of navPlacement="above" within the sidebar docs.

@xelaint xelaint added status: awaiting review This PR is awaiting review and removed status: wip This PR is WIP. It should be marked as a draft. labels Dec 11, 2023
@xelaint xelaint changed the title feat(design): make sidebar manage focus and add documentation feat(design): improve sidebar component Dec 14, 2023
@xelaint xelaint merged commit b2f1e3e into develop Dec 14, 2023
12 of 13 checks passed
@gray-bot gray-bot mentioned this pull request Dec 14, 2023
@xelaint xelaint linked an issue Dec 19, 2023 that may be closed by this pull request
@xelaint xelaint deleted the sidebar-updates branch March 13, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: design @daffodil/design status: awaiting review This PR is awaiting review
Projects
2 participants