AddThisFeature

Media Library

Give every uploaded file one browsable home instead of scattering them across the app.

involved Media & Video

What it adds

A single browsable store of every uploaded image, video, and document, with folders, search, and reuse from any upload field in the app.

What your agent is told to do

5
  1. 1

    Build this on top of the app's existing upload path rather than beside it. If File Upload, Avatar Upload, Attachment Gallery, or a hosted media upload already exist, they must all write into the library and read back from it, so a file uploaded in one place is findable in another.

  2. 2

    Give every upload field a second route: choose an existing file from the library. That is the whole point of the feature, and a library nothing can select from is just a storage report.

  3. 3

    Record where each file is used. When someone deletes a file that is still referenced, name the pages or records that will break and make them confirm.

  4. 4

    Deduplicate by hashing file contents on upload. If the same bytes are already stored for that workspace, link to the existing record instead of storing a second copy, but keep the new filename and the new uploader on the reference.

  5. 5

    Do not load the whole library at once. Paginate or lazily page the grid and defer thumbnail loading until a tile is near the viewport, or the first visit from a workspace with ten thousand files will hang the browser.

Edge cases it handles

8
  • Deleting a file that is still referenced by a page, message, or product breaks it silently. Show the usage list before deletion and offer to detach rather than destroy.
  • Two people uploading the same file must not produce two stored copies. Hash the content, match against existing records in the same workspace, and reuse the stored object while still logging the second upload.
  • The browser cannot preview PDFs, design files, archives, or many video formats inline. Generate a thumbnail server-side for those, and fall back to a typed placeholder icon when generation fails rather than showing a broken image.
  • A library with tens of thousands of assets must not fetch every thumbnail on first paint. Page the results and load thumbnails only as tiles approach the viewport, with reserved tile dimensions so the grid does not reflow.
  • Storage is finite and someone will fill it. Enforce a per-workspace quota server-side, show consumption before it is reached, and give the over-limit state a clear action: delete files or upgrade, not a generic upload failure.
  • Every file in the library must inherit the app's existing access rules. A private attachment must not become readable to the whole workspace merely because it is now listed in a shared browser.
  • An upload cancelled or interrupted halfway must not leave a half-written file listed as usable. Mark uploads incomplete until they finish and sweep the abandoned ones.
  • Files must carry alt text or a description where the app renders them publicly. Reuse any existing alt text generation rather than leaving the field blank.

Definition of done

9
  • Every upload surface in the app writes into the library and can select from it.
  • Each file shows where it is used, and deleting a referenced file requires confirmation.
  • Identical uploads are stored once and linked, not duplicated.
  • Formats the browser cannot render inline have server-generated thumbnails or a typed placeholder.
  • The grid pages and lazily loads thumbnails without layout shift on large libraries.
  • Per-workspace storage quotas are enforced server-side with a clear over-limit state.
  • Library access respects the app's existing per-file permissions.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.