fix(frontend): remove @material-ui/core dependency from AccordionCard#7025
fix(frontend): remove @material-ui/core dependency from AccordionCard#7025nielskaspers wants to merge 2 commits intoFlagsmith:mainfrom
Conversation
Replace all @material-ui/core usages with native alternatives: - AccordionCard: replace MUI Collapse with CSS transition-based Collapse component, replace MUI IconButton with project's own Button - EventTextBlocks: replace MUI Collapse with new Collapse component - SegmentSelect: replace MUI SelectProps type import with inline types - ChipInput: replace MUI Chip with native span element Add new lightweight Collapse component using CSS height transitions with the same easing curve as MUI (cubic-bezier(0.4, 0, 0.2, 1)). Remove @material-ui/core from dependencies and overrides in package.json. Fixes Flagsmith#7021
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.
Once credits are available, reopen this pull request to trigger a review.
|
@nielskaspers is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
- Replace material-ui-chip-input with native React implementation - Remove material-ui-chip-input from dependencies - Regenerate package-lock.json to sync with removed @material-ui/core
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| setHeight(0) | ||
| }) | ||
| }) | ||
| } |
There was a problem hiding this comment.
Collapse race condition from uncancelled requestAnimationFrame callbacks
Medium Severity
The else branch (collapsing) schedules nested requestAnimationFrame callbacks that call setHeight(0), but no cleanup function is returned from this branch. If open toggles back to true before those callbacks fire, the stale setHeight(0) will execute during the expand phase, snapping the content to zero height mid-animation. The if branch correctly returns a cleanup to clear its timer, but the else branch's requestAnimationFrame handles are never cancelled via cancelAnimationFrame.
| > | ||
| <IonIcon icon={close} /> | ||
| </span> | ||
| </span> |
There was a problem hiding this comment.
Delete click bubbles up triggering chip click handler
Medium Severity
The MUI Chip component internally called event.stopPropagation() on the delete icon click, preventing the chip's onClick from also firing. The replacement <span> structure nests the delete handler (onClick={handleDelete}) inside the chip's onClick={handleClick}, so clicking delete now triggers both handlers due to event bubbling. This is a behavioral regression from the MUI Chip replacement.
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
|
Thanks for the contribution! Removing However, after smoke testing the branch, we found that the We're currently working on introducing semantic colour tokens and Storybook to the codebase. We're going to close this for now and revisit #7021 once that groundwork is in place, so we can:
Appreciate the effort — the overall approach is sound, it's just a matter of timing. We'll reference your work when we pick this back up. |


Summary
Removes
@material-ui/coreandmaterial-ui-chip-inputdependencies by replacing all MUI components with lightweight alternatives.Issue
Fixes #7021
Changes
Collapsewith a new CSS transition-basedCollapsecomponentIconButtonwith Flagsmith's ownButtoncomponentChipInputwithoutmaterial-ui-chip-inputusing native ReactChipinChipInputwith native<span>elementsSelectPropstype inSegmentSelectwith inline types@material-ui/coreandmaterial-ui-chip-inputfrom dependencies and overridespackage-lock.jsonTesting
@material-ui/coreandmaterial-ui-chip-inputare no longer in dependencies