feat(atomic): add disable-collapse attribute to breadbox components#7577
feat(atomic): add disable-collapse attribute to breadbox components#7577alexprudhomme wants to merge 1 commit into
Conversation
Add a `disable-collapse` boolean attribute to `atomic-breadbox` and `atomic-commerce-breadbox` that prevents breadcrumbs from collapsing into a single row with a '+ N' show more button. When set, all breadcrumbs are always displayed in a wrapping layout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 57b463d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Tip All tests passed and all changes approved!🟢 UI Tests: 356 tests unchanged |
@coveo/atomic
@coveo/atomic-hosted-page
@coveo/atomic-legacy
@coveo/atomic-react
@coveo/auth
@coveo/bueno
@coveo/create-atomic
@coveo/create-atomic-component
@coveo/create-atomic-component-project
@coveo/create-atomic-result-component
@coveo/create-atomic-rollup-plugin
@coveo/headless
@coveo/headless-react
@coveo/shopify
commit: |
There was a problem hiding this comment.
Pull request overview
Adds an opt-out for the breadbox overflow/collapsing behavior so consumers can force all breadcrumbs to remain visible (wrapping) without the “+ N / show more” UI.
Changes:
- Added
disable-collapseboolean attribute toatomic-breadboxandatomic-commerce-breadbox, skipping ResizeObserver-based overflow logic when enabled. - Updated rendering logic to omit show-more/show-less controls when
disable-collapseis set. - Added unit tests covering the non-collapsing behavior for both components, plus a changeset for
@coveo/atomic.
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 |
|---|---|
| packages/atomic/src/components/search/atomic-breadbox/atomic-breadbox.ts | Adds disable-collapse prop and bypasses collapse/overflow logic + hides show more/less UI when enabled. |
| packages/atomic/src/components/search/atomic-breadbox/atomic-breadbox.spec.ts | Adds tests verifying all breadcrumbs remain visible and wrapping is used when disable-collapse is enabled. |
| packages/atomic/src/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.ts | Adds disable-collapse prop and bypasses collapse/overflow logic + hides show more/less UI when enabled. |
| packages/atomic/src/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.spec.ts | Adds tests verifying all breadcrumbs remain visible and wrapping is used when disable-collapse is enabled. |
| .changeset/breadbox-disable-collapse.md | Declares a minor release for @coveo/atomic documenting the new attribute. |
d9fa430 to
57b463d
Compare
| i18n: this.bindings.i18n, | ||
| }, | ||
| })} | ||
| ${this.disableCollapse |
There was a problem hiding this comment.
Can't we wrap that in a single ternary?
KIT-5702
Problem
From a Discuss post (SUPPORT-00137506): a client wants selected facets to always be displayed in full in the breadbox. They don't want the "+1" / "Show more" button to appear when longer facet values are selected.
The
atomic-breadboxandatomic-commerce-breadboxcomponents always collapse breadcrumbs into a single row with a "+ N" show more button when they overflow. There is no property to disable this behavior, and CSS workarounds don't work because the overflow detection and hiding is JavaScript-based (display: noneon<li>elements).Solution
Added a
disable-collapseboolean attribute to bothatomic-breadboxandatomic-commerce-breadboxcomponents.+ N"Show more" button (current behavior).When
disable-collapseis set:isCollapsedstate is initialized tofalse(wrapping layout)ResizeObserveris not created (no overflow detection needed)adaptBreadcrumbs()method is a no-opUsage: