Limit group view to direct entries

This commit is contained in:
Joe Julian
2026-04-03 08:51:19 -07:00
parent 520648e42c
commit a5397f37f8
4 changed files with 27 additions and 37 deletions
+11 -7
View File
@@ -844,6 +844,9 @@ func TestUIVisibleEntrySnapshotIsStableAfterVisibleMutation(t *testing.T) {
if got := visible[1].Title; got != "Beta" {
t.Fatalf("visible snapshot second title = %q, want Beta", got)
}
if clicks[1] == nil {
t.Fatal("snapshot click pointer = nil, want stable clickable pointer")
}
}
func TestUIPhoneBackReturnsFromSubscreenToEntries(t *testing.T) {
@@ -1561,8 +1564,8 @@ func TestUIStartOpenRemoteActionAppliesResultOnMainThread(t *testing.T) {
if !manager.HasVault() {
t.Fatal("manager.HasVault() = false after remote result applied, want true")
}
if got := u.filteredTitles(); !slices.Equal(got, []string{"Vault Console"}) {
t.Fatalf("filteredTitles() = %v, want [Vault Console]", got)
if got := u.filteredTitles(); len(got) != 0 {
t.Fatalf("filteredTitles() = %v, want empty at root when entries only appear in child groups", got)
}
}
@@ -1757,8 +1760,8 @@ func TestUIStartOpenVaultActionAppliesResultOnMainThread(t *testing.T) {
if !manager.HasVault() {
t.Fatal("manager.HasVault() = false after background result applied, want true")
}
if got := u.filteredTitles(); !slices.Equal(got, []string{"Vault Console"}) {
t.Fatalf("filteredTitles() = %v, want [Vault Console]", got)
if got := u.filteredTitles(); len(got) != 0 {
t.Fatalf("filteredTitles() = %v, want empty at root when entries only appear in child groups", got)
}
}
@@ -2043,11 +2046,12 @@ func TestUIGroupNavigationLabelsDistinguishRootCurrentAndParent(t *testing.T) {
}
}
func TestUIParentGroupShowsDescendantEntries(t *testing.T) {
func TestUIParentGroupDoesNotShowDescendantEntries(t *testing.T) {
t.Parallel()
u := newUIWithModel("desktop", vault.Model{
Entries: []vault.Entry{
{ID: "joe-note", Title: "Crew Note", Path: []string{"Crew"}},
{ID: "bellagio", Title: "Bellagio", Path: []string{"Crew", "Internet"}},
{ID: "vault-console", Title: "Vault Console", Path: []string{"Crew", "Internet"}},
{ID: "surveillance-console", Title: "Surveillance Console", Path: []string{"Crew", "Home Assistant"}},
@@ -2057,8 +2061,8 @@ func TestUIParentGroupShowsDescendantEntries(t *testing.T) {
u.state.NavigateToPath([]string{"Crew"})
u.filter()
if got := u.filteredTitles(); !slices.Equal(got, []string{"Bellagio", "Vault Console", "Surveillance Console"}) {
t.Fatalf("filteredTitles() = %v, want descendant entries under Crew", got)
if got := u.filteredTitles(); !slices.Equal(got, []string{"Crew Note"}) {
t.Fatalf("filteredTitles() = %v, want only direct entries under Crew", got)
}
}