Align remote setup copy with vault bindings
This commit is contained in:
@@ -2109,6 +2109,10 @@ func (u *ui) remotePreferencesRetentionSummary() string {
|
|||||||
return "KeePassGO keeps up to six recent connections. Store remote credentials in the vault if this connection should persist across devices or reinstalls."
|
return "KeePassGO keeps up to six recent connections. Store remote credentials in the vault if this connection should persist across devices or reinstalls."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u *ui) remotePreferencesPersistenceSummary() string {
|
||||||
|
return "After a successful remote open, KeePassGO can keep a local cache vault and store the shared remote target plus this user's credential entry in the vault itself."
|
||||||
|
}
|
||||||
|
|
||||||
func (u *ui) availableRemoteProfiles() []vault.RemoteProfile {
|
func (u *ui) availableRemoteProfiles() []vault.RemoteProfile {
|
||||||
profiles, err := u.state.RemoteProfiles()
|
profiles, err := u.state.RemoteProfiles()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -2280,6 +2284,14 @@ func (u *ui) saveCurrentRemoteBindingAction() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u *ui) saveCurrentRemoteBindingHeading() string {
|
||||||
|
return "Bind this local vault to the current remote target"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *ui) saveCurrentRemoteBindingButtonLabel() string {
|
||||||
|
return "Save Remote In Vault"
|
||||||
|
}
|
||||||
|
|
||||||
func (u *ui) materializeCurrentRemoteCache() error {
|
func (u *ui) materializeCurrentRemoteCache() error {
|
||||||
cachePath := strings.TrimSpace(u.vaultPath.Text())
|
cachePath := strings.TrimSpace(u.vaultPath.Text())
|
||||||
if cachePath == "" {
|
if cachePath == "" {
|
||||||
@@ -4377,7 +4389,7 @@ func (u *ui) remotePrefsDialogContent(gtx layout.Context) layout.Dimensions {
|
|||||||
},
|
},
|
||||||
layout.Spacer{Height: unit.Dp(8)}.Layout,
|
layout.Spacer{Height: unit.Dp(8)}.Layout,
|
||||||
func(gtx layout.Context) layout.Dimensions {
|
func(gtx layout.Context) layout.Dimensions {
|
||||||
return approvalFact(u.theme, "When Sign-in Saves", "Username and password or app token are only stored after a successful remote open when Remember sign-in is enabled.", "")(gtx)
|
return approvalFact(u.theme, "How Persistence Works", u.remotePreferencesPersistenceSummary(), "")(gtx)
|
||||||
},
|
},
|
||||||
layout.Spacer{Height: unit.Dp(14)}.Layout,
|
layout.Spacer{Height: unit.Dp(14)}.Layout,
|
||||||
func(gtx layout.Context) layout.Dimensions {
|
func(gtx layout.Context) layout.Dimensions {
|
||||||
@@ -4972,13 +4984,13 @@ func (u *ui) syncMenu(gtx layout.Context) layout.Dimensions {
|
|||||||
rows = append(rows,
|
rows = append(rows,
|
||||||
layout.Rigid(layout.Spacer{Height: unit.Dp(10)}.Layout),
|
layout.Rigid(layout.Spacer{Height: unit.Dp(10)}.Layout),
|
||||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||||
lbl := material.Label(u.theme, unit.Sp(11), "Store the current remote sign-in in this vault")
|
lbl := material.Label(u.theme, unit.Sp(11), u.saveCurrentRemoteBindingHeading())
|
||||||
lbl.Color = mutedColor
|
lbl.Color = mutedColor
|
||||||
return lbl.Layout(gtx)
|
return lbl.Layout(gtx)
|
||||||
}),
|
}),
|
||||||
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
|
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
|
||||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||||
return tonedButton(gtx, u.theme, &u.saveCurrentRemoteBinding, "Save Current Remote In Vault")
|
return tonedButton(gtx, u.theme, &u.saveCurrentRemoteBinding, u.saveCurrentRemoteBindingButtonLabel())
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5511,6 +5511,16 @@ func TestUIRemotePreferencesHelpExplainsLocationOnlyRetention(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestUIRemotePreferencesPersistenceSummaryExplainsVaultBindingFlow(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
u := newUIWithSession("desktop", &session.Manager{})
|
||||||
|
|
||||||
|
if got := u.remotePreferencesPersistenceSummary(); got != "After a successful remote open, KeePassGO can keep a local cache vault and store the shared remote target plus this user's credential entry in the vault itself." {
|
||||||
|
t.Fatalf("remotePreferencesPersistenceSummary() = %q, want local-first vault-binding guidance", got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestUIRemotePreferencesHelpDialogToggle(t *testing.T) {
|
func TestUIRemotePreferencesHelpDialogToggle(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
@@ -5568,6 +5578,26 @@ func TestUIRemoteLifecycleMessageUsesLocalCacheLanguageForBoundRemote(t *testing
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestUISaveCurrentRemoteBindingHeadingExplainsVaultBinding(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
u := newUIWithSession("desktop", &session.Manager{})
|
||||||
|
|
||||||
|
if got := u.saveCurrentRemoteBindingHeading(); got != "Bind this local vault to the current remote target" {
|
||||||
|
t.Fatalf("saveCurrentRemoteBindingHeading() = %q, want vault binding guidance", got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestUISaveCurrentRemoteBindingButtonLabelUsesSyncLanguage(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
u := newUIWithSession("desktop", &session.Manager{})
|
||||||
|
|
||||||
|
if got := u.saveCurrentRemoteBindingButtonLabel(); got != "Save Remote In Vault" {
|
||||||
|
t.Fatalf("saveCurrentRemoteBindingButtonLabel() = %q, want sync-target language", got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestUIRemoteOpenButtonLabelUsesLocalCacheLanguageForBoundRemote(t *testing.T) {
|
func TestUIRemoteOpenButtonLabelUsesLocalCacheLanguageForBoundRemote(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user