Skip to content

fix(media): refine media library and asset details UX#1824

Merged
ascorbic merged 4 commits into
mainfrom
pr/media-library-refinements
Jul 6, 2026
Merged

fix(media): refine media library and asset details UX#1824
ascorbic merged 4 commits into
mainfrom
pr/media-library-refinements

Conversation

@khoinguyenpham04

@khoinguyenpham04 khoinguyenpham04 commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Refines the admin media library and asset details flow: the library uses Kumo tabs for view switching, has clearer empty/no-results states, opens asset details in a centered responsive dialog, and routes provider asset deletion through the provider API when supported.

Closes: N/A

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
  • pnpm typecheck passes (verified with pnpm --filter @emdash-cms/admin typecheck)
  • pnpm lint passes (verified with pnpm --silent lint:json | jq '.diagnostics | length' -> 0)
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs -- a workflow extracts catalogs on merge to main.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: N/A, no new feature.

AI-generated code disclosure

  • This PR includes AI-generated code -- model/tool: OpenCode with GPT-5.5

Screenshots / test output

image image image
  • pnpm --silent lint:json | jq '.diagnostics | length' -> 0
  • pnpm --filter @emdash-cms/admin typecheck -> passed
  • pnpm --filter @emdash-cms/admin test -- tests/components/MediaLibrary.test.tsx tests/components/MediaDetailPanel.test.tsx -> 83 test files passed, 1041 tests passed

Try this PR

Open a fresh playground →

A full working EmDash site, deployed from this branch. Each visit gets its own session-scoped sandbox: no login needed and no shared state. Try the admin, edit content, hit the public site.

Tracks pr/media-library-refinements. Updated automatically when the playground redeploys.

Copilot AI review requested due to automatic review settings July 4, 2026 22:23
@changeset-bot

changeset-bot Bot commented Jul 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 033b227

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

This PR includes changesets to release 16 packages
Name Type
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/sandbox-workerd Patch
@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/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
create-emdash Patch
@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

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 1,421 lines across 6 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.

@github-actions github-actions Bot added the review/needs-review No maintainer or bot review yet label Jul 4, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 4, 2026

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-playground 033b227 Jul 04 2026, 11:34 PM

@pkg-pr-new

pkg-pr-new Bot commented Jul 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@1824

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@1824

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@1824

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@1824

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@1824

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@1824

emdash

npm i https://pkg.pr.new/emdash@1824

create-emdash

npm i https://pkg.pr.new/create-emdash@1824

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@1824

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@1824

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@1824

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@1824

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@1824

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@1824

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@1824

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@1824

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@1824

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@1824

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@1824

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@1824

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@1824

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@1824

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@1824

commit: 033b227

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 4, 2026

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 033b227 Jul 04 2026, 11:33 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 4, 2026

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 033b227 Jul 04 2026, 11:34 PM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refines the admin media library UX by switching view toggles and provider navigation to Kumo Tabs, improving empty/no-results states, and moving asset details into a centered responsive dialog (including provider-aware deletion).

Changes:

  • Replace media library view/provider switching controls with Kumo Tabs and refine toolbar + empty/no-results states.
  • Convert the asset detail UI from a slide-out panel to a responsive dialog, add dirty-state handling, and route provider deletions through the provider API when supported.
  • Update and expand component tests to cover the new dialog behaviors, focus restoration, and provider deletion behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/admin/src/components/MediaLibrary.tsx Reworks library header/toolbar/empty states, switches view/provider controls to Tabs, and opens a detail dialog.
packages/admin/src/components/MediaDetailPanel.tsx Converts the detail panel into a dialog, adds busy/dirty handling, and supports provider deletion + URL hiding.
packages/admin/src/router.tsx Removes now-unneeded delete plumbing from MediaPage into MediaLibrary.
packages/admin/tests/components/MediaLibrary.test.tsx Updates tests for Tabs roles, new empty state copy, dialog open timing, delete flow, and focus restoration.
packages/admin/tests/components/MediaDetailPanel.test.tsx Updates tests for dialog rendering, read-only provider behavior, provider deletion routing, and dirty/close behavior.
.changeset/media-library-refinements.md Patch changeset describing the media library/detail UX refinements.
Comments suppressed due to low confidence (1)

packages/admin/src/components/MediaLibrary.tsx:98

  • The debounced search effect can send a stale value when switching providers quickly. Because it depends on activeProvider, switching back to the local provider can run the effect while debouncedSearch is still the previous term (even though the input was cleared), briefly applying the wrong server-side search.
	React.useEffect(() => {
		if (activeProvider === "local" && onLocalSearchChange) {
			onLocalSearchChange(debouncedSearch.trim());
		}
	}, [debouncedSearch, activeProvider, onLocalSearchChange]);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/admin/src/components/MediaDetailPanel.tsx
Comment thread packages/admin/src/components/MediaLibrary.tsx Outdated
@github-actions github-actions Bot added review/needs-rereview Author pushed changes since the last review and removed review/needs-review No maintainer or bot review yet labels Jul 4, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

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.

@ascorbic ascorbic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loads better. Thanks

@ascorbic ascorbic merged commit 99b8a33 into main Jul 6, 2026
48 checks passed
@ascorbic ascorbic deleted the pr/media-library-refinements branch July 6, 2026 10:41
@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/needs-rereview Author pushed changes since the last review labels Jul 6, 2026
@emdashbot emdashbot Bot mentioned this pull request Jul 6, 2026
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.

3 participants