Skip to content

feat(collection): allow preventing the removal of specific items - #4680

Draft
Spuffynism wants to merge 2 commits into
masterfrom
collection-item-removable
Draft

Spuffynism wants to merge 2 commits into
masterfrom
collection-item-removable

Conversation

@Spuffynism

@Spuffynism Spuffynism commented Oct 29, 2026 •

Copy link
Copy Markdown

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. Collection could only allow or prevent removal for every item at once.

allowRemove and removeDisabledTooltip follow the existing allowAdd / addDisabledTooltip pair.

Potential Breaking Changes

None.

Acceptance Criteria

  • The proposed changes are covered by unit tests
  • The potential breaking changes are clearly identified
  • A changeset is added for releasable changes, following CONTRIBUTING.md
  • README.md is adjusted to reflect the proposed changes (if relevant)

@svcsnykcoveo

svcsnykcoveo commented Oct 29, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Release Preview

This PR would bump 2 package versions if it were merged and released from master.

Patch

Package Next
@coveord/plasma-llms 60.3.3

Minor

Package Next
@coveord/plasma-mantine 61.6.0

@Spuffynism Spuffynism changed the title Add per-item removability to Collection feat(collection): allow preventing the removal of specific items Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Live demo of your latest successful build available here:

@Spuffynism
Spuffynism marked this pull request as ready for review October 29, 2026 16:36
Copilot AI balanced review requested due to automatic review settings October 29, 2026 16:36
@Spuffynism
Spuffynism requested a review from a team as a code owner October 29, 2026 16:36
@Spuffynism
Spuffynism requested review from FelixBlaisThon and GermainBergeron and removed request for a team October 29, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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 accessible removeLabel.
  • 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

Comment thread .changeset/quiet-owls-remove.md Resolved
@Spuffynism
Spuffynism marked this pull request as draft October 29, 2026 16:46

This branch has not been deployed

No deployments
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.

3 participants