Repository navigation
feat(admin): collection navigation settings — icon and hide from navigation - #3440
Conversation
🦋 Changeset detectedLatest commit: 37a03a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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 |
Scope checkThis 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. |
@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-test
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-loader
@emdash-cms/registry-moderation
@emdash-cms/registry-verification
@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: |
4ad7262 to
153a187
Compare
Query-count snapshot changes6 routes changed, total Δ +7 queries. SQLite
Comparing snapshot files between base and head. Updated automatically on each push. |
There was a problem hiding this comment.
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.mdbelongs 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_collectiontool schemas exposeiconbut nothiddenoradmin.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" |
There was a problem hiding this comment.
[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).
| placeholder="calendar-blank" | |
| placeholder={t`calendar-blank`} |
Overlapping PRsThis 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.
|
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: |
There was a problem hiding this comment.
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
placeholderon 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/resolveNavIconnow honor declared icon names, fall back to built-in or default icons, handle unknown names gracefully, and close the prototype-pollution footnote withObject.hasOwn. hiddenandquickCreatepropagation. The command palette now filters hidden collections; the dashboard filters both hidden and quick-action-opt-out collections; the manifest publishesiconandquickCreate: falseonly when set; the registry clearsiconon empty string and persistsadmin.quickCreate.- Validation. Schema API and MCP tool inputs now trim and cap
iconat 64 characters; seed validation matches the length check and adds a boolean check foradmin.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.mdxandseed-files.mdxdescribe the new settings accurately; thecollection-navigation-settings.mdchangeset 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.
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:
iconfield has existed on collections for a while, but nothing in the admin read it.hiddenflag 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 emptyiconclears 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
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
The demo site has four extra collections:
usersicon) and Certifications (awardicon), both in an "About page" group;settingsicon) with the quick action turned off;The Navigation section in the content type editor:
The sidebar: the About page folder takes the Certifications award icon, Site settings shows a gear, and the hidden Legacy imports collection is absent:
The dashboard quick actions leave out Site settings (quick action off, from #3331) and Legacy imports (hidden):
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:
Targeted tests: admin 99/99, seed validation 72, MCP 456, core schema 411. The command palette test fails with the hidden-collection filter removed.