Skip to content

DataViews: Routing related issues. #60709

@youknowriad

Description

@youknowriad

Description

Sometimes some url arguments linger when navigating between data views related pages, potentially causing bugs in some pages.

Step-by-step reproduction instructions

Bug 1

1- Go to pages: The url should be path=%2Fpage
2- Click "drafts": The url becomes something like path=%2Fpage&activeView=drafts&isCustom=false

The first issue here is that I think "isCustom=false" shouldn't be present in the url because "false" is the default value. If an optional argument equals its default value, it should ideally be dropped from the url (nicer urls)

3- Go back to "all pages" The url becomes something like path=%2Fpage&activeView=all&isCustom=false

Notice that 1 and 3 refer to the same page with two different URLs, this is not great, 3 should just use the same url as 1 (omitting default values from the url).

Bug 2

This one is more important than the previous bug:

1- Go to pages: The url should be path=%2Fpage
2- Click "drafts": The url becomes something like path=%2Fpage&activeView=drafts&isCustom=false
3- Click the "back" button on the sidebar to go back to the root level of the site editor: The url becomes activeView=drafts&isCustom=false

Note the lingering activeView and isCustom arguments that should ideally be removed at this stage (we should end up with no argument in the url (it's the root of the site editor)

4- Click "templates", you'll end up in a broken state in the templates page (empty list) because of the lingering arguments in the url.

Bug 3

  • Go to Patterns.
  • Select the "All Template part" category and then one of the Template Parts.
  • Go to the editor.
  • Go back to the patterns page.
  • Note how the section selected is the "All patterns" though it should be "All template parts".

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Labels

[Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Type] BugAn existing feature does not function as intended

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions