-
Notifications
You must be signed in to change notification settings - Fork 178
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
[Enhancement] Add exit dialog when entering passphrase #563
Conversation
Fixes / required changes: * Issue SeedSigner#510 'Behavior of back button confusing when entering password' * Updated test suite accordingly
Checks passed 😀✅ |
Since a release is around the corner (currently targeting Monday July 8th for finalization of all prs), please consider joining the SeedSigner Community group on telegram and/or the SeedSigner New Devs group to argue for this pr. And thank you for contributing. |
src/seedsigner/views/seed_views.py
Outdated
|
||
selected_menu_num = self.run_screen( | ||
WarningScreen, | ||
title="Exit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: "Abandon Passphrase?" but only if it would fit.
else perhaps: title "Abandon Edting" with text = "Exiting will abandon the BIP-39 Passphrase"
It's just a suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jdlcdl.
I agree with this suggestion for both title and text, and leaving button texts as proposed.
Let's see if other contributors comment on this, if not then I'll push the changes you proposed (after checking that new title fits).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since still waiting for feedback from others, please feel free to adjust to the best pr that you can (text changes and button preferences as you like) w/ another commit and push.
I like the text just above, and the thought of a deliberate exit by "down" and "press" to avoid accidentally abandoning the long passphrase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the psychology of the user what happens we the don't know what is BIP-39? Do we really need to add BIP-39.
Are we building for ourself or for the next billion users? my two sats.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comment, @dulcedu. I believe the use of BIP numbers throughout the UX is something that should be considered globally. In this particular case, I think it's good practice to keep "BIP-39 Passphrase" to maintain consistency with the overall UX design.
I think this point could unleash a broader debate to balance between design accessibility to a wide audience and adhering to best practices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the thoughts on BIP-39, and its 100% fair perspective on it being a technical detail. There are unfortunately several kinds of passwords/phrases that can be implemented with wallets / private keys, so I think it makes sense to include it for clarity somewhere in the UI.
As of 59bcfda: ACK for the concept because what's the point of a bip39 passphrase if its not a strong one? and this is useful for that But I still think improvements might be made on the title/text, Thank you Alvroble! |
Thank you for the comments, @jdlcdl! I thought this would be a good first issue to learn about SeedSigner dev environment. I'd love to join the Telegram groups and get more involved around here. How can I join? |
Duh, I didn't even include the links. :p https://t.me/seedsigner_new_devs for new devs, most appropriate for dev discussions |
The new proposed screen is the following:
|
w/o altering my comments above, I repeat my ACK tested at 1670bf6 |
Love this, @alvroble. Solid enhancement that will help reduce mistakes. Looking at the other messaging screens, I’d recommend content like this to align with the rest of the UX, specifically the “Discard Seed” dialog: We use "discard" elsewhere, and "keep/discard passphrase" clarifies the specific actions and aligns with the rest of the content. Thanks for your contribution! |
Thanks @easyuxd for the comment. I agree to mantain the UX alignment. However, maybe a better text fo the "Continue editing" button would be "Edit passphrase" instead of "Keep passhprase", because when you push that button you are not specifically keeping the passphrase you were writing, you are just going back to continue editing it. What do you think? |
@alvroble |
@easyuxd |
Looking pretty good! Minor note on the warning text: "Discard passphrase and go back" has two small issues:
So... I'm not sure what text should go in the body. |
Thanks @kdmukai! I understand, it's kind of tricky because of the context and limited space. Maybe something like: "Your current passphrase entry will be erased. Proceed?" |
|
||
elif input == HardwareButtonsConstants.KEY_PRESS and self.top_nav.is_selected: | ||
# Back button clicked | ||
return self.top_nav.selected_button | ||
return self.passphrase, self.top_nav.selected_button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty uncomfortable with this change to return a tuple and especially the downstream changes it creates in the related flow-based tests.
We have type hints for what we expect View.run_screen
to return:
https://github.com/SeedSigner/seedsigner/blob/dev/src/seedsigner/views/view.py#L104
Since this is python, obviously we're not restricted to just those two types.
It's not terrible to break the existing convention in this way, but I still strongly dislike it. Though admittedly it's probably more on aesthetic / esoteric grounds; I doubt this would cause problems for us in the future. That being said, the flow-based tests are only possible because we held extreme discipline throughout the code in plenty of other areas.
(and we have a matching type hint for FlowStep
that's no longer completely accurate: https://github.com/SeedSigner/seedsigner/blob/dev/tests/base.py#L109)
But I can't think of an alternate solution, either. Well, not a good one, at least.
Very minor improvement: return a dict
instead of a tuple?
# in the Screen:
# Completed passphrase entry...
return dict(passphrase=self.passphrase)
# BACK button selected...
return dict(passphrase=self.passphrase, is_back_button=True)
And then the View would ask:
if "is_back_button" in ret_dict:
...
There's barely a difference using a dict vs tuples, but when in doubt I prefer the self-documenting nature of having dict keys.
Ultimately Screen
probably should have returned something like a Response
object that could handle a more complex use case like this. But that would be a huge refactor. But returning a dict
here feels like a half-step in that direction and so is another very small nod in favor of dict over tuple.
AT THE VERY LEAST this Screen should include a TODO
comment noting its unusual return value approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this language. I do think it's a good practice to repeat the action, at least in the H1 and the CTAs -- it should be clear to users what their action is without having to read the whole screen, with the body copy as added context. |
* Screen return values were updated to a more structured dict format * Test flows were updated accordingly * TODO comment was added suggesting a future refactor to return a Response object in order to support more complex use cases
Just merged and tested after resolving some conflicts with the current dev branch |
tACK closes #510 |
Enhancement made:
Description
When entering a long passphrase, one can push accidentally the back button, so an exit dialog is added to prevent the accidentally loss of all the work to type in a long passphrase.
A new Warning Screen view is added:
The actual dialog may be a bit too sober and could be modified to a more friendly "Are you sure you want to cancel?"
This pull request is categorized as a:
Checklist
pytest
and made sure all unit tests pass before sumbitting the PRIf you modified or added functionality/workflow, did you add new unit tests?
I have tested this PR on the following platforms/os:
Note: Keep your changes limited in scope; if you uncover other issues or improvements along the way, ideally submit those as a separate PR. The more complicated the PR the harder to review, test, and merge.