Remove desktop list pane tabs

This commit is contained in:
Joe Julian
2026-04-07 21:11:48 -07:00
parent 288cb34f1a
commit edac0f50a6
2 changed files with 34 additions and 26 deletions
+18 -26
View File
@@ -6103,33 +6103,25 @@ func (u *ui) listPanel(gtx layout.Context) layout.Dimensions {
} }
func (u *ui) navigationHeader(gtx layout.Context) layout.Dimensions { func (u *ui) navigationHeader(gtx layout.Context) layout.Dimensions {
if u.mode == "phone" { if u.state.Section != appstate.SectionEntries && u.state.Section != appstate.SectionAbout {
if u.state.Section != appstate.SectionEntries && u.state.Section != appstate.SectionAbout { return layout.Dimensions{}
return layout.Dimensions{}
}
if u.state.Section == appstate.SectionAbout {
lbl := material.Label(u.theme, unit.Sp(18), "About")
lbl.Color = accentColor
return lbl.Layout(gtx)
}
return u.groupControlsDisclosure(gtx)
} }
return layout.Flex{Alignment: layout.Middle}.Layout(gtx, if u.state.Section == appstate.SectionAbout {
layout.Flexed(1, func(gtx layout.Context) layout.Dimensions { lbl := material.Label(u.theme, unit.Sp(18), "About")
if u.state.Section == appstate.SectionAbout { lbl.Color = accentColor
lbl := material.Label(u.theme, unit.Sp(18), "About") return lbl.Layout(gtx)
lbl.Color = accentColor }
return lbl.Layout(gtx) return u.groupControlsDisclosure(gtx)
} }
return u.sectionBar(gtx)
}), func (u *ui) navigationHeaderLabel() string {
layout.Rigid(func(gtx layout.Context) layout.Dimensions { if u.state.Section != appstate.SectionEntries && u.state.Section != appstate.SectionAbout {
if u.state.Section != appstate.SectionEntries { return ""
return layout.Dimensions{} }
} if u.state.Section == appstate.SectionAbout {
return u.groupControlsDisclosure(gtx) return "About"
}), }
) return "Group Tools"
} }
func (u *ui) sectionBar(gtx layout.Context) layout.Dimensions { func (u *ui) sectionBar(gtx layout.Context) layout.Dimensions {
+16
View File
@@ -275,6 +275,22 @@ func TestUIListPanelTopSectionsMatchAcrossDesktopAndPhoneForEntries(t *testing.T
} }
} }
func TestUINavigationHeaderMatchesAcrossDesktopAndPhoneForEntries(t *testing.T) {
t.Parallel()
desktop := newUIWithModel("desktop", vault.Model{})
desktop.state.Section = appstate.SectionEntries
phone := newUIWithModel("phone", vault.Model{})
phone.state.Section = appstate.SectionEntries
if got := desktop.navigationHeaderLabel(); got != "Group Tools" {
t.Fatalf("desktop.navigationHeaderLabel() = %q, want %q", got, "Group Tools")
}
if got := phone.navigationHeaderLabel(); got != "Group Tools" {
t.Fatalf("phone.navigationHeaderLabel() = %q, want %q", got, "Group Tools")
}
}
func TestUICurrentVaultSummary(t *testing.T) { func TestUICurrentVaultSummary(t *testing.T) {
t.Parallel() t.Parallel()