Repository navigation
feat(collection): allow preventing the removal of specific items - #4680
Draft
Spuffynism wants to merge 2 commits into
Draft
Spuffynism wants to merge 2 commits into
Spuffynism wants to merge 2 commits into
Conversation
✅ 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. |
Contributor
Release PreviewThis PR would bump 2 package versions if it were merged and released from Patch
Minor
|
Contributor
|
Live demo of your latest successful build available here: |
Spuffynism
marked this pull request as ready for review
October 29, 2026 16:36
Spuffynism
requested review from
FelixBlaisThon and
GermainBergeron
and removed request for
a team
October 29, 2026 16:36
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The public custom-layout interface omits the new removal callbacks, causing type errors, and the changeset lacks the package bump needed to publish the updated documentation.
2 open issues
What changed in this PR
This PR adds per-item removal controls to Plasma’s Collection, allowing protected items to remain while other items can still be removed and new items added.
Changes:
- Adds
allowRemove,removeDisabledTooltip, and an accessibleremoveLabel. - Applies removal controls across column-based and legacy layouts.
- Adds unit tests, documentation, a Storybook example, and a minor-release changeset.
| File | Description |
|---|---|
packages/storybook/src/components/forms-and-inputs/array/Collection.stories.tsx |
Demonstrates protecting an account-owner item. |
packages/storybook/src/components/forms-and-inputs/array/Collection.mdx |
Adds removal-control guidance and the demo. |
packages/mantine/src/components/Collection/layouts/vertical-layout/VerticalLayoutBody.tsx |
Supports per-item removal controls and tooltips. |
packages/mantine/src/components/Collection/layouts/shared/RemoveButton.tsx |
Displays disabled tooltips and configurable labels. |
packages/mantine/src/components/Collection/layouts/shared/layoutConstants.ts |
Adds internal removal-policy callback types. |
packages/mantine/src/components/Collection/layouts/shared/itemRenderer.tsx |
Resolves and forwards each item’s removal state. |
packages/mantine/src/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.tsx |
Passes removal callbacks to shared rendering. |
packages/mantine/src/components/Collection/CollectionItem.tsx |
Supports tooltips in legacy item rendering. |
packages/mantine/src/components/Collection/CollectionContext.ts |
Shares the accessible remove label. |
packages/mantine/src/components/Collection/CollectionColumn.types.ts |
Exposes removal tooltips in cell context. |
packages/mantine/src/components/Collection/Collection.tsx |
Defines and connects the new public props. |
packages/mantine/src/components/Collection/__tests__/CollectionWithColumns.spec.tsx |
Tests protected items in both column layouts. |
packages/mantine/src/components/Collection/__tests__/Collection.spec.tsx |
Tests labels, removal restrictions, and tooltips. |
packages/llms/src/components/Collection.md |
Documents the new props and interaction states. |
.changeset/quiet-owls-remove.md |
Describes the feature for a Mantine minor release. |
Review effort: Balanced
Spuffynism
marked this pull request as draft
October 29, 2026 16:46
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Proposed Changes
LENS-5983 DS-689
Some collections contain items that must stay in the list, while the others remain removable and new items can still be added.
Collectioncould only allow or prevent removal for every item at once.allowRemoveandremoveDisabledTooltipfollow the existingallowAdd/addDisabledTooltippair.Potential Breaking Changes
None.
Acceptance Criteria