Label sole saved remote as sync path

This commit is contained in:
Joe Julian
2026-04-06 17:24:43 -07:00
parent 574e2a2762
commit 839cc6cc1c
2 changed files with 83 additions and 2 deletions
+16 -2
View File
@@ -2269,6 +2269,20 @@ func (u *ui) savedRemoteBindingSummary() (profileLabel, credentialLabel string,
return profile.Name, credentialLabel, true
}
func (u *ui) savedRemoteBindingHeading() string {
if !u.shouldShowSavedRemoteBindingSelectors() {
return "Use this vault's saved remote sync target"
}
return "Use a saved remote profile from this vault"
}
func (u *ui) openSelectedVaultRemoteButtonLabel() string {
if !u.shouldShowSavedRemoteBindingSelectors() {
return "Use Remote Sync"
}
return "Open Saved Remote"
}
func remoteBindingSuffix(baseURL, path, username string) string {
sum := sha256.Sum256([]byte(strings.TrimSpace(baseURL) + "\n" + strings.TrimSpace(path) + "\n" + strings.TrimSpace(username)))
return hex.EncodeToString(sum[:8])
@@ -4934,7 +4948,7 @@ func (u *ui) syncMenu(gtx layout.Context) layout.Dimensions {
rows = append(rows,
layout.Rigid(layout.Spacer{Height: unit.Dp(10)}.Layout),
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
lbl := material.Label(u.theme, unit.Sp(11), "Use a saved remote profile from this vault")
lbl := material.Label(u.theme, unit.Sp(11), u.savedRemoteBindingHeading())
lbl.Color = mutedColor
return lbl.Layout(gtx)
}),
@@ -5014,7 +5028,7 @@ func (u *ui) syncMenu(gtx layout.Context) layout.Dimensions {
rows = append(rows,
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
return tonedButton(gtx, u.theme, &u.openSelectedVaultRemote, "Open Saved Remote")
return tonedButton(gtx, u.theme, &u.openSelectedVaultRemote, u.openSelectedVaultRemoteButtonLabel())
}),
)
}