Open r10s opened 3 months ago
We use the TableView-based SelfProfileViewController
on an navigation stack, so I see two reasonable ways to achieve this:
navigationItem.backBarButtonItem
and enable/disable based on the contentof nameCell
. (Note to self: Check for Retain Cycles here due to onTextFieldChange
) This way, the user wouldn't be able to cancel their name-change, but we'd be sure that they must set the nameCancel
-button on the left and a Save
-button on the right and only persist name etc. when users press Save
. This way, existing users without a name would still be able to use their blank name (which would interfere with this issue, I guess?). This is also the default when I want to override other peoples usernames. It has two buttons (Save/Cancel)So I'd opt in for the first way. WDYT?
hm, are disabled "back" buttons a thing in ios? i cannot remember to have seen that somewhere.
so, indeed a bit tricky for a minor thing. a 3rd option is to leave things as is :) let's sleep it over :)
signal/whatsapp/telegram all go for cancel/done, partly delayed until things are really changed (eg. whatsapp shows a back button that changes to cancel/done on changes, not allowing empty profile name as well)
otoh, i am a cancel/done would make avatar selection harder - code wise, but also UI wise as that suddenly needs to be cancelable as well - and user need to remember to hit "done" another time.
might be okay, however, wondering if that all is worth the minor issue we try to fix here.
what about the following:
set the "placeholder" to the original name - and if the user "clears" the name, they'll notice that this is not possible as the original name is shown. when still hitting "okay", do not change the name if new name is empty. this will also result in a smart migration
during onboarding, we enforce a profile name to be set.
for consistency, and as same reasons apply, we should not allow to clear the name later on editing.
there are old profiles where we did not have enforced a name on creation. we would enforce them now during editing, if eg. the user only wants to edit the "bio". however, that seems to be a minor, and also android does it that way since some time, without much complains or issues.
cmp https://github.com/deltachat/deltachat-android/issues/3160, https://github.com/deltachat/deltachat-desktop/issues/4042