Skip to content

fix(ui): preserve column visibility during pagination - #17803

Open
ertugakmann wants to merge 1 commit into
payloadcms:mainfrom
ertugakmann:fix/collection-column-visibility-pagination
Open

fix(ui): preserve column visibility during pagination#17803
ertugakmann wants to merge 1 commit into
payloadcms:mainfrom
ertugakmann:fix/collection-column-visibility-pagination

Conversation

@ertugakmann

Copy link
Copy Markdown
Contributor

What?

Fixes an issue where collection table column visibility settings are lost after refreshing the browser and then navigating to another pagination page.

Why?

After a browser refresh, the columns query parameter can be represented as a JSON string in the client query state. When pagination changes, this value was JSON-stringified again, resulting in a double-encoded query parameter.

This caused the server to fail to resolve the column preference and fall back to the default columns.

How?

Avoid JSON-stringifying columns when it is already a string.

Added a regression test covering:

  • changing column visibility
  • refreshing the browser
  • navigating to the next page
  • verifying that the column visibility is preserved

Fixes #17792

@ertugakmann

Copy link
Copy Markdown
Contributor Author

The failing localization and trash E2E checks appear to be unrelated to this change. They fail in test/localization/e2e.spec.ts and test/trash/e2e.spec.ts, while this PR only changes the collection ListQuery serialization and adds a list-view regression test.

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.

Admin panel column user settings lost on page refresh

1 participant