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
+7 -15
View File
@@ -6103,7 +6103,6 @@ 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{}
} }
@@ -6114,22 +6113,15 @@ func (u *ui) navigationHeader(gtx layout.Context) layout.Dimensions {
} }
return u.groupControlsDisclosure(gtx) return u.groupControlsDisclosure(gtx)
} }
return layout.Flex{Alignment: layout.Middle}.Layout(gtx,
layout.Flexed(1, func(gtx layout.Context) layout.Dimensions { func (u *ui) navigationHeaderLabel() string {
if u.state.Section != appstate.SectionEntries && u.state.Section != appstate.SectionAbout {
return ""
}
if u.state.Section == appstate.SectionAbout { if u.state.Section == appstate.SectionAbout {
lbl := material.Label(u.theme, unit.Sp(18), "About") return "About"
lbl.Color = accentColor
return lbl.Layout(gtx)
} }
return u.sectionBar(gtx) return "Group Tools"
}),
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
if u.state.Section != appstate.SectionEntries {
return layout.Dimensions{}
}
return u.groupControlsDisclosure(gtx)
}),
)
} }
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()