derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
27.31k stars 1.71k forks source link

I get stuck in the dropdown menu when I try to delete a resource #1745

Open lorenzophys opened 2 years ago

lorenzophys commented 2 years ago




Describe the bug I want to delete my Deployment with Propagation: Orphan, but if I try to interact with the dropdown menu of the deletion popup, I get stuck in the dropdown and there's no way of confirming the deletion: the Enter and the arrows just open the dropdown again. This happens also with deletion of single Pods, ReplicaSet, etc...

To Reproduce

  1. Create a dummy Deployment
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: dummy-deployment
    labels:
    tier: frontend
    spec:
    replicas: 4
    selector:
    matchLabels:
      tier: frontend
    template:
    metadata:
      labels:
        tier: frontend
    spec:
      containers:
        - name: nginx-container
          image: nginx:1.22-alpine
  2. kubectl create -f dummy-deployment.yml
  3. Select the dummy-deployment in k9s
  4. ctrl+d
  5. Move up to the Propagation dropdown and press Enter
  6. You're stuck :/

Expected behavior After selecting the propagation method I expect to be able to move around the deletion popup and confirm the deletion of the Deployment

Versions (please complete the following information):

pcmorrison commented 2 years ago

Tab can get you out of the menu, but really enter should

lorenzophys commented 2 years ago

Yep, tab solved the problem. It's unintuitive since the arrows do the same thing, but not when you're inside the dropdown.

caproven commented 2 years ago

This behavior stems from the tview library, relevant code here: https://github.com/derailed/tview/blob/master/dropdown.go#L415. In essence Enter, Down, & normal chars open the dropdown - problematic when you expect Down to navigate to a new field instead.

I've felt this was a little clunky & unintuitive before as well. Perhaps this issue would be better served under https://github.com/derailed/tview or the parent project https://github.com/rivo/tview.

derailed commented 2 years ago

@lorenzophys @caproven @pcmorrison Thank you all for piping in! I see your point and could probably address it in the fork. But this is really old school form navigation ie tab/backtab to move around form fields. So is it something we should compensate for and upgrade or can this behavior be learned??

caproven commented 2 years ago

I've adapted, and the behavior is consistent across tview applications so I think it is fine. Leaving it to @lorenzophys to give input as they opened this issue.

pcmorrison commented 2 years ago

Maybe a note saying '\<tab> to select' at the bottom of the menu?

lorenzophys commented 2 years ago

@derailed I can easily get used to it, but if there was a note somewhere, as @pcmorrison suggested, it would probably save time to the next confused person.