Skip to content

Conversation

@GrabowskiM
Copy link
Contributor

🎫 Issue IBX-10758

Related PRs:

Description:

For QA:

Documentation:

@GrabowskiM GrabowskiM requested review from a team and Copilot October 20, 2025 07:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements an overflow list component for the Ibexa design system that automatically manages the display of list items based on available container width. When items exceed the container width, they are hidden and a "more" indicator shows the count of hidden items.

  • Adds a new OverflowList Twig component with validation and template generation
  • Implements TypeScript functionality for dynamic item hiding/showing based on container resize
  • Updates ESLint configuration to allow specific magic numbers used in the overflow logic

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/lib/Twig/Components/OverflowList.php New Twig component class with props validation and template property generation
src/bundle/Resources/views/themes/standard/design_system/components/overflow_list.html.twig Twig template for rendering the overflow list with item and "more" templates
src/bundle/Resources/public/ts/init_components.ts Component initialization registration for overflow list instances
src/bundle/Resources/public/ts/components/oveflow_list.ts Main TypeScript implementation with resize handling and item visibility management
eslint.config.mjs ESLint configuration update to allow specific magic numbers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@GrabowskiM GrabowskiM force-pushed the IBX-10758-overflow-list branch from 09b0932 to 145c418 Compare October 20, 2025 07:02
@GrabowskiM GrabowskiM force-pushed the IBX-10758-overflow-list branch from 1cefefd to 6d7a86e Compare October 21, 2025 14:58
@GrabowskiM GrabowskiM force-pushed the IBX-10758-overflow-list branch from 6c73782 to e3d6e0a Compare October 23, 2025 10:31
item: this.getTemplate('item'),
itemMore: this.getTemplate('item_more'),
};

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

private getItems(getOnlyVisible = false, withOverflow = true): HTMLDivElement[] {
const itemsSelector = `:scope > *${getOnlyVisible ? ':not([hidden])' : ''}`;
const items = Array.from(this._itemsNode.querySelectorAll<HTMLDivElement>(itemsSelector));

Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: WDYT about changing to this? then no need to create an additional string, and it looks a bit more readable.

let items = [];
if(getOnlyVisible) {
	items = Array.from(this._itemsNode.querySelectorAll(':scope > *:not([hidden])'))
} else {
 	items = Array.from(this._itemsNode.children);
}

}

public rerender() {
let stopRecalculating = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let stopRecalculating = true;
let stopRecalculating = true;

item: '',
itemMore: '',
};

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change


if (hiddenCount > 0) {
const tempMoreItem = document.createElement('div');
tempMoreItem.innerHTML = this._templates.itemMore.replace('{{ hidden_count }}', hiddenCount.toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tempMoreItem.innerHTML = this._templates.itemMore.replace('{{ hidden_count }}', hiddenCount.toString());
tempMoreItem.innerHTML = this._templates.itemMore.replace('{{ hidden_count }}', hiddenCount.toString());

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants