Local-first remote sync and cross-platform UI parity #2
@@ -282,6 +282,7 @@ type ui struct {
|
||||
detailList widget.List
|
||||
apiPolicyList widget.List
|
||||
lifecycleList widget.List
|
||||
syncDialogList widget.List
|
||||
phonePanelList widget.List
|
||||
securityDialogList widget.List
|
||||
remotePrefsDialogList widget.List
|
||||
@@ -629,6 +630,9 @@ func newUIWithState(mode string, sess appstate.CurrentSession, paths statePaths)
|
||||
lifecycleList: widget.List{
|
||||
List: layout.List{Axis: layout.Vertical},
|
||||
},
|
||||
syncDialogList: widget.List{
|
||||
List: layout.List{Axis: layout.Vertical},
|
||||
},
|
||||
phonePanelList: widget.List{
|
||||
List: layout.List{Axis: layout.Vertical},
|
||||
},
|
||||
@@ -1422,6 +1426,7 @@ func (u *ui) openAdvancedSyncDialog() {
|
||||
u.syncDialogOpen = true
|
||||
u.syncMenuOpen = false
|
||||
u.showSyncPassword = false
|
||||
u.syncDialogList.Position = layout.Position{}
|
||||
u.syncDialogPurpose = syncDialogPurposeAdvanced
|
||||
u.syncSourceMode = u.syncDefaultSourceMode
|
||||
u.syncDirection = u.syncDefaultDirection
|
||||
@@ -1436,6 +1441,7 @@ func (u *ui) openRemoteSyncSetupDialog() {
|
||||
u.syncDialogOpen = true
|
||||
u.syncMenuOpen = false
|
||||
u.showSyncPassword = false
|
||||
u.syncDialogList.Position = layout.Position{}
|
||||
u.syncDialogPurpose = syncDialogPurposeRemoteSetup
|
||||
u.syncSourceMode = syncSourceRemote
|
||||
u.syncDirection = syncDirectionPush
|
||||
@@ -5181,7 +5187,7 @@ func (u *ui) syncDialogContent(gtx layout.Context) layout.Dimensions {
|
||||
if len(u.syncRemoteCredentialClicks) < len(matchingCredentials) {
|
||||
u.syncRemoteCredentialClicks = make([]widget.Clickable, len(matchingCredentials))
|
||||
}
|
||||
return material.List(u.theme, &u.lifecycleList).Layout(gtx, 1, func(gtx layout.Context, _ int) layout.Dimensions {
|
||||
return material.List(u.theme, &u.syncDialogList).Layout(gtx, 1, func(gtx layout.Context, _ int) layout.Dimensions {
|
||||
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
|
||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||
lbl := material.Label(u.theme, unit.Sp(20), u.syncDialogTitle())
|
||||
|
||||
@@ -6781,6 +6781,19 @@ func TestUIRemoteSyncSetupMatchingCredentialsUsesMatchingHost(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUIOpenRemoteSyncSetupDialogResetsDialogScrollPosition(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
u := newUIWithModel("desktop", vault.Model{})
|
||||
u.syncDialogList.Position = layout.Position{First: 2, Offset: 48, BeforeEnd: true}
|
||||
|
||||
u.openRemoteSyncSetupDialog()
|
||||
|
||||
if got := u.syncDialogList.Position; got != (layout.Position{}) {
|
||||
t.Fatalf("syncDialogList.Position = %#v, want zero position after opening setup dialog", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUIAdvancedSyncMatchingRemoteCredentialEntriesUsesSavedBindingForCurrentVault(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user