Skip to content

Fix draft navigation reference picker#1142

Open
kernelpanic888 wants to merge 1 commit into
NWACus:mainfrom
kernelpanic888:fix/nav-draft-reference-picker
Open

Fix draft navigation reference picker#1142
kernelpanic888 wants to merge 1 commit into
NWACus:mainfrom
kernelpanic888:fix/nav-draft-reference-picker

Conversation

@kernelpanic888

@kernelpanic888 kernelpanic888 commented Jul 6, 2026

Copy link
Copy Markdown

Description

Fixes #1084 by taking the simpler "exclude drafts" path from the issue brief.

The navigation relationship picker now keeps the existing tenant scoping and adds _status = published only when Payload is loading pages or posts options. builtInPages are left with the original tenant-only filter because they do not have draft state.

Related Issues

Fixes #1084

Key Changes

  • Added getTenantAndPublishedFilter for polymorphic navigation references.
  • Switched the shared link relationship field to use that filter.
  • Added regression coverage for:
    • published-only filtering on pages/posts,
    • preserving tenant scoping,
    • leaving built-in page references unaffected,
    • existing live-site behavior that drops draft page references.

How to test

  • pnpm run lint-staged
  • pnpm run tsc
  • pnpm test
  • pnpm drift:check
  • pnpm fallow:audit --ci
  • .husky/check-migrations

Screenshots / Demo video

Not included; this is a relationship picker filtering change with unit coverage.

Migration Explanation

No migration needed.

Future enhancements / Questions

The draft badge approach from the issue would still be a richer UX, but it requires a custom Payload relationship field component. This PR keeps the change small by excluding drafts from the picker.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve UX or exclude draft pages from navigation

1 participant