Skip to content

feat(admin): collection navigation settings — icon and hide from navigation - #3440

Merged
ascorbic merged 4 commits into
emdash-cms:mainfrom
swissky:feat/collection-navigation-settings-v2
Sep 27, 2026
Merged

ascorbic merged 4 commits into
emdash-cms:mainfrom
swissky:feat/collection-navigation-settings-v2

Conversation

@swissky

@swissky swissky commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

This is the second slice of the approved sidebar Discussion #3061, following #3062 (collection groups). It adds two settings to the Navigation section of the content type editor:

  • Icon: a Phosphor icon name. The sidebar, and command palette navigation, now render the declared icon instead of the generic document glyph. A folder takes the icon of its first collection that declares one. Unknown names fall back to the default icon. The icon field has existed on collections for a while, but nothing in the admin read it.
  • Hide from navigation: surfaces the existing hidden flag in the editor. The command palette now respects it too. Before this PR, the sidebar and the dashboard skipped hidden collections, but the palette still listed them.

The manifest publishes icon. Icon names are validated consistently: trimmed and at most 64 characters in the schema API and MCP tools, and at most 64 characters in seed files. Sending an empty icon clears it.

Stacked on #3331 (the dashboard quick-action opt-out, admin.quickCreate, already approved). Until #3331 merges, this diff includes its commits. After that, only the icon and hidden changes remain. The "Quick action on the dashboard" switch in the screenshots comes from #3331.

Part of #1023. The plugin-page grouping slice from the same Discussion follows as a separate PR.

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Cursor + Claude Opus 5.5

Screenshots / test output

The demo site has four extra collections:

  • Team (users icon) and Certifications (award icon), both in an "About page" group;
  • Site settings (settings icon) with the quick action turned off;
  • Legacy imports, which is hidden.

The Navigation section in the content type editor:

Content type editor showing the Navigation section with Group, Icon set to "settings", and the Hide from navigation and Quick action on the dashboard switches

The sidebar: the About page folder takes the Certifications award icon, Site settings shows a gear, and the hidden Legacy imports collection is absent:

Admin sidebar with an expanded About page folder containing Certifications and Team, followed by Pages, Posts, and Site settings with a gear icon

The dashboard quick actions leave out Site settings (quick action off, from #3331) and Legacy imports (hidden):

Dashboard header with quick actions for Certification, Page, Post, and Team member, but none for Site settings or Legacy imports

The same editor section in Arabic (RTL). The layout mirrors correctly, and the new strings show in English until the catalogs are extracted on merge:

Content type editor in Arabic with right-to-left layout, the Navigation section fields and switches aligned to the right

Targeted tests: admin 99/99, seed validation 72, MCP 456, core schema 411. The command palette test fails with the hidden-collection filter removed.

@changeset-bot

changeset-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 37a03a8

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

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

@swissky swissky added the bot:review Trigger an emdashbot code review on this PR label Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR touches 27 files. PRs with a broad scope are harder to review. Please confirm the scope hasn't drifted beyond the intended change.

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.

@github-actions github-actions Bot added the review/needs-review No maintainer or bot review yet label Sep 25, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/auth-atproto

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

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

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

emdash

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

create-emdash

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

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

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

@emdash-cms/plugin-cli

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

@emdash-cms/plugin-test

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

@emdash-cms/plugin-types

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

@emdash-cms/registry-client

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

@emdash-cms/registry-lexicons

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

@emdash-cms/registry-loader

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

@emdash-cms/registry-moderation

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

@emdash-cms/registry-verification

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

@emdash-cms/sandbox-workerd

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-field-kit

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: 37a03a8

@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Sep 25, 2026
@swissky
swissky force-pushed the feat/collection-navigation-settings-v2 branch from 4ad7262 to 153a187 Compare September 25, 2026 09:35
@swissky swissky changed the title feat(admin): collection navigation settings — icon, hide from navigation, dashboard quick action feat(admin): collection navigation settings — icon and hide from navigation Sep 25, 2026
@swissky swissky added the bot:review Trigger an emdashbot code review on this PR label Sep 25, 2026
@github-actions github-actions Bot added the query-count changed PR diff modifies query-count snapshot files label Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Query-count snapshot changes

6 routes changed, total Δ +7 queries.

SQLite

Route Before After Δ
GET /category/development (cold) 11 12 +1
GET /category/development (warm) 10 11 +1
GET /posts/building-for-the-long-term (cold) 16 17 +1
GET /posts/building-for-the-long-term (warm) 15 17 +2
GET /tag/webdev (cold) 10 11 +1
GET /tag/webdev (warm) 10 11 +1

Comparing snapshot files between base and head. Updated automatically on each push.

@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 the right change for the approved sidebar navigation work in Discussion #3061. It surfaces the long-existing icon and hidden collection fields (plus the admin.quickCreate opt-out carried from #3331) consistently across the manifest, admin content-type editor, sidebar, dashboard quick actions, and command palette. I checked the diff, the affected admin and core files, tests, and docs/changesets.

Headline conclusion: the implementation is sound and the tests cover the new behavior. The only real issue is an i18n convention slip: the new Icon input has a hard-coded English placeholder while its label and help text are already wrapped with Lingui. Please fix that.

A couple of non-blocking notes:

  • .changeset/collection-quick-create-opt-out.md belongs to the stacked #3331; it will disappear from this diff once the branch is rebased after #3331 lands. Make sure it isn’t accidentally duplicated in the final merge.
  • The MCP schema_update_collection / schema_create_collection tool schemas expose icon but not hidden or admin.quickCreate. That’s fine if MCP support is out of scope for this slice, but worth confirming whether parity with the UI is intended before the feature is considered complete.

label={t`Icon`}
value={icon}
onChange={(e) => setIcon(e.target.value)}
placeholder="calendar-blank"

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.

[needs fixing] The new Icon input localizes its label and help text but leaves the placeholder as a bare English string. Per AGENTS.md, all user-facing strings in the admin UI should go through Lingui (including placeholder attributes).

Suggested change
placeholder="calendar-blank"
placeholder={t`calendar-blank`}

@emdashbot emdashbot Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed bot:review Trigger an emdashbot code review on this PR review/needs-review No maintainer or bot review yet labels Sep 25, 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.

The help text below the field already names example icons.
@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 Sep 25, 2026
@swissky swissky added the bot:review Trigger an emdashbot code review on this PR label Sep 25, 2026
@swissky

swissky commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

Thanks for the review. The icon placeholder is gone: the help text under the field already names example icons, and an icon name is an identifier that shouldn't be translated. On MCP: icon was already in the MCP collection tools before this PR. Adding hidden and admin.quickCreate there is a separate follow-up, so this PR stays scoped to the admin UI.

@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 the right continuation of the approved sidebar navigation work in Discussion #3061. It surfaces the long-existing icon and hidden collection fields (plus the admin.quickCreate opt-out carried from the stacked #3331) consistently across the manifest, content-type editor, sidebar, dashboard quick actions, and command palette. The approach fits EmDash’s architecture, the tests cover the new behavior, docs stay accurate, and there are no SQL, auth, localization, or logged-out-query regressions.

What checked out:

  • Prior finding fixed. The hard-coded English placeholder on the new Icon input was removed; the remaining label and help text are Lingui-wrapped, so the i18n slip from the last review is gone.
  • Icon resolution. getCollectionNavIcon / resolveNavIcon now honor declared icon names, fall back to built-in or default icons, handle unknown names gracefully, and close the prototype-pollution footnote with Object.hasOwn.
  • hidden and quickCreate propagation. The command palette now filters hidden collections; the dashboard filters both hidden and quick-action-opt-out collections; the manifest publishes icon and quickCreate: false only when set; the registry clears icon on empty string and persists admin.quickCreate.
  • Validation. Schema API and MCP tool inputs now trim and cap icon at 64 characters; seed validation matches the length check and adds a boolean check for admin.quickCreate.
  • Tests. New regression tests cover hidden collections in the command palette, icon/folder-icon inheritance, saving icon/visibility/quckCreate in the editor, and clearing the icon via empty string.
  • Docs and changesets. collections.mdx and seed-files.mdx describe the new settings accurately; the collection-navigation-settings.md changeset is useful, user-facing release documentation.

One housekeeping note, not a blocker: the collection-quick-create-opt-out.md changeset still appears because this branch is stacked on #3331. Make sure it is dropped during the final rebase, as noted in the PR description, to avoid duplicate CHANGELOG entries. Similarly, MCP schema_create/update_collection still do not expose hidden or admin.quickCreate; that’s fine if parity with the UI is intentionally out of scope for this slice, but worth confirming before calling the navigation feature complete.

Overall: clean, ready to land after the stacked rebase.

@emdashbot emdashbot Bot added review/approved Approved; no new commits since and removed bot:review Trigger an emdashbot code review on this PR review/needs-rereview New commits since the last review labels Sep 25, 2026
@ascorbic
ascorbic merged commit 03b6b3b into emdash-cms:main Sep 27, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/admin area/core area/docs cla: signed query-count changed PR diff modifies query-count snapshot files review/approved Approved; no new commits since size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants