Skip to content

fix(admin): hide collections marked hidden from the dashboard Content card - #4096

Merged
danielmlr merged 2 commits into
emdash-cms:mainfrom
masonjames:mj/dashboard-hidden-collections
Oct 28, 2026
Merged

danielmlr merged 2 commits into
emdash-cms:mainfrom
masonjames:mj/dashboard-hidden-collections

Conversation

@masonjames

@masonjames masonjames commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Hide from navigation (hidden: true) removes a collection's sidebar entry, command palette link and dashboard quick action so that a plugin which manages the collection end to end can keep editors out of it (#3440, #3060). The dashboard's Content card is built from the same manifest but still listed every hidden collection with a link into it, so the dashboard kept steering editors into collections the sidebar hides.

The Content card now skips collections whose manifest entry is hidden, the same check the quick actions and the sidebar make. Collections that are not in the manifest render as before. Nothing else about hidden collections changes: they still count toward the dashboard's Drafts and Scheduled totals, still appear in Recent Activity, and stay reachable by URL, API and plugins. A site whose every collection is hidden sees the card's existing "No collections configured" line, as the sidebar shows no entries in that case.

#3060 left the Content card alone as a server-side stats surface. The counts are, but each row is a link into the collection, which is the navigation the flag is meant to remove; filtering the rows client-side by the manifest leaves the server stats untouched.

Also in this PR: a regression test next to the quick-actions test, a patch changeset, and the docs, type comments and the toggle's help text now name the Content card alongside the other surfaces.

My connection: on my own EmDash 1.2 site, two legacy collections that are hidden from navigation still show up on the dashboard's Content card, and I have been hiding their links with admin CSS until the card respects the flag. Verification: the new test fails on main and passes here, and the before/after screenshots below come from demos/simple with the seeded Posts collection hidden.

Related: #3060, #3440. No linked issue.

Type of change

  • Bug fix
  • Feature (requires an accepted feature plan or RFC)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Your connection to this change

  • I use EmDash and ran into the problem this PR addresses
  • I maintain a tool, dependency, or service that EmDash uses, and this change concerns that integration
  • A Maintainer approved this specific change before I opened the PR

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 and reviewed the user-facing changeset (if this PR changes a published package)
  • New features link to their merged design PR: https://github.com/emdash-cms/emdash/pull/... (not a feature)
  • I have included screenshots below if this PR changes the UI

AI assistance disclosure

  • This PR includes AI-generated code or text — model/tool: Claude Code with Claude Opus 5.5 (implementation) and Claude Fable 5.1 (review and PR text); an independent review pass with Codex CLI (gpt-6.1-sol)

Screenshots / test output

demos/simple on this branch's base, with the seeded Posts collection switched to Hide from navigation. The sidebar and the quick actions already leave Posts out; the Content card did not.

Before After
Dashboard Content card before the change: it lists Pages and Posts, although Posts is hidden from navigation and missing from the sidebar Dashboard Content card after the change: it lists Pages only, matching the sidebar

Full dashboard for context, same state: before · after. The Draft total and Recent Activity still include the hidden Posts in both.

Targeted test run: pnpm --filter @emdash-cms/admin exec vitest run tests/components/Dashboard.test.tsx — 26 passed, including the new omits hidden collections from the Content card, which fails on main because the Sync runs row is found (expect.element(getByRole("link", { name: /Sync runs/ })).not.toBeInTheDocument()).

… card

"Hide from navigation" removes a collection's sidebar entry, command
palette link and dashboard quick action so that a plugin which owns the
collection can keep editors out of it. The dashboard's Content card
still listed every hidden collection with a link into it, so the
dashboard kept steering editors where the sidebar does not.

The card now skips collections whose manifest entry is hidden, the same
check the quick actions make. Collections missing from the manifest
still render, and hidden collections still count toward the dashboard
totals and still appear in Recent Activity. The docs, type comments and
the toggle's help text now name the Content card alongside the other
three surfaces.
@changeset-bot

changeset-bot Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cb3c743

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

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

@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 fixes the right bug in the right place. The dashboard Content card was the remaining navigation surface that ignored hidden: true; filtering its rows client-side by the same manifest flag used by the sidebar, quick actions, and command palette makes the behavior consistent without touching the server-side stats. The counts still include hidden collections, Recent Activity still lists them, and direct URLs/API/plugins still work — exactly what the description promises.

What I checked:

  • Read the diff and the full Dashboard.tsx, Dashboard.test.tsx, ContentTypeEditor.tsx, and the changed docs/type files.
  • Verified the new visibleCollections filter logic: !manifest.collections[col.slug]?.hidden correctly keeps manifest-visible collections and collections not in the manifest, and hides only collections explicitly marked hidden: true.
  • Confirmed Sidebar.tsx and AdminCommandPalette.tsx already use the same visibleCollectionEntries helper, so the Content card change finally aligns the last surface with the existing pattern.
  • Confirmed SummaryMetrics and RecentActivity still operate on the full stats.collections / stats.recentItems, preserving totals and recent-item visibility as claimed.
  • Reviewed the regression test added next to the quick-action test: it renders stats for a hidden sync_runs collection and asserts both the accessible link and the raw href are absent. It exercises observable UI behavior and would fail on main.
  • Checked the changeset against .changeset/README.md: it leads with "Fixes", names the user-facing surface, describes the observable problem, and notes the preserved behavior. The single @emdash-cms/admin patch is correct — the core changes are type-comment/docs-only updates with no runtime/API impact.
  • Checked AGENTS.md conventions: user-facing strings are Lingui-wrapped, no new directional Tailwind classes, no SQL, no new logged-out queries, no stale comments added.

I found nothing that needs fixing. The implementation is minimal, consistent with existing code, covered by a regression test, and accurately documented.

@emdashbot emdashbot Bot removed the review/needs-review No maintainer or bot review yet label Oct 11, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/auth-atproto

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

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

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

emdash

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

create-emdash

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

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

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

@emdash-cms/plugin-cli

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

@emdash-cms/plugin-test

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-test@4096

@emdash-cms/plugin-types

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

@emdash-cms/registry-client

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

@emdash-cms/registry-lexicons

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

@emdash-cms/registry-loader

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/registry-loader@4096

@emdash-cms/registry-moderation

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/registry-moderation@4096

@emdash-cms/registry-verification

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

upgrade-emdash

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

@emdash-cms/sandbox-workerd

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-ai-search

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-ai-search@4096

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-field-kit

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: cb3c743

@emdashbot emdashbot Bot added the review/needs-review No maintainer or bot review yet label Oct 11, 2026
danielmlr

This comment was marked as duplicate.

@danielmlr danielmlr added the ci:run Approve and re-run CI on the PR's latest commit label Oct 28, 2026
@emdashbot emdashbot Bot added review/needs-review No maintainer or bot review yet and removed review/needs-review No maintainer or bot review yet labels Oct 28, 2026
@github-actions github-actions Bot added review/approved Approved; no new commits since and removed ci:run Approve and re-run CI on the PR's latest commit review/needs-review No maintainer or bot review yet labels Oct 28, 2026

@danielmlr danielmlr 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.

Thank you!

@emdashbot emdashbot Bot added review/approved Approved; no new commits since and removed review/approved Approved; no new commits since labels Oct 28, 2026
@danielmlr
danielmlr merged commit a1a0174 into emdash-cms:main Oct 28, 2026
41 checks passed
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