Skip to content

feat: improve CMS CSV import process#94

Merged
liamwalder merged 12 commits intodevelopfrom
feat/cms-import-improvements
Mar 26, 2026
Merged

feat: improve CMS CSV import process#94
liamwalder merged 12 commits intodevelopfrom
feat/cms-import-improvements

Conversation

@tristan-mouchet
Copy link
Copy Markdown
Collaborator

@tristan-mouchet tristan-mouchet commented Mar 25, 2026

Summary

Improve the CMS CSV import process with better performance, correct item ordering, rich-text image support, and DRY refactoring across import-related code.

Changes

  • Add rich-text image downloading and embedding during CSV import
  • Deduplicate assets by filename before downloading to avoid redundant uploads
  • Compute content_hash before bulk insert to eliminate N sequential update queries
  • Fix manual_order assignment to append imported items after existing ones
  • Preload server-sorted collections with correct order to prevent UI flash
  • Make enrichItemsWithStatus resilient to transient network errors
  • Support includeAssets parameter on items API for returning asset data alongside items
  • Extract getSortParams utility and ErrorBanner component to reduce duplication
  • Increase asset download concurrency to 20 parallel fetches
  • Add proper progress bar with indeterminate state and real-time row counts
  • Prevent dialog close and page reload during active import
  • Filter computed fields from CSV import mapping options

Test plan

  • Import a CSV with image URLs and verify assets are downloaded and linked
  • Import a CSV with rich-text HTML containing <img> tags and verify images appear in CMS items
  • Re-import the same CSV and verify assets are deduplicated (not re-uploaded)
  • Import into a collection that already has items and verify new items appear after existing ones in manual order
  • Sort a collection by ID desc, reload the builder, and verify correct order without flash
  • Close the browser tab during import and verify the warning prevents accidental closure
  • Import a large CSV (50+ rows with images) and verify progress bar updates correctly
  • Verify computed fields (e.g., Status) do not appear in the column mapping step
  • Check links are working on images (when imported or not, for both URLs and Pages)

- Compute content_hash before bulk insert to avoid N update queries
- Fix manual_order to append after existing items during import
- Make enrichItemsWithStatus resilient to transient network errors
- Extract getSortParams utility to deduplicate sort param logic
- Preload server-sorted collections with correct order from start
- Extract ErrorBanner and reuse getMappedFieldIds in import dialog

Made-with: Cursor
@tristan-mouchet tristan-mouchet self-assigned this Mar 25, 2026
@tristan-mouchet tristan-mouchet linked an issue Mar 25, 2026 that may be closed by this pull request
@tristan-mouchet tristan-mouchet added the Improvement Improve existing feature label Mar 25, 2026
@liamwalder liamwalder self-assigned this Mar 26, 2026
@liamwalder liamwalder merged commit a06dc02 into develop Mar 26, 2026
0 of 2 checks passed
@liamwalder liamwalder deleted the feat/cms-import-improvements branch March 26, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement Improve existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: CMS import improvements

2 participants