test: align keyboard navigation with controller paths

This commit is contained in:
Joe Julian
2026-03-29 13:36:51 -07:00
parent 73992a95cc
commit c248b89fcd
+4 -4
View File
@@ -235,10 +235,10 @@ func (u *ui) handleShortcutKey(name key.Name, modifiers key.Modifiers) bool {
func (u *ui) activateBreadcrumb(index int) { func (u *ui) activateBreadcrumb(index int) {
if index <= 0 { if index <= 0 {
u.currentPath = nil u.state.NavigateToPath(nil)
} else { } else {
crumbs := u.breadcrumbLabels() crumbs := u.breadcrumbLabels()
u.currentPath = append([]string{}, crumbs[1:index+1]...) u.state.NavigateToPath(append([]string{}, crumbs[1:index+1]...))
} }
u.filter() u.filter()
if index >= len(u.breadcrumbLabels()) { if index >= len(u.breadcrumbLabels()) {
@@ -255,9 +255,9 @@ func (u *ui) breadcrumbLabels() []string {
return nil return nil
} }
labels := append([]string{"Vault"}, u.currentPath...) labels := append([]string{"Vault"}, u.state.CurrentPath...)
if u.state.Section == appstate.SectionTemplates { if u.state.Section == appstate.SectionTemplates {
labels = append([]string{"Templates"}, u.currentPath...) labels = append([]string{"Templates"}, u.state.CurrentPath...)
} }
return labels return labels
} }