Skip to content

Update useTableURLState hook for sticky table sort - #50720

Merged
bbovenzi merged 1 commit into
apache:mainfrom
guan404ming:stick-table-sort
May 20, 2025
Merged

bbovenzi merged 1 commit into
apache:mainfrom
guan404ming:stick-table-sort

Conversation

@guan404ming

@guan404ming guan404ming commented May 17, 2025 •

Copy link
Copy Markdown
Member

Related PR

as a following PR for #50600
cc: @bbovenzi @pierrejeambrun

Why

since different people may want different sort order in the same instance. Make the sort be sticky would rather a good choice than be a global config

How

Update useTableURLState to store the sort into localStorage for pages using the table and use it as a default value. This solution could not only support for dag list pages but for all pages with sortable table.

local storage may look like

image

current ui

Screen.Recording.2025-05-17.at.4.34.36.PM.mov

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label May 17, 2025
@guan404ming guan404ming changed the title Update useTableURLState hook for sticky table sort Update useTableURLState hook for sticky table sort May 17, 2025

@aritra24 aritra24 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good! Thanks!

@guan404ming

Copy link
Copy Markdown
Member Author

Thanks!

@bbovenzi bbovenzi added this to the Airflow 3.0.2 milestone May 20, 2025
@bbovenzi
bbovenzi merged commit 06278ce into apache:main May 20, 2025
github-actions Bot pushed a commit that referenced this pull request May 20, 2025
(cherry picked from commit 06278ce)

Co-authored-by: Guan Ming(Wesley) Chiu <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-0-test

Status Branch Result
✅ v3-0-test PR Link

@guan404ming
guan404ming deleted the stick-table-sort branch May 21, 2025 02:53
@guan404ming

Copy link
Copy Markdown
Member Author

Thanks!

pierrejeambrun pushed a commit that referenced this pull request May 21, 2025
… (#50858)

(cherry picked from commit 06278ce)

Co-authored-by: Guan Ming(Wesley) Chiu <[email protected]>
aaron-y-chen pushed a commit to aaron-y-chen/airflow that referenced this pull request May 21, 2025
kaxil pushed a commit that referenced this pull request Jun 3, 2025
… (#50858)

(cherry picked from commit 06278ce)

Co-authored-by: Guan Ming(Wesley) Chiu <[email protected]>
sanederchik pushed a commit to sanederchik/airflow that referenced this pull request Jun 7, 2025
bbovenzi pushed a commit that referenced this pull request Sep 25, 2026
stateToSearchParams dropped the sort param when it equalled the sort
saved in localStorage. Since #50720 the saved sort is updated on every
change, so after sorting a column and paging, the URL lost the sort
while the table still applied it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants