Skip to content

History navigation: new view after going back should truncate forward history #3406

@uozalp

Description

@uozalp

When using the history navigation in K9s, if I go back in history and then switch to a new view, the new view is currently added to the end of the history list, but all the "forward" history is kept. This results in a confusing navigation experience, as the history no longer reflects a linear path.

I would expect the behavior to be similar to browser history:

  • If I go back in history and then switch to a new view, all forward history from the current index should be discarded, and the new view should be added at the end.
  • This way, the history always represents the actual navigation path, and "back" and "forward" actions remain intuitive.

Steps to reproduce:

  1. Navigate through several views.
  2. Go back in history.
  3. Switch to a new view.
  4. Observe that the new view is appended, but the forward history is still present.

Expected behavior:
After switching to a new view from a previous point in history, all forward history should be truncated before adding the new view.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestin-progressMark issue as being worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions