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
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