Skip to content
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

feat: allow override of plugins & hotkeys shortcuts #2510

Merged
merged 5 commits into from
Feb 7, 2024

Conversation

othmane399
Copy link
Contributor

@othmane399 othmane399 commented Jan 29, 2024

This PR make the possibility to override some default keys by a plugin shortcut or a hotkey.

It resolve this issue #1736

adding override: true in a plugin or hotkey definition makes the override possible.

@JoupainMD
Copy link

awesome dude !

@othmane399
Copy link
Contributor Author

@derailed can you check this out ? 🙏

Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@othmane399 Clever! Thanks for this update Othmane.
We should doc this out so user are aware of this functionality.
Also tho this might open pandora's box and hose familiar keys it does enable folks to override keys to their liking.

@@ -76,7 +76,7 @@ func hotKeyActions(r Runner, aa ui.KeyActions) error {
continue
}
_, ok := aa[key]
if ok {
if ok && !hk.Override {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should flag this in the logs so users can check why a familiar key either stopped working or enabled a different functionality... Best to let users know which plugin/hotkey caused it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @derailed, done for docs and logging :)

Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@othmane399 Thank you for the updates!

@@ -524,8 +524,9 @@ In order to surface hotkeys globally please follow these steps:
description: Xray Deployments
command: xray deploy
# Hitting Ctrl-U view the resources in the namespace of your current selection
ctrl-u:
shortCut: Ctrl-U
shift-s:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing the shortcut? No longer matches the comment above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I've fixed the command above, the idea here was to choose a shortcut that already exist to makes the override logic in the example (as Shift-S default shortcut sort pods)

Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@othmane399 Thank you for the updates Othmane!

@derailed derailed merged commit 914bffc into derailed:master Feb 7, 2024
2 of 3 checks passed
placintaalexandru pushed a commit to placintaalexandru/k9s that referenced this pull request Apr 3, 2024
* feat: allow override of plugins & hotkeys shortcuts

* add docs and log.info when overrides

* edit log message

* fix doc

* Update README.md
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.

None yet

3 participants