Repository navigation
feat(media): MediaLibrary and MediaPicker on a storage adapter - #625
Merged
Merged
Conversation
A media library for any storage, ported from Aveiro's onto core's FileTree, Media and MediaUpload: folder tree, searchable tile grid with paging, drop to upload with progress, select, rename, move (menu or drag onto a folder) and delete. Every read and write goes through an adapter prop, and each control shows only when the adapter has the method behind it. MediaPicker wraps it in a Dialog for "choose an image". createMemoryMediaAdapter() backs prototypes and tests; apps/dev has a proof page at /media-library-proof. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJu1G51Lw3fmNHE7VvzH
The entry now carries Dialog, Dropdown, FileTree and InfiniteScroll for the library (48.8 KB -> 82.4 KB gzipped for the whole entry; bundlers still drop what an app does not import). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJu1G51Lw3fmNHE7VvzH
…view Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJu1G51Lw3fmNHE7VvzH
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Lorant · project thread
A media library that works on any storage, ported from Aveiro's
src/components/media-library/onto core'sFileTree,MediaandMediaUpload. 3.1.x candidate; additive only, nothing existing changes.What's in it
On
@once-ui-system/core/media:MediaLibraryhas a folder tree, a searchable tile grid with paging (InfiniteScroll) and drop-to-upload with a progress tile. You can select one or several files, rename them, move them (from a menu or by dragging onto a folder; a selected tile drags the whole selection) and delete them. It covers loading, empty, no-results and error-with-Retry states. When the library is empty and only takes images, the empty state is aMediaUploaddrop zone.MediaPickeris the "choose an image" dialog. It wrapsMediaLibraryin aDialogand gives back the picked assets. A double click chooses a file straight away.acceptlimits it by kind andmultiplelets you pick several.mediaAdapter.ts):listis the only required method.upload,remove,move,rename,listFolders,createFolder,renameFolder,removeFolder.{ list }alone gives a read-only grid.createMemoryMediaAdapter()is an in-memory adapter for prototypes, docs and tests. There are alsomediaKindOfFileandformatMediaSizehelpers.Writes are optimistic and roll back on failure. If a
ToastProvideris mounted, the failure shows as a danger toast; without one, it shows as an inlineFeedback. Every string can be translated throughlabels.Drag and drop uses native HTML5 drag events, so core gains no dnd dependency.
Checks
tscclean.media-library.interaction.test.tsx(11 tests, axe included) and the guard tests updated for the new exports.validate-ai-codeclean on both components.apps/dev→/media-library-proof. Screenshots (dark, light, menu, picker, phone) are in the project files undercore/media-library/.Next
/api/v1/assetsadapter on Bunny storage.Generated by Claude Code