Skip to content

fix(table): fix label display when a command + filter + label is provided #3405

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tyzbit
Copy link
Contributor

@tyzbit tyzbit commented Jun 18, 2025

currently, if you use :svc -l app.kubernetes.io/instance=cert-manager in k9s and then navigate history, when returning to the page the results are correct but the filter is not shown. here, we ensure that the table title string is not an empty string.

reported in #3404, but unrelated

bug originally introduced in #3293, which I have not reviewed for any other rippling effects.

@tyzbit tyzbit marked this pull request as draft June 18, 2025 16:30
@tyzbit tyzbit marked this pull request as ready for review June 18, 2025 17:14
@tyzbit tyzbit force-pushed the fix-label-display branch from 7b4d9c7 to 421a0ea Compare July 5, 2025 23:20
@uozalp
Copy link
Contributor

uozalp commented Jul 7, 2025

@derailed This bug is still present in v0.50.7 with the refactored code.

@derailed
Copy link
Owner

@uozalp Thanks for the heads up! Just tried it on v0.50.9 and the behavior seems correct??
Could you double check me on this? perhaps I am missing it...

@uozalp
Copy link
Contributor

uozalp commented Jul 16, 2025

@derailed I tested this again on v0.50.9, and the behavior is the same. When switching away from :pods and coming back, the label filter isn't preserved. That's expected though, since K9s doesn't currently support keeping filters across views.

Just to clarify, the issue I mentioned earlier #3404 (comment) was something I noticed while testing the PR from tyzbit:preserve-command-filter

I cherry-picked commit [421a0ea8b01a3cfaf3a1a5d54232a00e9ec8095b] onto v0.50.9 to try it out. There wasn't any visible change in the UI, which makes sense since the filter persistence feature hasn’t been implemented yet.

The code itself looks good and seems safe to merge, but on its own it probably doesn't add much value without the full preserve filter feature in place.

As already mentioned, that PR will need some rework after the navigation history refactor in v0.50.7. Still, it's a feature I'm really looking forward to. Having filters stick when navigating would be super useful

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

Successfully merging this pull request may close these issues.

3 participants