Skip to content

Import people and companies from CSV with mapping, preview and duplicate review - #72

Open
Pallavikumarimdb wants to merge 2 commits into
Noveum:mainfrom
Pallavikumarimdb:feat/csv-import-review
Open

Pallavikumarimdb wants to merge 2 commits into
Noveum:mainfrom
Pallavikumarimdb:feat/csv-import-review

Conversation

@Pallavikumarimdb

@Pallavikumarimdb Pallavikumarimdb commented Oct 10, 2026 •

Copy link
Copy Markdown

What changes

Introduces reviewed CSV contact and company imports with column mapping, preview, duplicate collision review, and final summaries. Registered as shared business operations in packages/operations/catalog.ts (preview_csv_import and import_contacts_csv) ensuring complete parity across the UI and MCP assistants, and recording submission provenance under contact_import_batches.

Closes #41

How you know it works

  • Fixtures & Volume: Evaluated against tests/fixtures/fictional-contacts.csv containing 271 fictional rows across multiple companies with valid, invalid, and duplicate records.
  • Backend & Operations: tests/csv-import.test.ts (12 tests) covers:
    • Header detection and RFC 4180 parsing with multiline and quote support
    • 271-row preview summary, collision categorization, and validation breakdown
    • Preventing silent merges: strict rejection with PERSON_EXISTS or COMPANY_EXISTS when skipDuplicates: false
    • Atomic import: successfully importing 264 valid contacts with skipDuplicates: true, creating people, companies, relationships, and recording provenance attribution
    • Authorization & permissions: cross-organization isolation, product access enforcement, and assistant execution over MCP via executeMcpOperation
  • UI & Interaction: tests/csv-import-ui.test.tsx (2 tests) covers:
    • Opening the import modal from the view toolbar on /people and /companies
    • Drag-and-drop / file selection, automatic column mapping detection, and manual mapping changes
    • Previewing breakdown cards, switching to the "Duplicates for review" tab, and viewing collision notices
    • Executing import and displaying the final summary breakdown
  • Full Verification Suite:
    • bun run lint passes (0 errors, 0 warnings)
    • bun run typecheck passes (0 errors)
    • bun run test passes (146 test files, 1311 tests passed)

Screenshots

image image image
  • Import modal dialog with product relationship selector and drag-and-drop zone
  • Auto-detected column mapping table
  • Preview stat cards (Total, Valid, Duplicates, Invalid) with dedicated "Duplicates for review" tab
  • Final import summary card displaying created people, companies, and skipped duplicates

Checklist

  • bun run verify passes (lint, licenses, types, tests, build, public smoke test)
  • bun run test:files passes if I touched the file library
  • New behaviour has a test that fails without the change
  • Business operations are defined in packages/operations/catalog.ts, so HTTP and MCP stay in step
  • Interface strings are in packages/i18n/translations/en.json
  • Migrations were generated with bun run db:generate and exercised locally (or none were needed)
  • No real contacts, message bodies, credentials or uploaded files are included
  • Docs updated if setup, configuration or behaviour changed

Limitations

  • The current implementation supports RFC 4180 comma-delimited CSVs up to 2MB request payload size (5,000,000 character string limit).
  • Duplicate

@github-actions

Copy link
Copy Markdown

Thanks for your first pull request to Gravity.

bun run verify runs the same checks as CI, so running it before you push
saves a review round. If you touched business logic, the
reviewer will look for a test that covers another organization, a restricted
product member or a private conversation owner.

A maintainer will review this soon. Ask anything on the thread.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e807b1ae-7d99-48e7-a1c9-d911f0e0bd0a

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions github-actions Bot added area: ui Workspace views, dialogs, inspector and command menu area: core Domain services and the operation registry i18n Interface strings and translations tests Test suites and test infrastructure labels Oct 10, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 10, 2026

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

area: core Domain services and the operation registry area: ui Workspace views, dialogs, inspector and command menu documentation Improvements or additions to documentation i18n Interface strings and translations tests Test suites and test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import people and companies from CSV with mapping, preview and duplicate review

1 participant