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

List Component with Dynamic Overflow Handling #556

Closed
AlexVelezLl opened this issue Feb 22, 2024 · 4 comments
Closed

List Component with Dynamic Overflow Handling #556

AlexVelezLl opened this issue Feb 22, 2024 · 4 comments
Assignees
Labels
P2 - normal Priority: Nice to have product: Studio Relevant to a specific issue in Studio TAG: ux update

Comments

@AlexVelezLl
Copy link
Member

Product

Kolibri, Studio, KDS.

Desired behavior

Create a new generic component that renders an horizontal list that automatically renders a "show more" component if any items overflow the container.

This should be managed as a renderless component that receives a slot to render the list items, and a slot to render the "show more" component. And provide a way to render divider elements.

I think a good way of hanlding this is that the component receives a list of items, and then each item is passed as a prop to a #item slot. And having another #more slot that renders the "see more" component, and that this slot receives a list of the overflowed items. One idea for including dividers is that they are objects within the items list that have a type: "divider" attribute that is consistent with the way dividers are handled in the KDropdownMenu.

The Value Add

This component can be used in multiple places:

  1. We can create a more general version of the TabsWithOverflow component in Kolibri, which has some flaws with the outline of the items when navigating with the keyboard.
  2. We can use it for rendering the HorizontalNavBarWithOverflow in Kolibri.
  3. We can use it for rendering the new responsive palette menu of the studio usability enhancements project Studio#3423.
  4. In the future we can support different types of preferences about which items to hide when overflowing, and hide items at the beginning instead of the latests, until they fit in the container. This way we could use it to render componentes like KBreadcrumbs in KDS.
@AlexVelezLl AlexVelezLl added P2 - normal Priority: Nice to have product: Studio Relevant to a specific issue in Studio TAG: ux update Component: A new component labels Feb 22, 2024
@AlexVelezLl AlexVelezLl self-assigned this Feb 22, 2024
@MisRob
Copy link
Member

MisRob commented Feb 22, 2024

@AlexVelezLl Thank you for all work on this, it will be so useful.

We can create a more general version of the TabsWithOverflow component in Kolibri, which has some flaws with the outline of the items when navigating with the keyboard.

This would ideally be integrated into KTabsList itself as its default behavior as it's expected user experience in any tabs. Currently, tabs wrap into more lines which is no good. That means no need to make it into KTabsListWithOverflow or add a prop to configure it etc. Whenever you'd use KTabsList (and therefore KTabs as well), it would just work in this way with available space.

@MisRob
Copy link
Member

MisRob commented Feb 22, 2024

@AlexVelezLl I appreciate the direction towards using slots to feed the component with items and menu. It will help with flexibility and scaling so in this context, I consider it better than providing it with an array of items via prop.

@AlexVelezLl
Copy link
Member Author

This would ideally be integrated into KTabsList itself as its default behavior as it's expected user experience in any tabs.

Yes! I agree, I just cited the component since that was where the logic that handled the overflow was. But yes, I saw that for this we had to use the new KListWithOverflow inside the KTabsList

@AlexVelezLl
Copy link
Member Author

Implemented in #552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 - normal Priority: Nice to have product: Studio Relevant to a specific issue in Studio TAG: ux update
Projects
None yet
Development

No branches or pull requests

2 participants