feat(app): history navigation preserves filters
previously, when navigating the history using [, ] and -, filters were not saved, so if you went to pods, filtered for /nginx, then went to services and then back to pods, the /nginx filter would not be used and the default pod view would be shown. now, that filter is saved.
closes #3220
Tested this and it seems to work well.
However, I noticed an issue that occurs specifically when filtering by label. The filter is applied correctly, but it’s not visibly shown in the UI.
Steps to reproduce:
Go to :pods
Apply a label filter: -l app.kubernetes.io/instance=cert-manager
Navigate to a different view
Return to :pods
At this point, the correct filter is still applied, but it’s not displayed in the UI, which might be misleading.
@uozalp this is technically a pre-existing bug as I can reproduce it on v0.50.6 by doing :po /-l app.kubernetes.io/instance=cert-manager but it definitely needs to be fixed. I will either include the fix here in this PR or if it's a little involved, make a separate one.
The filter title issue should be fixed by #3405, and does not need to be depended upon for merging or wait for this PR to be merged.
Oh, one side-effect of this is that the filters get saved to the config and upon restart, k9s restores them. I think I like this behavior, but perhaps it should be adapted so users do not start k9s and see filtered results.
@tyzbit Thank you for this update! Looks like we have conflicts, can you take a peek?
It looks like doing a simple rebase results in broken code because this area of the code was refactored in master.
This PR is stale because it has been open for 30 days with no activity.
I don't plan to fix the merge conflicts, so I'm closing this PR.