Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist sorting in Browse models #42537

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Persist sorting in Browse models #42537

wants to merge 2 commits into from

Conversation

rafpaf
Copy link
Contributor

@rafpaf rafpaf commented May 10, 2024

This branch persists sorting of Browse models table in the API and adds an e2e test

Closes #42952

Copy link
Contributor Author

rafpaf commented May 10, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @rafpaf and the rest of your teammates on Graphite Graphite

@metabase-bot metabase-bot bot added the .Team/AdminWebapp Admin and Webapp team label May 10, 2024
@rafpaf rafpaf marked this pull request as ready for review May 10, 2024 21:27
@rafpaf rafpaf requested a review from camsaul as a code owner May 10, 2024 21:27
@graphite-app graphite-app bot added the no-backport Do not backport this PR to any branch label May 10, 2024
@graphite-app graphite-app bot requested a review from a team May 10, 2024 21:27
@rafpaf rafpaf changed the title Squashed branch Persist browse model sorting May 10, 2024
@rafpaf rafpaf changed the title Persist browse model sorting Persist sorting in Browse models May 10, 2024
Copy link

graphite-app bot commented May 10, 2024

Graphite Automations

"Notify author when CI fails" took an action on this PR • (05/10/24)

1 teammate was notified to this PR based on Raphael Krut-Landau's automation.

"Don't backport" took an action on this PR • (05/10/24)

1 label was added and 1 reviewer was added to this PR based on Raphael Krut-Landau's automation.

@rafpaf rafpaf added this to the 0.50 milestone May 10, 2024
:visibility :authenticated
:type :string
:default "asc")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are so closely related I thought about storing them together as a JSONified string, or as a string like "+name" or "-name", but this flat, explicit approach seems simplest

Copy link
Contributor

Choose a reason for hiding this comment

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

We often will used a closed set of valid choices here. No worries not to, but need to make sure that the FE can handle invalid input.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the sort column is invalid - neither "asc" or "desc" - then the FE defaults to ascending

Copy link
Contributor

Choose a reason for hiding this comment

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

and also the column to sort on? (no need to respond, just making sure we are defensive)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, to correct my earlier statement: if the sort direction in the API is invalid (or absent) we default to asc.

If the sort column in the API is invalid (or absent), we default to collection.

Copy link

replay-io bot commented May 10, 2024

Status Complete ↗︎
Commit 14a79a9
Results
⚠️ 2 Flaky
2566 Passed

@rafpaf rafpaf removed this from the 0.50 milestone May 14, 2024
@rafpaf rafpaf marked this pull request as draft May 20, 2024 19:44
@rafpaf rafpaf marked this pull request as ready for review May 20, 2024 19:45
@rafpaf rafpaf requested a review from dhuniverse May 20, 2024 19:50
Copy link
Contributor

@iethree iethree left a comment

Choose a reason for hiding this comment

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

  1. I think persisting sort direction is not a priority for this feature, and introduces unnecessary complexity, for a tiny benefit to users that they will not likely notice.
  2. this likely adds complexity to improving performance, so I'd prefer to defer this until that is sorted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport Do not backport this PR to any branch .Team/AdminWebapp Admin and Webapp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Browse] Preserve sort on page reload
4 participants