test: align keyboard navigation with controller paths
This commit is contained in:
+4
-4
@@ -235,10 +235,10 @@ func (u *ui) handleShortcutKey(name key.Name, modifiers key.Modifiers) bool {
|
||||
|
||||
func (u *ui) activateBreadcrumb(index int) {
|
||||
if index <= 0 {
|
||||
u.currentPath = nil
|
||||
u.state.NavigateToPath(nil)
|
||||
} else {
|
||||
crumbs := u.breadcrumbLabels()
|
||||
u.currentPath = append([]string{}, crumbs[1:index+1]...)
|
||||
u.state.NavigateToPath(append([]string{}, crumbs[1:index+1]...))
|
||||
}
|
||||
u.filter()
|
||||
if index >= len(u.breadcrumbLabels()) {
|
||||
@@ -255,9 +255,9 @@ func (u *ui) breadcrumbLabels() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
labels := append([]string{"Vault"}, u.currentPath...)
|
||||
labels := append([]string{"Vault"}, u.state.CurrentPath...)
|
||||
if u.state.Section == appstate.SectionTemplates {
|
||||
labels = append([]string{"Templates"}, u.currentPath...)
|
||||
labels = append([]string{"Templates"}, u.state.CurrentPath...)
|
||||
}
|
||||
return labels
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user