Skip to content

fix: address review comments on React 19 migration#6940

Open
talissoncosta wants to merge 7 commits intodeps/upgrade-to-react-19from
fix/react-19-review-fixes
Open

fix: address review comments on React 19 migration#6940
talissoncosta wants to merge 7 commits intodeps/upgrade-to-react-19from
fix/react-19-review-fixes

Conversation

@talissoncosta
Copy link
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to #6764

Addresses all review comments on the React 19 migration PR. Built on top of Wadii's deps/upgrade-to-react-19 branch.

Drag-and-drop (SegmentOverrides):

  • Upgraded from @dnd-kit/core + @dnd-kit/sortable to @dnd-kit/react (newer API with cleaner handle support)
  • Card header is the drag handle — inputs, buttons, and dropdowns remain interactive
  • Vertical axis locked via RestrictToVerticalAxis modifier
  • Removed unused ConfigProvider HOC wrapping
  • Replaced inline styles with CSS classes, used classNames() for className concatenation
  • Fixed unstable sortable IDs (removed array index from ID, added getSegmentId helper)

Tooltip (react-tooltip v5):

  • Restored 500ms show delay (delayShow)
  • Fixed font-size via doubled CSS selector specificity (no !important)
  • Set --rt-opacity: 1 and --rt-transition-show-delay: 0.2s

ChipInput:

  • Close icon now inline with chip text (display: flex; align-items: center)
  • Restored backspace-to-delete behaviour

Shared hook:

  • Extracted useCollapsibleHeight hook from AccordionCard and CollapsibleText
  • Fixes missing rAF cleanup in CollapsibleText

How did you test this code?

Manually tested on staging:

  • Segment overrides: drag-and-drop reordering via header, verified inputs/toggles/actions menu remain interactive
  • Tooltips: verified show delay, font-size, and fade-in transition
  • ChipInput: verified chip layout, close icon alignment, backspace deletion
  • AccordionCard: verified expand/collapse animation on environment metrics summary

talissoncosta and others added 7 commits March 12, 2026 19:11
- Restore shouldCancelStart behaviour for segment override drag-and-drop
  by using a custom PointerSensor that cancels on interactive elements
- Add tooltip show delay (500ms) to match previous fade-in UX
- Replace opacity: 1 !important with react-tooltip v5 CSS custom properties

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The base .chip class was missing display: flex and align-items: center,
causing the close icon to wrap below the chip text. The --sm and --xs
variants already had this styling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The custom ChipInput replacement was missing the backspace key handler
that material-ui-chip-input provided out of the box. Pressing backspace
when the input is empty now removes the last chip.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
react-tooltip v5 applies font-size: 90% by default, shrinking tooltip
text compared to v4. Doubling the selector (.react-tooltip.react-tooltip)
increases specificity to ensure our $font-size-sm is applied.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace @dnd-kit/core + @dnd-kit/sortable + @dnd-kit/utilities with
@dnd-kit/react + @dnd-kit/helpers + @dnd-kit/abstract. The new API
handles transforms automatically, uses handleRef for drag handles,
and RestrictToVerticalAxis modifier for axis locking.

The header area of each segment override card is now the drag handle,
keeping the actions menu and form controls fully interactive.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused ConfigProvider HOC wrapping
- Remove excessive inline zIndex (9999999999)
- Replace inline styles with .drag-handle CSS class
- Use classNames() for className concatenation
- Extract getSegmentId() helper for safe segment ID access
- Simplify Fragment keys to use stable sortId

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shared hook for animating height expand/collapse transitions,
replacing duplicated rAF logic in CollapsibleText and AccordionCard.
Also fixes missing rAF cleanup in CollapsibleText.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@talissoncosta talissoncosta requested a review from a team as a code owner March 13, 2026 01:20
@talissoncosta talissoncosta requested review from Zaimwa9 and removed request for a team March 13, 2026 01:20
@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Mar 13, 2026 1:22am
flagsmith-frontend-staging Ready Ready Preview, Comment Mar 13, 2026 1:22am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Mar 13, 2026 1:22am

Request Review

@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard fix labels Mar 13, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-6940 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-6940 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-e2e:pr-6940 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith:pr-6940 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-6940 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-6940 Finished ✅ Results

@github-actions
Copy link
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  49.4 seconds
commit  f0d66d8
info  🔄 Run: #15283 (attempt 1)

@github-actions
Copy link
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  48.9 seconds
commit  f0d66d8
info  🔄 Run: #15283 (attempt 1)

@github-actions
Copy link
Contributor

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  26.5 seconds
commit  f0d66d8
info  🔄 Run: #15283 (attempt 1)

@github-actions
Copy link
Contributor

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  34.9 seconds
commit  f0d66d8
info  🔄 Run: #15283 (attempt 1)

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

Labels

fix front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant