Collapse empty phone detail pane

This commit is contained in:
Joe Julian
2026-03-29 17:41:51 -07:00
parent c0747b62a0
commit 5bcd951e6a
+17 -1
View File
@@ -1078,6 +1078,17 @@ func (u *ui) shouldShowDesktopWorkingHeader() bool {
return u.mode == "desktop" && !u.shouldShowLifecycleSetup() && !u.isVaultLocked()
}
func (u *ui) shouldUseCompactPhoneDetailPane() bool {
if u.mode != "phone" {
return false
}
if u.isVaultLocked() || u.editingEntry {
return false
}
_, ok := u.selectedEntry()
return !ok
}
func (u *ui) chooseExistingFileAction(target *widget.Editor) error {
path, err := pickExistingFile()
if err != nil {
@@ -1384,7 +1395,12 @@ func (u *ui) layout(gtx layout.Context) layout.Dimensions {
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
layout.Rigid(u.phoneSlider),
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
layout.Flexed(1, u.detailPanel),
func() layout.FlexChild {
if u.shouldUseCompactPhoneDetailPane() {
return layout.Rigid(u.detailPanel)
}
return layout.Flexed(1, u.detailPanel)
}(),
)
}
return layout.Flex{Axis: layout.Horizontal}.Layout(gtx,