Skip to content

fix(ui): refresh join-dependent filter options#17355

Open
rasitakyol wants to merge 1 commit into
payloadcms:mainfrom
rasitakyol:agent/fix-join-filter-options-refresh
Open

fix(ui): refresh join-dependent filter options#17355
rasitakyol wants to merge 1 commit into
payloadcms:mainfrom
rasitakyol:agent/fix-join-filter-options-refresh

Conversation

@rasitakyol

Copy link
Copy Markdown
Contributor

What?

  • Refresh parent form state after a joined document is created, updated, or deleted from a Join field drawer.
  • Re-evaluate functional filterOptions without marking the parent document as modified.
  • Keep the canonical Join value independent from interactive table filtering, sorting, and pagination.
  • Add an end-to-end regression for the create flow and its clean parent form state.

Why?

A Join relationship table refreshes its own rows after drawer CRUD, but the parent Form keeps the previous Join value. Functional relationship filterOptions that depend on that Join therefore stay stale until the page is reloaded.

How?

RelationshipTable now reports canonical first-page PaginatedDocs after successful drawer mutations and safely handles failed table-state responses. The Join field writes that data into form state with modification disabled, then requests the existing debounced server form-state flow explicitly. The Form tracks those requests separately from the dirty flag, so dependent fields refresh while the parent Save action remains disabled. The canonical table-state result is reused for the visible table in the normal no-query path; active interactive queries retain their own render fallback.

Validation

  • Node 24.16.0 Playwright subset: 6/6 passing (create, functional filter refresh, update, delete, autosave, and polymorphic drawer)
  • pnpm run build:ui
  • ESLint on all staged TypeScript files: 0 errors
  • Prettier check
  • git diff --check
  • Manual browser QA: new joined post appeared in the dependent relationship options without reload, parent Save remained disabled, and no console errors or Next.js overlay were present

Fixes #11661

@rasitakyol
rasitakyol marked this pull request as ready for review July 16, 2026 07:19
@rasitakyol
rasitakyol force-pushed the agent/fix-join-filter-options-refresh branch from 6003614 to 4e0ccec Compare July 19, 2026 07:58
@rasitakyol

rasitakyol commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

CI note after rebasing onto current main to trigger the previously approval-blocked full workflow: build, lint, and 164 checks are passing.

LexicalAutosaveBlock, LexicalLinkFeature, and LexicalListsFeature all failed during Payload initialization with the same transient MongoDB catalog-change error (payload._array-fields_versions, payloadInitError: true). The editor was then absent on every retry, before the suite logic could exercise this join-filter patch. The same initialization signature occurred concurrently across #17354, #17355, #17371, and #17372, whose diffs are unrelated. All Green is only the aggregate failure.

No patch change is indicated by these logs. A maintainer rerun of the failed E2E jobs would be appreciated.

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.

Relationship filterOptions do not updated after adding item to join field

1 participant