Skip to content

fix(ui): isolate join table column preferences from list view#15846

Merged
GermanJablo merged 2 commits into
payloadcms:mainfrom
GermanJablo:fix-join-table-preferences-collision
Mar 4, 2026
Merged

fix(ui): isolate join table column preferences from list view#15846
GermanJablo merged 2 commits into
payloadcms:mainfrom
GermanJablo:fix-join-table-preferences-collision

Conversation

@GermanJablo

Copy link
Copy Markdown
Contributor

Summary

  • Isolate join field relationship table preferences from collection list preferences by keying join table state off the parent document field path.
  • Ensure join fields always pass parent metadata to table state resolution, including monomorphic joins.
  • Add an e2e regression test proving that opening a join table with admin.defaultColumns does not overwrite the related collection list columns.

Changes

Join relationship tables were persisting column preferences under the related collection key (for example, collection-posts), which is also used by the main collection list view. This caused join table defaults to overwrite list view columns. The fix scopes join table preferences to the parent join path and provides parent metadata for all join fields so monomorphic joins are isolated as well.

Testing

  • Failing (before fix):
    • pnpm test:e2e joins --grep "should not overwrite list view columns when rendering relationship table with default columns"
    • Error: expect(locator('#heading-id')).toBeHidden() failed (ID column became visible after visiting the join field table)
  • Passing (with this PR):
    • pnpm test:e2e joins --grep "should not overwrite list view columns when rendering relationship table with default columns"

Add an e2e test that proves opening a join relationship table with admin default columns does not overwrite the related collection's main list column preferences.
Prevent join relationship tables from writing to collection-level list preference keys by always supplying parent metadata and persisting table preferences under the parent join path.
@GermanJablo GermanJablo enabled auto-merge (squash) March 4, 2026 17:47
@GermanJablo GermanJablo merged commit 649f117 into payloadcms:main Mar 4, 2026
301 of 305 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚀 This is included in version v3.79.1

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants