Skip to content

fix(admin): refine sidebar, loading, and editor UI#2127

Open
khoinguyenpham04 wants to merge 13 commits into
mainfrom
ui/admin-refinement
Open

fix(admin): refine sidebar, loading, and editor UI#2127
khoinguyenpham04 wants to merge 13 commits into
mainfrom
ui/admin-refinement

Conversation

@khoinguyenpham04

@khoinguyenpham04 khoinguyenpham04 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Polishes admin navigation, startup, and content editing:

  • Moves the desktop sidebar toggle to the footer and keeps mobile navigation accessible.
  • Prevents theme flashing during startup and aligns the boot and configuration loaders.
  • Standardizes editor surfaces, headings, field spacing, and featured-image help.
  • Improves publishing actions and narrow-screen editor behavior.
  • Preserves configured collection-label casing.
  • Supports RTL layouts and reduced motion.

No API, authentication, authorization, database, storage, or content-model changes.

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
  • pnpm lint passes
  • 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; catalogs are extracted after merge.
  • 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: OpenCode (GPT-5.6 Sol)

Screenshots / test output

Use the playground preview and these admin routes:

Route Verify
/_emdash/admin Theme-safe loading; desktop and mobile sidebar controls; RTL and reduced-motion behavior
/_emdash/admin/content/posts/post-1 Editor surfaces and spacing; featured-image tooltip; Unpublish Post and Publish updates; narrow settings sheet; distraction-free mode
/_emdash/admin/content/posts/post-draft Draft editor and Publish Post action

Tested with pnpm typecheck, pnpm lint, pnpm format:check, 179 targeted admin tests, 7 boot-theme tests, and E2E shard 2/8 (26 tests).


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 ui/admin-refinement. Updated automatically when the playground redeploys.

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

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6600b60

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 18, 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 6600b60 Jul 19 2026, 02:46 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.

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 18, 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 6600b60 Jul 19 2026, 02:46 PM

@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 767 lines across 27 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

cloudflare-workers-and-pages Bot commented Jul 18, 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 6600b60 Jul 19 2026, 02:45 PM

@github-actions github-actions Bot added the review/awaiting-author Reviewed; waiting on the author to respond label Jul 18, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/auth-atproto

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

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

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

emdash

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

create-emdash

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

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

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

@emdash-cms/plugin-cli

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

@emdash-cms/plugin-types

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

@emdash-cms/registry-client

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

@emdash-cms/registry-lexicons

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

@emdash-cms/registry-verification

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/registry-verification@2127

@emdash-cms/sandbox-workerd

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-field-kit

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: 6600b60

@khoinguyenpham04 khoinguyenpham04 added the bot:review Trigger an emdashbot code review on this PR label Jul 18, 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.

Approach judgment

This PR is a focused UI refinement: it moves the desktop sidebar collapse trigger to the footer, tightens editor heading/field spacing, gives the loader a theme-aware, centered hand-off between Astro and React, and keeps the Portable Text writing surface visually distinct. The changes stay inside the admin package (plus one small Astro boot shell change in emdash), don't touch APIs/auth/database, and are consistent with the existing Kumo + Lingui architecture. The approach is sound.

What I checked

  • Read the full diff and the changed component files (ContentEditor, ContentSettingsPanel, Sidebar, Header, PortableTextEditor, ImageFieldRenderer, FieldHelpLabel, Shell, ThemeProvider, admin.astro, plus new/updated tests).
  • Verified Lingui wrapping for all new user-visible strings (Loading configuration…, Publish ${label}, Unpublish ${label}, etc.), RTL-safe Tailwind (me-auto, ps-2.5, rtl:rotate-180 transforms), and logical padding/margin usage.
  • Confirmed the Astro boot script and ThemeProvider use the same emdash-theme localStorage key and the same data-mode resolution logic, so the no-flash boot hand-off works.
  • Cross-checked changed test expectations against the code, and traced the new data-emdash-inline-bubble-menu selector back to the BubbleMenu component.

Headline conclusion

The code is close to clean, but I found two small issues where the new tests and the implementation have drifted:

  1. The Portable Text field label now renders a bare <Label> while the new test expects the same text-base font-medium styling applied to the image field label.
  2. One new test uses toHaveLength on a Set, which will fail because Set has .size, not .length.

Both are easy fixes. I did not run the test suite or linter, so I report these as statically-identified discrepancies rather than confirmed CI failures.

Comment thread packages/admin/src/components/ContentEditor.tsx
Comment thread packages/admin/tests/components/ContentSettingsPanel.test.tsx
@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Jul 18, 2026
@github-actions github-actions Bot added review/needs-rereview Author pushed changes since the last review and removed review/awaiting-author Reviewed; waiting on the author to respond labels Jul 18, 2026
@khoinguyenpham04 khoinguyenpham04 added the bot:review Trigger an emdashbot code review on this PR label Jul 18, 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: approach and headline

This PR is still a focused, well-scoped UI refinement: it moves the desktop sidebar collapse control into the footer, aligns editor surfaces, headings, and spacing, makes publishing actions consistent with the collection label, and prevents boot-time theme flashing by syncing the Astro boot script with the React ThemeProvider. All changes stay inside the admin package (plus the Astro shell), with no API/auth/database/content-model work. The approach remains sound and fits the Kumo + Lingui architecture.

What I checked

  • Re-read the full diff and the current versions of the changed component files (ContentEditor, ContentSettingsPanel, FieldHelpLabel, ImageFieldRenderer, Header, PortableTextEditor, Shell, Sidebar, router, styles, and updated tests).
  • Verified the two issues flagged in the previous review are still present in the PR head.
  • Spot-checked RTL-safe Tailwind (me-auto, ps-2.5, rtl:rotate-180, logical padding/margins) and Lingui wrapping for new strings (Publish ${label}, Unpublish ${label}, Loading configuration…).
  • Confirmed the Astro boot script and ThemeProvider still agree on the emdash-theme key and data-mode resolution, so the no-flash hand-off remains intact.
  • Reviewed the new/updated test expectations against the implementation; most align, but two still do not.

Headline conclusion

The code is close to clean, but the two statically-identified discrepancies from the prior review are still unresolved. Both will cause test failures rather than production bugs, but they block a green test run:

  1. The Portable Text field label uses a bare <Label> while the new test asserts the same text-base font-medium styling applied to the featured-image label.
  2. One new test still calls .toHaveLength on a Set, which Set does not have.

Both are small fixes.

(As before, I did not run the test suite or linter, so I report these as static discrepancies, not confirmed CI failures.)

Comment thread packages/admin/src/components/ContentEditor.tsx
Comment thread packages/admin/tests/components/ContentSettingsPanel.test.tsx
@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Jul 18, 2026
@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond overlap and removed review/needs-rereview Author pushed changes since the last review labels Jul 18, 2026
@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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 19, 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
docs 6600b60 Jul 19 2026, 02:45 PM

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.

2 participants