Local-first remote sync and cross-platform UI parity #2

Merged
joejulian merged 53 commits from feature/local-first-remote-sync into main 2026-04-11 06:15:47 +00:00
2 changed files with 34 additions and 26 deletions
Showing only changes of commit edac0f50a6 - Show all commits
+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 {
if u.mode == "phone" {
if u.state.Section != appstate.SectionEntries && u.state.Section != appstate.SectionAbout {
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)
if u.state.Section != appstate.SectionEntries && u.state.Section != appstate.SectionAbout {
return layout.Dimensions{}
}
return layout.Flex{Alignment: layout.Middle}.Layout(gtx,
layout.Flexed(1, func(gtx layout.Context) 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.sectionBar(gtx)
}),
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
if u.state.Section != appstate.SectionEntries {
return layout.Dimensions{}
}
return u.groupControlsDisclosure(gtx)
}),
)
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)
}
func (u *ui) navigationHeaderLabel() string {
if u.state.Section != appstate.SectionEntries && u.state.Section != appstate.SectionAbout {
return ""
}
if u.state.Section == appstate.SectionAbout {
return "About"
}
return "Group Tools"
}
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) {
t.Parallel()