Fix high prio recommendations, add error / health screen
This commit is contained in:
@@ -38,6 +38,7 @@ type NavigationKeyBindings struct {
|
||||
type ViewKeyBindings struct {
|
||||
Open []string `toml:"open"`
|
||||
Dashboard []string `toml:"dashboard"`
|
||||
Health []string `toml:"health"`
|
||||
Edit []string `toml:"edit"`
|
||||
ToggleList []string `toml:"toggle_list"`
|
||||
}
|
||||
@@ -117,7 +118,7 @@ func defaultKeyBindings() KeyBindings {
|
||||
},
|
||||
Views: ViewKeyBindings{
|
||||
Open: []string{"enter", "l"}, Dashboard: []string{"d"},
|
||||
Edit: []string{"e"}, ToggleList: []string{"tab"},
|
||||
Health: []string{"H"}, Edit: []string{"e"}, ToggleList: []string{"tab"},
|
||||
},
|
||||
Threads: ThreadKeyBindings{
|
||||
Search: []string{"/"}, ClearFilter: []string{"F"},
|
||||
@@ -322,6 +323,8 @@ func (k KeyBindings) canonicalMainKey(key string, current screen) string {
|
||||
switch {
|
||||
case keyMatches(key, k.Views.Dashboard):
|
||||
return "d"
|
||||
case keyMatches(key, k.Views.Health):
|
||||
return "H"
|
||||
case keyMatches(key, k.Views.Edit):
|
||||
return "e"
|
||||
default:
|
||||
@@ -383,7 +386,8 @@ func validateKeyBindings(bindings KeyBindings) error {
|
||||
}},
|
||||
{"keybindings.views", map[string][]string{
|
||||
"open": bindings.Views.Open, "dashboard": bindings.Views.Dashboard,
|
||||
"edit": bindings.Views.Edit, "toggle_list": bindings.Views.ToggleList,
|
||||
"health": bindings.Views.Health, "edit": bindings.Views.Edit,
|
||||
"toggle_list": bindings.Views.ToggleList,
|
||||
}},
|
||||
{"keybindings.threads", map[string][]string{
|
||||
"search": bindings.Threads.Search, "clear_filter": bindings.Threads.ClearFilter,
|
||||
@@ -463,6 +467,7 @@ func validateKeyBindingContexts(bindings KeyBindings) error {
|
||||
{"back", general.Back}, {"down", navigation.Down}, {"up", navigation.Up},
|
||||
{"first", navigation.First}, {"last", navigation.Last},
|
||||
{"page_down", navigation.PageDown}, {"page_up", navigation.PageUp},
|
||||
{"health", views.Health},
|
||||
}
|
||||
if err := validateKeyContext("pull request list", append(screenCommon,
|
||||
contextBinding{"open", views.Open},
|
||||
@@ -476,6 +481,9 @@ func validateKeyBindingContexts(bindings KeyBindings) error {
|
||||
)...); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateKeyContext("health screen", screenCommon...); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateKeyContext("review threads", append(screenCommon,
|
||||
contextBinding{"left", navigation.Left},
|
||||
contextBinding{"right", navigation.Right},
|
||||
|
||||
Reference in New Issue
Block a user