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

add a feature for dropdown to stretch out to fullscreen on mobile #65

Merged
merged 16 commits into from
Dec 4, 2024

Conversation

sun-mota
Copy link
Contributor

@sun-mota sun-mota commented Nov 27, 2024

Alaska Airlines Pull Request

Width and Sizing Behavior

  • Width: The auro-dropdown component will automatically consume the full width of its parent container. To make it narrower, you can style the bibSizer part.

  • Styling Options: Only the following styles can be applied to the bib part:

    • width
    • height
    • maxWidth
    • maxHeight

Fullscreen Effect on Mobile View

On mobile view, adding the mobileFullscreenBreakpoint="{breakpoint-token}" will switch the dropdown to fullscreen mode.

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I have performed a self-review of my own update.

Summary by Sourcery

Add a feature to control dropdown fullscreen behavior on mobile devices using a breakpoint attribute, enhance dropdown styling options, and update documentation accordingly.

New Features:

  • Introduce a feature to prevent dropdowns from switching to fullscreen mode on mobile by using the 'mobileFullscreenBreakpoint' attribute.

Enhancements:

  • Enhance dropdown styling by allowing specific styles to be applied to the 'bibSizer' part, including width, height, maxWidth, and maxHeight.

Build:

  • Add a new build script 'build:dropdown-preset' to extract breakpoint variables for dropdown components.

Documentation:

  • Update documentation to include information about the new 'mobileFullscreenBreakpoint' feature and styling options for dropdowns.

Summary by Sourcery

Add a feature to control dropdown fullscreen behavior on mobile devices using a breakpoint attribute, enhance dropdown styling options, and update documentation accordingly.

New Features:

  • Introduce a feature to control dropdown fullscreen behavior on mobile devices using the 'mobileFullscreenBreakpoint' attribute.

Enhancements:

  • Enhance dropdown styling by allowing specific styles to be applied to the 'bibSizer' part, including width, height, maxWidth, and maxHeight.

Build:

  • Add a new build script 'build:dropdown-preset' to extract breakpoint variables for dropdown components.

Documentation:

  • Update documentation to include information about the new 'mobileFullscreenBreakpoint' feature and styling options for dropdowns.

Copy link

sourcery-ai bot commented Nov 27, 2024

Reviewer's Guide by Sourcery

This PR implements a fullscreen dropdown feature for mobile views and refactors the dropdown's sizing behavior. The implementation moves styling control to CSS parts, introduces a new mobile breakpoint feature, and restructures the component's DOM manipulation for better performance.

Class Diagram for AuroDropdown and AuroFloatingUI

classDiagram
  class AuroDropdown {
    +String mobileFullscreenBreakpoint
    +void firstUpdated()
    +void notifyReady()
  }
  class AuroFloatingUI {
    +void mirrorSize(Boolean fullscreen)
    +void position()
    +void handleMobileFullscreen(Boolean isMobile)
    +void updateState()
    +void configure(Element elem)
  }
  AuroDropdown --> AuroFloatingUI : uses
  note for AuroDropdown "Added mobileFullscreenBreakpoint attribute"
  note for AuroFloatingUI "Added methods for handling fullscreen mode"
Loading

File-Level Changes

Change Details Files
Implemented fullscreen mode for mobile view using breakpoint tokens
  • Added mobileFullscreenBreakpoint property to control fullscreen behavior
  • Created handleMobileFullscreen method to manage fullscreen state
  • Added CSS styles for fullscreen mode using fixed positioning
  • Added script to extract breakpoint variables from design tokens
components/dropdown/src/floatingUI.mjs
components/dropdown/src/styles/bibStyles.scss
components/dropdown/src/auro-dropdown.js
components/dropdown/src/scripts/extractBreakpointVariable.mjs
Refactored dropdown sizing and styling mechanism
  • Moved styling control to CSS parts using ::part(bib)
  • Added bibSizer element for size mirroring
  • Implemented size mirroring logic in mirrorSize method
  • Removed inline styles from content container
  • Changed overflow handling to use auto instead of scroll
components/dropdown/src/floatingUI.mjs
components/dropdown/src/auro-dropdown.js
components/dropdown/src/styles/bibStyles.scss
components/dropdown/apiExamples/customDimensions100.html
components/dropdown/apiExamples/customDimensions300.html
Updated documentation to reflect new features and styling approach
  • Added documentation for mobileFullscreenBreakpoint feature
  • Updated width and sizing behavior documentation
  • Added examples showing new styling approach using CSS parts
components/dropdown/demo/api.md
components/dropdown/docs/partials/api.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sun-mota sun-mota linked an issue Nov 27, 2024 that may be closed by this pull request
@sun-mota sun-mota force-pushed the sunMota/dropdown-mobile-fullscreen/#55 branch from 5ceda97 to 7222ccc Compare November 27, 2024 21:52
@sun-mota sun-mota marked this pull request as ready for review November 27, 2024 21:55
@sun-mota sun-mota requested a review from a team as a code owner November 27, 2024 21:55
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @sun-mota - I've reviewed your changes - here's some feedback:

Overall Comments:

  • There are inconsistencies in the documentation - 'mobileFullscreenBreakpoint' vs 'fullscreenOnMobile'. Please standardize on one attribute name throughout the documentation.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

components/dropdown/src/floatingUI.mjs Show resolved Hide resolved
components/dropdown/docs/partials/api.md Outdated Show resolved Hide resolved
components/dropdown/src/floatingUI.mjs Show resolved Hide resolved
components/dropdown/demo/api.min.js Outdated Show resolved Hide resolved
components/dropdown/demo/api.min.js Outdated Show resolved Hide resolved
components/radio/demo/index.min.js Outdated Show resolved Hide resolved
components/radio/demo/index.min.js Outdated Show resolved Hide resolved
components/radio/demo/index.min.js Outdated Show resolved Hide resolved
components/radio/demo/index.min.js Outdated Show resolved Hide resolved
components/radio/demo/index.min.js Outdated Show resolved Hide resolved
@sun-mota sun-mota force-pushed the sunMota/dropdown-mobile-fullscreen/#55 branch from 7222ccc to 80f5af8 Compare November 27, 2024 21:57
@AlaskaAirlines AlaskaAirlines deleted a comment from sourcery-ai bot Nov 27, 2024
@sun-mota sun-mota force-pushed the sunMota/dropdown-mobile-fullscreen/#55 branch from 91afade to 32557f1 Compare November 27, 2024 22:20
Copy link
Member

@jason-capsule42 jason-capsule42 left a comment

Choose a reason for hiding this comment

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

Need to change up how the new attribute is used a bit. I'll schedule some time to pair with you on this.

@sun-mota sun-mota force-pushed the sunMota/dropdown-mobile-fullscreen/#55 branch from 32557f1 to 126a643 Compare December 2, 2024 17:17
@sun-mota
Copy link
Contributor Author

sun-mota commented Dec 2, 2024

@sourcery-ai review

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @sun-mota - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding test coverage for the new mobile fullscreen functionality, particularly around breakpoint handling and size transitions
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

components/dropdown/src/floatingUI.mjs Show resolved Hide resolved
components/dropdown/docs/partials/api.md Show resolved Hide resolved
components/dropdown/src/floatingUI.mjs Outdated Show resolved Hide resolved
components/dropdown/demo/api.min.js Outdated Show resolved Hide resolved
components/dropdown/demo/api.min.js Outdated Show resolved Hide resolved
components/dropdown/demo/index.min.js Outdated Show resolved Hide resolved
components/dropdown/demo/index.min.js Outdated Show resolved Hide resolved
components/dropdown/src/auro-dropdown.js Outdated Show resolved Hide resolved
components/dropdown/src/auro-dropdown.js Outdated Show resolved Hide resolved
components/dropdown/src/auro-dropdown.js Outdated Show resolved Hide resolved
components/dropdown/src/auro-dropdown.js Outdated Show resolved Hide resolved
@sun-mota sun-mota self-assigned this Dec 2, 2024
components/dropdown/src/auro-dropdownBib.js Outdated Show resolved Hide resolved
components/dropdown/demo/api.md Outdated Show resolved Hide resolved
components/dropdown/src/auro-dropdown.js Outdated Show resolved Hide resolved
components/dropdown/src/auro-dropdownBib.js Outdated Show resolved Hide resolved
components/dropdown/src/styles/bibStyles.scss Outdated Show resolved Hide resolved
components/dropdown/src/styles/bibStyles.scss Outdated Show resolved Hide resolved
components/dropdown/src/floatingUI.mjs Outdated Show resolved Hide resolved
@@ -16,6 +16,13 @@
position: relative;
}

#bibSizer {
position: absolute;
z-index: -1;
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this? It's not an element that you can focus, right?

Copy link
Member

Choose a reason for hiding this comment

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

In fact... do we need the pointer events rule either?

Copy link
Contributor Author

@sun-mota sun-mota Dec 3, 2024

Choose a reason for hiding this comment

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

z-index:-1 will help the performance by putting the layer to be the most back so that other layer would get any cursor events first. pointer-events rule would also help the performance for the browser to skip(not remove from the interaction queue) the cursor events on this layer.
IMO, I think adding these ruler wont hurt and rather help a little bit.

components/dropdown/src/styles/bibStyles.scss Show resolved Hide resolved
components/dropdown/src/floatingUI.mjs Show resolved Hide resolved
components/dropdown/src/floatingUI.mjs Outdated Show resolved Hide resolved
components/dropdown/src/floatingUI.mjs Outdated Show resolved Hide resolved
components/dropdown/src/floatingUI.mjs Show resolved Hide resolved
components/dropdown/src/auro-dropdownBib.js Outdated Show resolved Hide resolved
components/dropdown/src/auro-dropdownBib.js Show resolved Hide resolved
components/dropdown/src/auro-dropdown.js Outdated Show resolved Hide resolved
@sun-mota sun-mota force-pushed the sunMota/dropdown-mobile-fullscreen/#55 branch from f90f3a5 to 1f4e69f Compare December 4, 2024 22:07
@sun-mota sun-mota force-pushed the sunMota/dropdown-mobile-fullscreen/#55 branch from 1f4e69f to faa6005 Compare December 4, 2024 23:54
@sun-mota sun-mota merged commit 7bd62f8 into main Dec 4, 2024
4 of 6 checks passed
@sun-mota sun-mota deleted the sunMota/dropdown-mobile-fullscreen/#55 branch December 4, 2024 23:58
@rmenner
Copy link
Contributor

rmenner commented Dec 16, 2024

🎉 This PR is included in version 1.6.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement new mobile redesign
3 participants