Title: feat: export collection items to CSV · Issue #348 · ycode/ycode · GitHub
Open Graph Title: feat: export collection items to CSV · Issue #348 · ycode/ycode
X Title: feat: export collection items to CSV · Issue #348 · ycode/ycode
Description: Feature request Add the ability to export a collection's items to a CSV file from the CMS, mirroring the behavior that existed in the legacy Ycode app. We already support importing collections from CSV — this adds the missing export side...
Open Graph Description: Feature request Add the ability to export a collection's items to a CSV file from the CMS, mirroring the behavior that existed in the legacy Ycode app. We already support importing collections from...
X Description: Feature request Add the ability to export a collection's items to a CSV file from the CMS, mirroring the behavior that existed in the legacy Ycode app. We already support importing collections ...
Opengraph URL: https://github.com/ycode/ycode/issues/348
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: export collection items to CSV","articleBody":"## Feature request\n\nAdd the ability to export a collection's items to a CSV file from the CMS, mirroring the behavior that existed in the legacy Ycode app. We already support **importing** collections from CSV — this adds the missing export side.\n\n## Problem\n\nToday collections can only be imported (`CSVImportDialog`), never exported. There's no way for a user to pull their CMS data out as a CSV — for backup, migration, editing in a spreadsheet, or re-importing elsewhere. The legacy app had this and it's a frequently expected CMS capability.\n\n## How it worked in the legacy app\n\nFor reference, the legacy (Laravel/Vue) implementation:\n\n- An **Export** button in the collection data toolbar (`DataType.vue`), labelled `Export {n}` where `n` reflects the number of selected items.\n- Button is disabled when the collection has no items, and shows a loading spinner while the export runs.\n- It exported either **all items** or, if rows were checked, **only the selected items**.\n- Backend (`CollectionController::exportData`) resolved the full collection (no pagination), built the CSV, stored it temporarily on disk, scheduled deletion after 10 minutes, and returned a `{ name, url }` for download (`downloadExport`).\n- CSV columns used the field display names as headers.\n- **Built-in audit columns were excluded**: `Updated date`, `Created by`, `Updated by`, `Status` (Created date was kept).\n- Value flattening per field type:\n - **Reference** → the referenced item's name field value\n - **Multi reference** → name field values joined by `; `\n - **Link** → the URL string\n\n## Proposed solution\n\nImplement the same flow natively in the Next.js app, reusing what we already have:\n\n- Add an **Export** action in the CMS collection toolbar/UI (`app/(builder)/ycode/components/CMS.tsx`), with optional \"export selected vs. all\" behavior based on checked items.\n- Reuse the existing CSV helpers in `lib/csv-utils.ts` — `rowsToCSV()` and `downloadCSV()` — already used by the redirects settings export, so no new CSV-writing code is needed.\n- Build rows from collection fields + items, applying the same value-flattening rules (reference → name, multi-reference → joined names, link → URL, rich_text → HTML or plain text).\n- Exclude built-in audit columns (`Updated date`, `Created by`, `Updated by`, `Status`) to match legacy output.\n- Name the file after the collection (e.g. `blog.csv`).\n\nSince the export can be generated client-side from already-loaded collection data (or via a thin repository/route fetch for the full set), we likely don't need the legacy's temp-file/storage dance — `downloadCSV()` triggers the browser download directly.\n\n## Open questions\n\n- Export **all items** always, or respect current filters/sorting and selection (selected-only)?\n- For large collections, do we fetch the full set server-side (new route/repository call) or rely on already-loaded paginated data?\n- How should `rich_text` be serialized — HTML, plain text, or raw TipTap JSON? (Import accepts HTML, so HTML round-trips best.)\n- Should asset fields (image/video/etc.) export the public URL?\n\n## Context\n\nWe already ship the import counterpart (`CSVImportDialog`, `collectionImportRepository`, import API routes). This closes the loop. Building blocks (`rowsToCSV`, `downloadCSV`, collection field metadata) already exist in the codebase.","author":{"url":"https://github.com/tristan-mouchet","@type":"Person","name":"tristan-mouchet"},"datePublished":"2026-06-11T13:25:48Z","url":"https://github.com/ycode/ycode/issues/348"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bb98a150-bf05-e8fd-6f67-e545d47d659d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE5A:1314C9:682B57:8BE2CB:6AFE29C8 |
| html-safe-nonce | e82557ee5ffc98bbdeab7d036bca8115b3625c1f46f6f2e186164919f78411a7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTVBOjEzMTRDOTo2ODJCNTc6OEJFMkNCOjZBRkUyOUM4IiwidmlzaXRvcl9pZCI6IjQ1MzU1NDk0Nzc1MzkxMjc3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ab507cf15c0ab30db26ae3df95c8300804774a61f6e3d0cdc4edd42a91742c75 |
| hovercard-subject-tag | issue:4640895101 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ycode/ycode/348/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e08d863f3aa365e50c91cbf489c576f1a88ee30082506e49907762c1dbeb3486/ycode/ycode/issues/348 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e08d863f3aa365e50c91cbf489c576f1a88ee30082506e49907762c1dbeb3486/ycode/ycode/issues/348 |
| og:image:alt | Feature request Add the ability to export a collection's items to a CSV file from the CMS, mirroring the behavior that existed in the legacy Ycode app. We already support importing collections from... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tristan-mouchet |
| hostname | github.com |
| expected-hostname | github.com |
| None | e973f9ec3625f3faad8cac5c2d11a214b7ffe45f3cc563b828459b290ecaeed3 |
| turbo-cache-control | no-preview |
| go-import | github.com/ycode/ycode git https://github.com/ycode/ycode.git |
| octolytics-dimension-user_id | 65892203 |
| octolytics-dimension-user_login | ycode |
| octolytics-dimension-repository_id | 1165452593 |
| octolytics-dimension-repository_nwo | ycode/ycode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1165452593 |
| octolytics-dimension-repository_network_root_nwo | ycode/ycode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1f92c367595b9190e0be293896078033886b1913 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width