Skip to content

Fix/admin sidebar layout + use native Kumo sidebar behavior - #1633

Merged
ascorbic merged 7 commits into
mainfrom
fix/admin-sidebar-layout
Jun 29, 2026
Merged

ascorbic merged 7 commits into
mainfrom
fix/admin-sidebar-layout

Conversation

@khoinguyenpham04

@khoinguyenpham04 khoinguyenpham04 commented Jun 26, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Updates the admin sidebar to use Kumo’s native sidebar behavior and fixes sidebar/header layout polish.

This PR:

  • Loads Kumo styles before Tailwind so Kumo component styles are preserved.
  • Uses Kumo LinkProvider for sidebar navigation.
  • Removes custom injected sidebar CSS in favor of Kumo sidebar primitives.
  • Aligns the admin header with Kumo’s sidebar header height.
  • Uses Kumo’s native sidebar side handling for RTL.
  • Keeps panels/buttons white while using subtle Cloudflare-style chrome surfaces.
  • Lightens light-mode borders to better match Kumo/Cloudflare dashboard styling.
  • Shows sidebar tooltips only when collapsed.
  • Fixes mobile sidebar drawer width/slide behavior under Tailwind 4.
  • Restores the Byline Schema admin nav item for admins.

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 — 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

AI-generated code disclosure

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

Screenshots / test output

Verified:

  • pnpm install
  • pnpm --dir packages/admin build
  • pnpm typecheck
  • pnpm lint
  • pnpm format:check
  • pnpm --dir packages/admin exec vitest run

Admin tests:

  • 82 test files passed
  • 1016 tests passed

Notes:

Manual verification:

  • Mobile sidebar drawer opens/closes with slide animation.
  • Sidebar tooltips only show when collapsed.
  • Light/dark sidebar surfaces and borders checked.

Screenshots

Light Mode

Light mode admin sidebar comparison

Dark Mode

Dark mode admin sidebar comparison

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-sidebar-layout. Updated automatically when the playground redeploys.

@changeset-bot

changeset-bot Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 740d80c

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 26, 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 740d80c Jun 26 2026, 10:58 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 26, 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 740d80c Jun 26 2026, 10:58 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 26, 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 740d80c Jun 26 2026, 10:58 PM

@github-actions

github-actions Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@pkg-pr-new

pkg-pr-new Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/auth-atproto

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

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

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

emdash

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

create-emdash

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

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

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

@emdash-cms/plugin-cli

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

@emdash-cms/plugin-types

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

@emdash-cms/registry-client

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

@emdash-cms/registry-lexicons

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

@emdash-cms/sandbox-workerd

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-field-kit

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: 740d80c

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

This PR updates the EmDash admin layout to rely on Kumo’s native Sidebar primitives and navigation wiring, aiming to improve RTL behavior and polish sidebar/header styling and interactions.

Changes:

  • Reorders and adjusts admin CSS imports/tokens to preserve Kumo component styling and refine classic theme surfaces/borders.
  • Refactors the admin sidebar to use Kumo Sidebar.MenuButton + LinkProvider instead of custom sidebar CSS and tooltip/link plumbing.
  • Updates shell/header layout to align heights/surfaces and set sidebar side based on locale direction; restores the “Byline Schema” admin nav item.

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/styles.css Loads Kumo styles before Tailwind, updates classic theme tokens, and adds a sidebar popup transition tweak.
packages/admin/src/components/Sidebar.tsx Switches nav items to Kumo’s native MenuButton behavior and restores “Byline Schema” for admins.
packages/admin/src/components/Shell.tsx Sets sidebar side based on locale direction and aligns sidebar background surface token usage.
packages/admin/src/components/Header.tsx Aligns header height/surface with updated Kumo sidebar chrome.
packages/admin/src/App.tsx Introduces a Kumo LinkProvider adapter that maps Kumo link props to TanStack Router routes under the admin basepath.
.changeset/kumo-style-order.md Patch changeset for admin style loading + sidebar behavior updates.

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

Comment on lines +55 to +81
const KumoRouterLink = React.forwardRef<HTMLAnchorElement, LinkComponentProps>(
({ href, to, target, download, children, ...props }, ref) => {
const destination = href ?? to ?? "";
const hasSearchOrHash = destination.includes("?") || destination.includes("#");
const routerDestination = normalizeAdminHref(destination);
const isRouterPath = routerDestination.startsWith("/") && !routerDestination.startsWith("//");
const shouldUseAnchor = !isRouterPath || hasSearchOrHash || target || download != null;
const linkProps = props as LinkComponentProps & {
"aria-current"?: React.AriaAttributes["aria-current"];
"data-active"?: boolean | string;
};
const ariaCurrent =
linkProps["aria-current"] ?? (linkProps["data-active"] ? "page" : undefined);

if (shouldUseAnchor) {
const anchorHref =
hasSearchOrHash && !target && download == null
? getAnchorHref(destination, routerDestination)
: destination;
return (
<a ref={ref} href={anchorHref} target={target} download={download} {...props}>
{children}
</a>
);
}

return (
Comment on lines +48 to +53
function getAnchorHref(destination: string, routerDestination: string): string {
if (routerDestination.startsWith("/") && !routerDestination.startsWith("//")) {
return `${ADMIN_BASEPATH}${routerDestination === "/" ? "" : routerDestination}`;
}
return destination;
}
@khoinguyenpham04
khoinguyenpham04 force-pushed the fix/admin-sidebar-layout branch from 71b3465 to e573770 Compare June 26, 2026 17:26
@github-actions github-actions Bot added review/needs-rereview New commits since the last review cla: needed and removed review/needs-review No maintainer or bot review yet labels Jun 26, 2026
@khoinguyenpham04

Copy link
Copy Markdown
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jun 26, 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 PR is a focused admin UI bug-fix: it switches the sidebar to Kumo’s native primitives, reorders style loading so Kumo tokens survive Tailwind 4, wires Kumo links through TanStack Router via LinkProvider, and adjusts surfaces/borders/header height for consistency. The approach fits EmDash’s architecture and the stated problem.

What I checked:

  • Approach: Using LinkProvider + KumoRouterLink to bridge Kumo links to TanStack Router is idiomatic, and offloading RTL drawer positioning to Kumo’s side prop is correct once LocaleDirectionProvider is in place.
  • AGENTS.md conventions:
    • All new/changed user-facing strings are wrapped with Lingui macros (t\``, `).
    • No raw directional Tailwind utilities added; the remaining rtl: use on Sidebar.Trigger is intentional icon rotation.
    • Kumo styles are now imported before Tailwind.
    • No hand-rolled <a>/button styles in the nav items anymore.
  • Security / correctness of link bridging: KumoRouterLink correctly routes admin-relative paths through TanStack Link, leaves absolute/external URLs and target="_blank" links as plain anchors, and rejects protocol-relative URLs. The existing LinkButton external usages for site root, live view, and media source URLs are safe because they keep the original destination when target is present.
  • Role gating: Restoring Byline Schema with ROLE_ADMIN is correct; exported BYLINE_SCHEMA_NAV_ITEM/filterNavItemsByRole are already covered by Sidebar.test.tsx.
  • Changeset: Present and user-facing ("Fixes Kumo style loading and updates the admin sidebar…").

I did not run the test/lint/typecheck tooling locally; I’m taking the author’s verification at face value for those. The code reads clean and I found no regressions or convention violations that would block merge.

@github-actions github-actions Bot added cla: signed review/approved Approved; no new commits since and removed cla: needed review/needs-rereview New commits since the last review labels Jun 26, 2026
@github-actions github-actions Bot added review/needs-rereview New commits since the last review and removed review/approved Approved; no new commits since labels Jun 26, 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.

Thanks!

@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 Jun 29, 2026
@ascorbic
ascorbic merged commit d063b51 into main Jun 29, 2026
48 checks passed
@ascorbic
ascorbic deleted the fix/admin-sidebar-layout branch June 29, 2026 09:18
@emdashbot emdashbot Bot mentioned this pull request Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants