8000 Preserve Filter State When Navigating History · Issue #3220 · derailed/k9s · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Preserve Filter State When Navigating History #3220

New issue

Have a question about this project? Sign up for 8000 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

Open
uozalp opened this issue Mar 18, 2025 · 6 comments
Open

Preserve Filter State When Navigating History #3220

uozalp opened this issue Mar 18, 2025 · 6 comments

Comments

@uozalp
Copy link
Contributor
uozalp commented Mar 18, 2025

Description:
K9s currently supports navigating back ([) and forward (]) through view history. However, when switching between views (e.g., from Pods to Services) and then using the back command, K9s does not restore the previous filter state applied in the Pods view. Instead, it resets to an unfiltered view.

It would be helpful if K9s remembered and restored the filter state when navigating back/forward in history. This would allow users to seamlessly return to their previous context without needing to reapply filters manually.

Use Case:
1. A user filters the Pods view to show only a specific subset of pods.
2. They navigate to the Services view.
3. They press [ to go back to the Pods view.
4. Expected behavior: The filtered state is restored.
5. Current behavior: The filter is lost, and the Pods view resets.

@uozalp
Copy link
Contributor Author
uozalp commented Mar 18, 2025

@tyzbit

@tyzbit
Copy link
Contributor
tyzbit commented Mar 18, 2025

Hi, I like this idea!

When I implemented navigation, I considered but omitted this feature to keep complexity down and hopefully get the feature into hands quicker and also because I wasn't confident this would be functionality every user would want implemented this way. I'd prefer to give users choice or make intelligent, reasonable decisions for them and I wanted the project to have feedback like this to inform what's best for k9s for everyone.

As an aside, you don't need to ping me or other contributors on features they've added. I've only submitted a couple PRs to k9s as a hobbyist - others could come in and try to implement this feature without me, or if they had questions they could ask me then. Thank you!

8000

@uozalp
Copy link
Contributor Author
uozalp commented Mar 18, 2025

Noted on the pinging. I just wanted to acknowledge your previous work, but I’ll keep that in mind going forward.

@tyzbit
Copy link
Contributor
tyzbit commented Apr 26, 2025

Since this seems like a great feature and no one else has picked it up to work on, I'll start working on it (especially since I would appreciate this feature too 😀)

I'll probably implement it as "preserve filter when paging back and forth by default" and if a further feature request comes for configurable behavior, I'll add that option to the config then to be conservative with adding config complexity.

@S-Mann
Copy link
S-Mann commented May 26, 2025

Is this issue being worked on?

@tyzbit
Copy link
Contributor
tyzbit commented May 26, 2025

Yes, but I'm stuck. I need to access the filter history at a point in the code where accessing it requires doing stuff that doesn't seem right. I asked a question in the Slack about it but didn't get any response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0