Skip to content

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

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

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

Conversation

@rasitakyol

@rasitakyol rasitakyol commented Jul 16, 2026 •

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.

The branch is rebased onto the current main and retains the sibling and polymorphic Join refresh coverage added upstream.

Validation

  • Node 24.16.0 targeted Playwright coverage: 9/9 passing (functional filter refresh plus create, update, delete, autosave, sibling, and polymorphic Join flows)
  • Full joins Playwright suite: 35/35 passing
  • pnpm run build:ui
  • ESLint on changed UI source: 0 errors (3 pre-existing no-explicit-any warnings outside this diff)
  • Prettier check on all changed files
  • 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 update for rebased head 4301755664f888afba523bdecb4d40b84afc3133 on current main:

  • 169 checks succeeded and 4 were skipped.
  • The only source-job failures were LexicalJSXConverter and LexicalViewsNested; All Green is their aggregate failure.
  • Both failed jobs logged the same Payload onInit error before their suite behavior could run: MongoDB code 112 WriteConflict / TransientTransactionError, “Unable to write to collection payload._array-fields_versions due to catalog changes”, with payloadInitError: true.
  • The missing Lexical editor assertions were downstream effects of that initialization failure. This PR does not change either Lexical suite or its configuration.
  • Local validation on this head passed the targeted Join coverage (9/9), the full joins Playwright suite (35/35), and pnpm run build:ui; manual browser QA also confirmed that the dependent relationship options refresh without reloading while the parent Save action remains disabled.

I attempted to rerun the failed workflow jobs through gh, but GitHub requires repository admin rights. A maintainer rerun of the two failed E2E jobs would be appreciated. The PR remains in draft until CI is clean.

Run: https://github.com/payloadcms/payload/actions/runs/30242633538

@rasitakyol
rasitakyol force-pushed the agent/fix-join-filter-options-refresh branch from 4301755 to 1c4e744 Compare July 31, 2026 07:51
@rasitakyol
rasitakyol marked this pull request as ready for review July 31, 2026 08:40
@rasitakyol rasitakyol closed this Aug 23, 2026
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