Skip to content

feat(media): add flat folder API foundation - #2584

Draft
khoinguyenpham04 wants to merge 3 commits into
feat/media-pagination-uifrom
feat/media-folders-api
Draft

feat(media): add flat folder API foundation#2584
khoinguyenpham04 wants to merge 3 commits into
feat/media-pagination-uifrom
feat/media-folders-api

Conversation

@khoinguyenpham04

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds the backend and typed-client foundation for flat, shared Media Library folders. Local media can belong to one folder or the Main library, list requests can select All media, Main library media, or one folder, and deleting a folder returns its media to the Main library without changing media IDs, storage keys, URLs, or usage records.

This is PR1 of the folders sequence and intentionally has no admin UI, upload-to-folder behavior, nesting, bulk moves, provider changes, CLI commands, or MCP commands. PR2 will add the focused Media Library UI on top of this branch.

This draft is stacked on #2582 so reviewers see only the folder foundation. It will ultimately merge into main after the pagination dependency lands.

Related media roadmap Discussions:

A folder-specific maintainer-approved Discussion was not found. This PR remains a draft pending scope confirmation.

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • Typecheck passes for the changed emdash package
  • Type-aware lint passes with 0 diagnostics
  • The full default core suite passes: 6,044 tests
  • All changed TypeScript and documentation files pass their formatters
  • I have added/updated tests for my changes
  • User-visible strings in the admin UI are not applicable; PR1 adds no admin UI and includes no messages.po changes
  • I have added and reviewed an emdash minor changeset
  • New features link to an approved Discussion: folder-specific approval is still needed

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Codex GPT-5.6, with GPT-5.6 Terra Thinking X High second-opinion reviews

Screenshots / test output

PR1 has no visual changes.

  • Full default core suite: 489 files passed, 6,044 tests passed.
  • Focused migration, repository, REST, authorization, OpenAPI, and client suite: 223 tests passed.
  • Real Astro server client flow passed for folder create/list/rename/delete, assignment, filtering, and safe folder deletion.
  • Type-aware lint: 0 diagnostics.
  • Core typecheck, core build, OpenAPI validation, changeset validation, and documentation build passed.
  • SQLite migration replay and concurrent-migrator coverage passed. PostgreSQL was not configured locally, so dialect-parametric PostgreSQL cases remain for CI.
  • Iterative Terra Thinking X High adversarial review converged with no findings.

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b5b2821

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
emdash Minor
@emdash-cms/cloudflare Minor
@emdash-cms/sandbox-workerd Patch
@emdash-cms/plugin-mcp-smoke Major
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/do-demo-site Patch
@emdash-cms/do-solo-demo-site Patch
@emdash-cms/admin Minor
@emdash-cms/auth Minor
@emdash-cms/blocks Minor
@emdash-cms/gutenberg-to-portable-text Minor
@emdash-cms/x402 Minor
create-emdash Minor
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 1,578 lines across 33 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
docs b5b2821 Aug 20 2026, 11:34 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://feat-media-folders-api.try.emdashcms.com, https://feat-media-folders-api-emdash-playground.emdash-cms.workers.dev (commit b5b2821)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://e878468e.try.emdashcms.com, https://e878468e-emdash-playground.emdash-cms.workers.dev b5b2821 2026-08-20T23:34:59.312Z Visit the dashboard ↗

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache b5b2821 Aug 20 2026, 11:35 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-do b5b2821 Aug 20 2026, 11:35 PM

@github-actions

Copy link
Copy Markdown
Contributor

Overlapping PRs

This PR modifies files that are also changed by other open PRs:

This may cause merge conflicts or duplicated work. A maintainer will coordinate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant