Skip to content

frontend: ResourceTable: Preserve column filter state #3461

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

skoeva
Copy link
Contributor

@skoeva skoeva commented Jun 10, 2025

This change saves the table column filters to localStorage so that they may persist through navigation and reloads.

Fixes: #2554

Testing

  • Navigate to any resource page in Headlamp (i.e. Pods)
  • Set a filter in the table
  • Restart the page or navigate away and back to the page and ensure that the filter state persists

@skoeva skoeva requested a review from vyncent-t June 10, 2025 12:58
@skoeva skoeva self-assigned this Jun 10, 2025
@skoeva skoeva added the frontend Issues related to the frontend label Jun 10, 2025
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 10, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: skoeva
Once this PR has been reviewed and has the lgtm label, please assign sniok for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested a review from ashu8912 June 10, 2025 12:59
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 10, 2025
@skoeva skoeva force-pushed the filter-state branch 2 times, most recently from e0f196c to fc2ea2b Compare June 11, 2025 16:10
@sniok
Copy link
Contributor

sniok commented Jun 13, 2025

There's something wrong here, when trying to type some characters are ignored or repeated

Here I'm trying to type 123456789 into the column filter:

Recording.2025-06-13.172131.mp4

I think if you put columnFilters into initialState instead of state it should work

Copy link
Contributor

@sniok sniok left a comment

Choose a reason for hiding this comment

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

thanks for updating the PR, left one comment above

@skoeva
Copy link
Contributor Author

skoeva commented Jun 13, 2025

@sniok The issue with putting it in initialState is that the UI won't update in real time, only after refreshing the page; is that better?

@sniok
Copy link
Contributor

sniok commented Jun 16, 2025

The issue with putting it in initialState is that the UI won't update in real time, only after refreshing the page; is that better?

yeah you're right, disregard my suggestion

This change saves the table column filters to localStorage so that they
may persist through navigation and reloads.
@skoeva
Copy link
Contributor Author

skoeva commented Jun 23, 2025

Setting to draft, will close if there is no more activity on the issue

@skoeva skoeva marked this pull request as draft June 23, 2025 17:49
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. frontend Issues related to the frontend size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

Columns filter state preservation
3 participants