Repository navigation
Fix/admin sidebar layout + use native Kumo sidebar behavior - #1633
Conversation
🦋 Changeset detectedLatest commit: 740d80c The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | 740d80c | Jun 26 2026, 10:58 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-do | 740d80c | Jun 26 2026, 10:58 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | 740d80c | Jun 26 2026, 10:58 PM |
|
All contributors have signed the CLA ✍️ ✅ |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
There was a problem hiding this comment.
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+LinkProviderinstead 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.
| 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 ( |
| function getAnchorHref(destination: string, routerDestination: string): string { | ||
| if (routerDestination.startsWith("/") && !routerDestination.startsWith("//")) { | ||
| return `${ADMIN_BASEPATH}${routerDestination === "/" ? "" : routerDestination}`; | ||
| } | ||
| return destination; | ||
| } |
71b3465 to
e573770
Compare
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
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+KumoRouterLinkto bridge Kumo links to TanStack Router is idiomatic, and offloading RTL drawer positioning to Kumo’ssideprop is correct onceLocaleDirectionProvideris 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 onSidebar.Triggeris intentional icon rotation. - Kumo styles are now imported before Tailwind.
- No hand-rolled
<a>/button styles in the nav items anymore.
- All new/changed user-facing strings are wrapped with Lingui macros (
- Security / correctness of link bridging:
KumoRouterLinkcorrectly routes admin-relative paths through TanStackLink, leaves absolute/external URLs andtarget="_blank"links as plain anchors, and rejects protocol-relative URLs. The existingLinkButton externalusages for site root, live view, and media source URLs are safe because they keep the originaldestinationwhentargetis present. - Role gating: Restoring Byline Schema with
ROLE_ADMINis correct; exportedBYLINE_SCHEMA_NAV_ITEM/filterNavItemsByRoleare already covered bySidebar.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.
What does this PR do?
Updates the admin sidebar to use Kumo’s native sidebar behavior and fixes sidebar/header layout polish.
This PR:
LinkProviderfor sidebar navigation.Closes: N/A
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runmessages.pochanges except in translation PRs — a workflow extracts catalogs on merge tomain.AI-generated code disclosure
Screenshots / test output
Verified:
pnpm installpnpm --dir packages/admin buildpnpm typecheckpnpm lintpnpm format:checkpnpm --dir packages/admin exec vitest runAdmin tests:
Notes:
[email protected]and@vitest/[email protected].Manual verification:
Screenshots
Light Mode
Dark Mode
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.