Skip to content

feat: create segment from CSV drawer - #8283

Draft
Zaimwa9 wants to merge 1 commit into
mainfrom
feat/create-segment-from-csv
Draft

feat: create segment from CSV drawer#8283
Zaimwa9 wants to merge 1 commit into
mainfrom
feat/create-segment-from-csv

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor
  • 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

Adds the "New Segment — from a CSV list" drawer behind the segment sources modal, and makes the sources modal config-driven instead of hardcoded.

Flag-driven sources. The modal now reads its cards from the JSON value of the create_segment_with_external_sources flag:

[
  { "active": true, "name": "csv", "visible": true },
  { "active": false, "name": "amplitude", "visible": true },
  { "active": false, "name": "mixpanel", "visible": true },
  { "active": false, "name": "adobe_journey_manager", "visible": true }
]

visible: false hides a card, active: false renders it as a Beta fake door, active: true makes it real (currently only CSV has an implementation — an active source without one safely stays a fake door). Array order controls display order. Copy and icons stay in the frontend. Flag enabled with an empty or invalid value falls back to the manual drawer.

CSV drawer.

  • Client-side CSV parsing (quoted fields, CRLF, BOM)
  • Optional header row
  • Identifier column selection with a highlighted 5-row preview
  • Ignored-row warnings (empty/duplicate) and a blocking error when a column yields no identifiers
  • Submission is wired in the follow-up PR

How did you test this code?

Unit tests for the CSV parser/extractor (common/utils/__tests__/csv.test.ts). Manually:

  1. Set the JSON value above on the create_segment_with_external_sources flag and enable it.
  2. Segments → Create Segment: modal shows the cards; non-active sources show the Beta chip and the request-access flow.
  3. Click "From a CSV list" (active): the drawer opens; upload a CSV with/without headers, switch the identifier column, and check the preview, warnings, and the empty-column blocking error.
  4. Disable the flag or set the value to []: the button opens the manual drawer directly.

@Zaimwa9 Zaimwa9 added the front-end Issue related to the React Front End Dashboard label Aug 13, 2026
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview Aug 13, 2026 1:56pm
flagsmith-frontend-staging Ready Ready Preview Aug 13, 2026 1:56pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Aug 13, 2026 1:56pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a5877f7e-2ba2-4a9d-9426-ce0a0d02345f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

feature New feature or request 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