Skip to content

Conversation

@djhi
Copy link
Collaborator

@djhi djhi commented Nov 5, 2025

Problem

When users are redirected to a list page for which they previously applied some parameters (page, perPage, filters, etc.), they don't see those parameters reflected in the URL even though they are indeed applied on the list. This happens for instance when redirected from an edition page. This makes the URL non shareable anymore and can be surprising.

Fixes #11018

Solution

When the list loads, if there are stored parameters and those are not reflected in the URL, update the URL except if:

  • the URL contains any parameters
  • disableSyncLocation is true
  • the parameters are the default ones (we want to keep clean and simple URLs such as /posts)

How To Test

  1. make run
  2. Apply some parameters on the list (filters, sort, perPage and/or page)
  3. Edit a post and save
  4. Check the URL is updated according to the previously set parameters

Performances

  • on the next branch, repeat the steps above but enable the react profiler (devtool) before clicking Save at step 3. Note the number of renders of the List component
  • do the same on this PR branch and compare with the previous number of renders

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@djhi djhi added RFR Ready For Review WIP Work In Progress and removed RFR Ready For Review labels Nov 5, 2025
@fzaninotto
Copy link
Member

Why are all the packages.json updated?

@djhi
Copy link
Collaborator Author

djhi commented Jan 27, 2026

Why are all the packages.json updated?

Probably my editor, reverting

@djhi djhi force-pushed the better-list-url-management branch from ccd5b2b to 22a9fab Compare January 27, 2026 08:17
if (currentStoreKey.current !== storeKey) {
// storeKey has changed
currentStoreKey.current = storeKey;
return;
Copy link
Collaborator

@WiXSL WiXSL Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should return only if the URL already has params; if it’s empty, we need to sync from the store (when disableSyncWithLocation is false, of course).

if (Object.keys(queryFromLocation).length > 0) {
    return;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm, a test is needed for this

@Madeorsk Madeorsk merged commit 22f1f40 into next Feb 5, 2026
15 checks passed
@Madeorsk Madeorsk deleted the better-list-url-management branch February 5, 2026 09:35
@Madeorsk Madeorsk added this to the 5.15.0 milestone Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Work In Progress

Development

Successfully merging this pull request may close these issues.

4 participants