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

[Card section carousel] Discuss how to avoid adoptors setting too large number of cards per page #4940

Closed
asudoh opened this issue Jan 20, 2021 · 7 comments
Assignees
Labels
dev Needs some dev work
Milestone

Comments

@asudoh
Copy link
Contributor

asudoh commented Jan 20, 2021

The problem

While <dds-carousel> sets the default number of cards per page that best suits the available viewport width, <dds-carousel> also allows our adaptors to specify arbitrary number of cards per page, via page-size attribute. It caused weird UI caused by extreme page-size, as #4918 and #4919 reports.

The solution

This issue is to discuss how to prevent such misconfiguration. A couple of options I can rattle off are:

  1. Define the maximum number of cards per page for different breakpoints, and ignore any page-size attribute value that exceeds that maximum number
  2. Define several sets of number of cards per page (see below) and have adaptors use such set instead of having them directly set the page size

(Just example of 2., the actual numbers should be determined by design team)

Configuration Number of cards per page for sm breakpoint md lg
SMALL 2 4 6
DEFAULT 1 2 3
LARGE 1 1 2

CC @jeffchew @kennylam @oliviaflory

@asudoh
Copy link
Contributor Author

asudoh commented Jan 20, 2021

@RobertaJHahn We have short-term (band-aid) fix for #4918 and #4919 already (#4921) so that January release doesn't have to wait for the resolution of this issue, FYI.

@RobertaJHahn RobertaJHahn changed the title Discuss how to avoid adaptors setting too large number of cards per page Discuss how to avoid adoptors setting too large number of cards per page Jan 21, 2021
@oliviaflory
Copy link
Contributor

My thoughts:

The maximum number of cards or images sort of depends on how many columns of the grid the adopter is using. Adding some examples of my thinking here... I don't know if this is too complicated to achieve in storybook?

16 columns used on desktop view

Configuration Number of Cards for sm breakpoint Md LgMax
Default 1 2 4
Large 1 1 2

Screen Shot 2021-01-21 at 10 31 32 AM

Screen Shot 2021-01-21 at 10 31 39 AM

12 columns used on desktop view

Configuration Number of Cards for sm breakpoint Md LgMax
Default 1 2 3

Screen Shot 2021-01-21 at 10 31 48 AM

8 columns used on desktop view

Configuration Number of Cards for sm breakpoint Md LgMax
Default 1 1 2
Large 1 1 1

Screen Shot 2021-01-21 at 10 32 00 AM

Screen Shot 2021-01-21 at 10 31 54 AM

@asudoh
Copy link
Contributor Author

asudoh commented Jan 21, 2021

Thanks @oliviaflory for your thoughts! Sounds that rather than preventing our adaptor from using too many cards per page, we want to provide good set of number (of cards per page) as (Storybook) examples. Is it correct?

@oliviaflory
Copy link
Contributor

I think so @asudoh, and based on our explorations above, the maximum number or cards per page doesn't exceed 4 (in desktop) at this point.

@asudoh asudoh self-assigned this Jan 22, 2021
@asudoh asudoh added this to the Sprint 21-02 milestone Jan 22, 2021
asudoh added a commit to asudoh/ibm-dotcom-library that referenced this issue Jan 22, 2021
Adds a couple of stories, one takes up 12 Carbon grid cells (of `lg`
and beyond breakpoint) at the right, and another takes up 8 Carbon grid
cells at the center.

Also adds knobs to select alternate number of cards per page, for those
stories/breakpoints combinations.

Refs carbon-design-system#4940.
kodiakhq bot pushed a commit that referenced this issue Feb 2, 2021
### Related Ticket(s)

Refs #4940.

### Description

Adds a couple of stories, one takes up 12 Carbon grid cells (of `lg` and beyond breakpoint) at the right, and another takes up 8 Carbon grid cells at the center.

Also adds knobs to select alternate number of cards per page, for those stories/breakpoints combinations.

### Changelog

**New**

- Stories for `<dds-carousel>`, one takes up 12 Carbon grid cells (of `lg` and beyond breakpoint) at the right, and another takes up 8 Carbon grid cells at the center.
- Knobs to select alternate number of cards per page.
IgnacioBecerra pushed a commit to IgnacioBecerra/ibm-dotcom-library that referenced this issue Feb 22, 2021
…-system#4974)

### Related Ticket(s)

Refs carbon-design-system#4940.

### Description

Adds a couple of stories, one takes up 12 Carbon grid cells (of `lg` and beyond breakpoint) at the right, and another takes up 8 Carbon grid cells at the center.

Also adds knobs to select alternate number of cards per page, for those stories/breakpoints combinations.

### Changelog

**New**

- Stories for `<dds-carousel>`, one takes up 12 Carbon grid cells (of `lg` and beyond breakpoint) at the right, and another takes up 8 Carbon grid cells at the center.
- Knobs to select alternate number of cards per page.
@JennySanchez
Copy link

@JennySanchez
Copy link

FYI: @asudoh Adding this conversation to the "DDS Team Huddle 2021-03-02" for group discussion

@oliviaflory oliviaflory changed the title Discuss how to avoid adoptors setting too large number of cards per page [Card section carousel] Discuss how to avoid adoptors setting too large number of cards per page Mar 2, 2021
@shixiedesign
Copy link
Contributor

Discussed this issue during Team Huddle time today. The decisions are to simply remove knobs and remove any storybook entires that suggests the component will be used with different number of cards per page.

@RobertaJHahn RobertaJHahn added the dev Needs some dev work label Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Needs some dev work
Projects
None yet
Development

No branches or pull requests

5 participants