Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log-in button to preferences screen #2994

Merged

Conversation

lucasscharenbroch
Copy link
Contributor

This changes the AnkiWeb Account box on the preferences screen when the user is not logged in.

Before:
before
After:
after

Resolves #2990

@dae
Copy link
Member

dae commented Feb 8, 2024

Hi Lucas,

The change itself looks well written. A couple of comments on adding a log-in button to that screen:

  • There's text immediately above it that suggests the user sync from the main screen. We might want to show one or the other but not both.
    2024-02-08T16:10:58,507598677+10:00
  • I was a bit apprehensive when I noticed you added a login button, as I've always found AnkiDroid's logging-in-doesn't-initiate-a-sync to be confusing. But I've gone back and checked, and I think the main issue there is the login screen is shown when the user taps on the sync button, so my expectation is that a sync will happen. If the user logs in from the preferences screen, I guess that's not going to be as much of a problem. But it may still be worth displaying a dialog box after a successful login, to remind the user they'll need to close Anki or click on the sync button to sync for the first time. What do you think?

@david-allison @mikehardy I probably should have mentioned this in the past

</sizepolicy>
</property>
<property name="text">
<string notr="true">LOGIN</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of setting the translation in the Python code, you can name it here instead, eg sync_log_in_button.

@lucasscharenbroch
Copy link
Contributor Author

AFAIK, the sole reason for logging in is sync, but it still might desirable to have the ability to log in without immediately initiating a sync (for the same reason it's useful to be able to opt out of automatic sync on profile open/close).

An explicit "log in" button also might be more intuitive for new users, as it might not be immediately obvious that logging in is directly associated with sync.

Perhaps, upon successful login (from the prefs screen), there could be a "sync now?" dialog.

@david-allison
Copy link
Contributor

I was a bit apprehensive when I noticed you added a login button, as I've always found AnkiDroid's logging-in-doesn't-initiate-a-sync to be confusing. But I've gone back and checked, and I think the main issue there is the login screen is shown when the user taps on the sync button, so my expectation is that a sync will happen. If the user logs in from the preferences screen, I guess that's not going to be as much of a problem. But it may still be worth displaying a dialog box after a successful login, to remind the user they'll need to close Anki or click on the sync button to sync for the first time. What do you think?

As of 2.17, logging in via the onboarding process initiates a (download) sync.

I'd support the above as a UX enhancement

@dae
Copy link
Member

dae commented Feb 11, 2024

Your code looks good, but I'm afraid I'm not so fond of syncing being started while the preferences screen is open, as changes from other devices will be lost if the user saves their preferences after syncing. Could we either change the message to "Save changes and sync now?" + automatically save+close the dialog first, or change it from a prompt to a suggestion to the user to sync after saving?

@dae
Copy link
Member

dae commented Feb 12, 2024

Thanks for your work on this Lucas, I think it's a nice addition.

@dae dae merged commit c6a63cf into ankitects:main Feb 12, 2024
1 check passed
@lucasscharenbroch lucasscharenbroch deleted the add-log-in-button-to-prefs-screen branch February 12, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tip to prefs screen when syncing not set up
3 participants