Skip to content

Refine admin dashboard cards with Kumo primitives - #1865

Merged
khoinguyenpham04 merged 26 commits into
mainfrom
fix/admin-dashboard-layer-card
Jul 8, 2026
Merged

khoinguyenpham04 merged 26 commits into
mainfrom
fix/admin-dashboard-layer-card

Conversation

@khoinguyenpham04

@khoinguyenpham04 khoinguyenpham04 commented Jul 7, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Refreshes the admin dashboard to use Kumo card primitives and more consistent dashboard spacing, while preserving the existing dashboard data contract.

Highlights:

  • Converts dashboard quick actions to a Kumo button toolbar and routes collection quick actions to the new-entry form.
  • Replaces the summary strip with compact Kumo LayerCard metric cards for drafts, scheduled content when present, media files, and users.
  • Converts Content, Recent Activity, and plugin widget containers to LayerCard.
  • Uses Kumo Badge for Content published/draft counts and semantic Kumo tokens for Recent Activity status dots.
  • Aligns card headings, rows, empty states, and plugin widget body content consistently.
  • Uses Kumo SkeletonLine for loading states and Banner for dashboard data load errors while preserving stale dashboard data during background refetch failures.
  • Restores the dashboard scheduled-content summary using an explicit scheduled count, so archived/pending/private statuses are not misclassified as scheduled.
  • Includes a small core smoke-test deflake that retries self-hosted font file fetches.
  • Aligns admin header controls so View Site, theme toggle, and the user menu have consistent heights.

No linked issue.

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
  • pnpm lint:quick passes and pnpm lint:json | jq '.diagnostics | length' returns 0
  • pnpm --filter @emdash-cms/admin test -- tests/components/Dashboard.test.tsx passes (full admin browser suite: 1053 tests)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable) — dashboard scheduled-count and quick-action route coverage added; existing suites pass.
  • 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, dashboard visual/UI refinement.

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: OpenCode with GPT-5.5 (openai/gpt-5.5).

Screenshots / test output

Full-page screenshots captured at 1400x1000.

Loaded

Light Dark
dashboard-loaded-light dashboard-loaded-dark

Empty

Light Dark
dashboard-empty-light dashboard-empty-dark

Loading

Light Dark
dashboard-loading-light dashboard-loading-dark

Error

Light Dark
dashboard-error-light dashboard-error-dark

Verification run:

pnpm format
pnpm lint:quick
pnpm typecheck
pnpm --filter emdash test -- tests/unit/api/dashboard-handlers.test.ts  # full core suite: 330 files / 4462 tests passed
pnpm --filter @emdash-cms/admin test -- tests/components/Dashboard.test.tsx  # full admin browser suite: 85 files / 1053 tests passed
pnpm lint:json | jq '.diagnostics | length'  # 0

Adversarial review:

  • Ran iterative second-opinion review against the branch diff.
  • Fixed all blocker/major/minor findings.
  • Latest pass confirmed convergence with nits only: RTL alignment not visually verified in Arabic.

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 fix/admin-dashboard-layer-card. Updated automatically when the playground redeploys.

Copilot AI review requested due to automatic review settings July 7, 2026 21:42
@changeset-bot

changeset-bot Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 20455b5

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

This PR includes changesets to release 16 packages
Name Type
emdash Patch
@emdash-cms/admin 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

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added area/admin size/L review/awaiting-author Reviewed; waiting on the author to respond labels Jul 7, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/auth-atproto

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

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

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

emdash

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

create-emdash

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

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

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

@emdash-cms/plugin-cli

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

@emdash-cms/plugin-types

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

@emdash-cms/registry-client

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

@emdash-cms/registry-lexicons

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

@emdash-cms/sandbox-workerd

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-field-kit

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: 20455b5

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 7, 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 20455b5 Jul 08 2026, 02:29 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 7, 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 20455b5 Jul 08 2026, 02:31 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 7, 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 20455b5 Jul 08 2026, 02:29 PM

@github-actions github-actions Bot added area/templates review/needs-rereview New commits since the last review and removed review/awaiting-author Reviewed; waiting on the author to respond labels Jul 7, 2026

@emdashbot emdashbot Bot 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.

This is a sensible visual-only refresh: it replaces ad-hoc dashboard containers with Kumo LayerCard/Badge/SkeletonLine/Banner, preserves the existing DashboardStats contract, and keeps stale data visible during background refetch errors. The quick-action route change to /content/$collection/new is intentional and matches a registered route. All user-facing strings are Lingui-wrapped, no raw Tailwind directional utilities were introduced, and changesets are present.

The main issue is an RTL regression: the ArrowRight hover indicator in the Content rows is not flipped for right-to-left layouts, which directly contradicts the repo’s RTL guidance and the author’s own note that RTL alignment was not visually verified in Arabic. I also noticed that the previous dashboard status strip showed a scheduled-content count, but the new metric cards only show drafts/media/users, so that information is no longer surfaced anywhere on the dashboard. That may be intentional, but it is a behavior change worth calling out.

I spot-checked the diff against AGENTS.md conventions (Lingui, RTL-safe Tailwind, Kumo primitives, changesets) and traced route and type usage through router.tsx and dashboard.ts. I did not run the test suite or typechecker locally; those results are taken from the PR description as unverified.

@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-rereview New commits since the last review labels Jul 7, 2026
@github-actions github-actions Bot added review/needs-rereview New commits since the last review and removed review/awaiting-author Reviewed; waiting on the author to respond labels Jul 8, 2026
@khoinguyenpham04 khoinguyenpham04 added bot bot:review Trigger an emdashbot code review on this PR and removed bot labels Jul 8, 2026

@emdashbot emdashbot Bot 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.

This is a measured, visual-only dashboard refresh that aligns the admin UI with Kumo primitives, fixes the prior RTL regression, and preserves stale data during background refetch errors. I read the full diff, traced the ArrowNext / CaretNext helpers in ArrowIcons.tsx, verified the /content/$collection/new route exists, and checked for physical directional utilities and Lingui leaks. The code is generally clean and consistent with AGENTS.md.

What changed since the last review:

  • RTL fixed. The Content-row hover arrow now uses ArrowNext, which applies rtl:-scale-x-100 in packages/admin/src/components/ArrowIcons.tsx, so it points left in RTL layouts instead of right.
  • Active error handling added. isError is now surfaced, a Kumo Banner is shown on failures, and the dashboard still renders cached data when a background refetch fails.

Still worth addressing:

  • The scheduled-content count is gone. The old status strip displayed scheduled entries as a metric when present; the new SummaryMetrics cards only show drafts, media, and users. That is a real dashboard behavior change the description calls out as preserved ("preserving the existing dashboard data contract"). Either restore a scheduled metric or update the PR description/changeset to document the removal.
  • Scope creep. packages/core/tests/integration/smoke/retry-font-fetch.mjs and fixtures/perf-site/astro.config.mjs (fonts: false) are unrelated to dashboard card primitives. They may be a sensible CI deflake, but they are not described in the PR and should be split out or at least called out.

No security, SQL, authorization, or API-contract issues were introduced. I did not run the test suite, typechecker, or linter locally; those results are taken from the PR description as unverified.

@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-rereview New commits since the last review labels Jul 8, 2026
@github-actions github-actions Bot added review/needs-rereview New commits since the last review size/XL and removed review/awaiting-author Reviewed; waiting on the author to respond size/L labels Jul 8, 2026
@khoinguyenpham04 khoinguyenpham04 added bot:review Trigger an emdashbot code review on this PR and removed bot:review Trigger an emdashbot code review on this PR labels Jul 8, 2026

@ascorbic ascorbic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be good if we could upstream a real fix for the fonts issue. Not sure if it's in Astro itself or one of the libraries it uses, but in either case having a retry mechanism would be a good addition.

@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/needs-rereview New commits since the last review labels Jul 8, 2026
@khoinguyenpham04
khoinguyenpham04 merged commit 582ea2c into main Jul 8, 2026
52 checks passed
@khoinguyenpham04
khoinguyenpham04 deleted the fix/admin-dashboard-layer-card branch July 8, 2026 14:51
@emdashbot emdashbot Bot mentioned this pull request Jul 8, 2026

@emdashbot emdashbot Bot 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.

Re-review of the dashboard Kumo refresh. The outstanding item from the last round — the missing scheduled-content metric — is now fixed and explicit. ContentRepository.getStats counts rows with scheduled_at IS NOT NULL, the dashboard handler/client types thread scheduled through, and the UI renders a conditional Scheduled LayerCard instead of inferring it from residual statuses.

The rest of the refresh follows the repo’s conventions: Kumo primitives for cards, badges, skeletons and banner; RouterLinkButton avoids invalid <a><button> nesting; ArrowNext gives correct RTL behavior; and error state preserves stale data while showing a Banner. I didn’t spot Lingui leaks, physical directional utilities, raw Tailwind colors, dynamic SQL, or missing changesets.

The two non-card hunks (fixtures/perf-site/astro.config.mjs fonts: false and the retry-font-fetch.mjs smoke-test shim) remain included but are now called out in the PR description, so they read as a documented deflake side-quest rather than an unnoticed scope creep. They’re not blocking.

Tests are updated for the scheduled count and the quick-action routing. I did not run the suite, typechecker, or linter locally; those results are taken from the PR description as unverified. Overall this is clean enough to sign off.

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

Labels

area/admin area/core area/templates bot:review Trigger an emdashbot code review on this PR cla: signed review/approved Approved; no new commits since size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants