Title: feat: multi-select assets in the file manager to add many at once · Issue #414 · ycode/ycode · GitHub
Open Graph Title: feat: multi-select assets in the file manager to add many at once · Issue #414 · ycode/ycode
X Title: feat: multi-select assets in the file manager to add many at once · Issue #414 · ycode/ycode
Description: Feature request When picking assets, allow selecting multiple assets at once in the file manager and confirming with a single Add {n} button, instead of picking them one at a time. The most obvious use case is a CMS asset field with mult...
Open Graph Description: Feature request When picking assets, allow selecting multiple assets at once in the file manager and confirming with a single Add {n} button, instead of picking them one at a time. The most obvious...
X Description: Feature request When picking assets, allow selecting multiple assets at once in the file manager and confirming with a single Add {n} button, instead of picking them one at a time. The most obvious...
Opengraph URL: https://github.com/ycode/ycode/issues/414
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: multi-select assets in the file manager to add many at once","articleBody":"## Feature request\n\nWhen picking assets, allow selecting **multiple assets at once** in the file manager and confirming with a single **Add {n}** button, instead of picking them one at a time. The most obvious use case is a CMS asset field with `multiple = true`, where you often want to add many images in one go.\n\n## Problem\n\nToday the file manager has two separate \"selection\" concepts:\n\n- **Picker mode** (choosing an asset for a field/layer) is **single-select only**. `openFileManager(onSelect, assetId, category)` takes one callback that fires for a single asset and closes the dialog.\n- **Bulk management mode** (checkbox multi-select) only exists for **move/delete** operations inside the manager.\n\nAs a result, populating a `multiple = true` asset field means repeating the whole flow for every asset:\n\n- In `CollectionItemSheet.tsx`, each asset is added via the **Add {label}** button → `openFileManager(...)` → pick one → dialog closes → repeat.\n- Same one-at-a-time pattern in the field default editor (`AssetDefaultMultiple` in `FieldFormDialog.tsx`).\n\nFor an item with 10–20 images this is tedious (open, pick, reopen, pick, ...).\n\n## Proposed solution\n\nAdd a **multi-select picker mode** to `FileManagerDialog`:\n\n- When opened from a context that accepts multiple assets, show the existing checkboxes for selection (reuse the `selectedAssetIds: Set\u003cstring>` machinery already used for bulk move/delete).\n- Show a confirm button labelled **Add {n}** (reflecting the number of selected assets), disabled when nothing is selected — mirroring the `Export {n}` pattern referenced in #348.\n- Return the full array of selected assets to the caller in one callback, instead of firing per-asset.\n- Keep single-select behavior unchanged for existing single-asset consumers (image/video/icon/link settings, etc.).\n\nThen wire the multi-select mode into the multi-asset flows:\n\n- `CollectionItemSheet.tsx` — the **Add {label}** button for `isMultipleAssetField(field)` opens the picker in multi-select mode, appends all chosen assets (with the existing type validation via `isValidAssetForField` and dedupe), and stores the resulting `JSON.stringify(assetIds)`.\n- `AssetDefaultMultiple` in `FieldFormDialog.tsx` — same treatment for field default values.\n\n## Implementation notes\n\n- `openFileManager` would need to support a multi-select variant, e.g. an `onSelectMany?: (assets: Asset[]) => void` callback or a `multiple?: boolean` flag (`stores/useEditorStore.ts`, consumed in `YCodeBuilderMain.tsx`).\n- The checkbox UI already exists on `FileGridItem` (currently gated to bulk move/delete) — the main work is letting picker mode reuse it and swapping the footer action to **Add {n}**.\n- Category/type filtering (`getFileManagerCategory`, `isValidAssetForField`) should still apply so only valid assets can be added.\n\n## Context\n\n- Main manager: `app/(builder)/ycode/components/FileManagerDialog.tsx`\n- Multi-asset field flow: `app/(builder)/ycode/components/CollectionItemSheet.tsx`, `FieldFormDialog.tsx` (`AssetDefaultMultiple`)\n- Detection/util: `isMultipleAssetField` in `lib/collection-field-utils.ts`, `parseMultiAssetFieldValue` in `lib/multi-asset-utils.ts`\n- Opener state: `stores/useEditorStore.ts` (`openFileManager`), wired in `YCodeBuilderMain.tsx`\n\n## Open questions\n\n- Should multi-select be a distinct mode, or should any picker allow it when the target field accepts multiple?\n- Should selection persist across folder navigation within a single picker session?","author":{"url":"https://github.com/tristan-mouchet","@type":"Person","name":"tristan-mouchet"},"datePublished":"2026-07-01T14:29:26Z","url":"https://github.com/ycode/ycode/issues/414"}
| 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:9c82654d-4f8a-3b2c-022a-7a38e77c8e32 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E2DC:1BC582:BF8E07:10B8D02:6AFE2A26 |
| html-safe-nonce | 5577031811052bb2860b898ef4c9f27bb12f900a618cf6c7c67c9035bae92cb2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkRDOjFCQzU4MjpCRjhFMDc6MTBCOEQwMjo2QUZFMkEyNiIsInZpc2l0b3JfaWQiOiI0NTEwNDA1OTE1Mzc5MTE2NTgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b1ca358af2011f8ed5335b5c199dd3533af11b4d1df290aae33622ba7e776675 |
| hovercard-subject-tag | issue:4786480552 |
| 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/414/issue_layout |
| twitter:image | https://opengraph.githubassets.com/00e05737fc75df92149412ad0bb40f12599599709f939411edb9b238a23ccaac/ycode/ycode/issues/414 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/00e05737fc75df92149412ad0bb40f12599599709f939411edb9b238a23ccaac/ycode/ycode/issues/414 |
| og:image:alt | Feature request When picking assets, allow selecting multiple assets at once in the file manager and confirming with a single Add {n} button, instead of picking them one at a time. The most obvious... |
| 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