Remove FTUX, add simple welcome screen

(cherry picked from commit d1c5b907c0)
This commit is contained in:
Peter D. Gray 2023-12-18 16:34:59 +01:00 committed by doc-hex
parent c8d1dc92ac
commit bb98e94183
3 changed files with 22 additions and 52 deletions

View File

@ -17,12 +17,13 @@
- Enhancement: Allow passphrase via USB if passphrase already set - operates on master seed.
- Enhancement: Improve BIP39 Passphrase UX when temporary seed is active and applicable.
- Enhancement: Continuation of removal of obsolete Mk2/Mk3 code-paths from master branch.
- Bugfix: Confusing first-time UX replaced with simple welcome screen.
- Bugfix: One instant retry on SE1 commumication failures
- Bugfix: Handle any failures in slot reading when loading settings
- Bugfix: Add missing "First Time UX" for extended key import as master seed
- Bugfix: Hide `Upgrade Firmware` menu item if temporary seed is active (it cannot work)
- Bugfix: Disallow using master seed as temporary seed
- Bugfix: Do not allow `APPLY` of empty BIP-39 passphrase
- Bugfix: Do not allow `APPLY` of empty BIP-39 passphrase. Use "Restore Master" instead.
- Bugfix: Fix yikes in `Clone Coldcard` (thanks to AnchorWatch)
## 5.2.0 - 2023-10-10

View File

@ -2,55 +2,32 @@
#
# ftux.py - First Time User Experience! A new ride at the waterpark.
#
import version
import version, ckcc
from glob import settings
from ux import ux_show_story, the_ux, ux_dramatic_pause
from actions import change_nfc_enable, change_virtdisk_enable, change_usb_disable
COMMON = '''\
\n
You can change this later under Settings > Hardware On/Off.'''
from ux import ux_show_story, the_ux
from actions import change_usb_disable
class FirstTimeUX:
async def interact(self):
# Help them enable the good stuff.
# - they might have already enabled things
# - some features not on mk3
if version.has_nfc and not settings.get('nfc', 0):
msg = '''Enable NFC/Tap?\n\n\
Lets you Tap your mobile phone on the COLDCARD and \
transfer data easily via NFC.''' + COMMON
ch = await ux_show_story(msg)
if ch == 'y':
settings.set('nfc', 1)
await change_nfc_enable(1)
await ux_dramatic_pause('Enabled.', 1)
# Disabled for now, because limited audience and
# extra barrier to "just getting started"
if 0: # if not settings.get('vidsk', 0):
msg = '''Enable USB Drive?\n\n\
Connect your COLDCARD directly as a USB flash drive \
to your phone or desktop. You will be able to drag-n-drop or \
save PSBT files like other drives/volumes.''' + COMMON
ch = await ux_show_story(msg)
if ch == 'y':
# put them into full-auto mode: 2
settings.set('vidsk', 2)
await change_virtdisk_enable(2)
await ux_dramatic_pause('Enabled.', 1)
if not settings.get('vidsk', 0) and not settings.get('du', 0):
msg = '''Disable USB port?\n\n\
If you intend to operate in Air-Gap mode, where this COLDCARD \
is never connected to anything but power, then this will disable the USB port.''' + COMMON
ch = await ux_show_story(msg)
await ux_show_story('''
Your COLDCARD has been configured for \
best security practises:
if ch == 'y':
settings.set('du', 1)
await change_usb_disable(1)
await ux_dramatic_pause('Disabled.', 1)
- USB disabled
- NFC disabled
- VDisk disabled
You can change these under Settings > Hardware On/Off.''', title="Welcome!")
if not ckcc.is_simulator():
settings.set('du', 1) # disable USB
await change_usb_disable(1)
#settings.set('nfc', 0) # default already
#settings.set('vidsk', 0) # same as default
# done
the_ux.pop()

View File

@ -344,7 +344,7 @@ def cap_menu(sim_exec):
@pytest.fixture(scope='module')
def is_ftux_screen(sim_exec):
"are we presenting a view from ftux.py"
"are we presenting a view from ftux.py??"
def doit():
rv = sim_exec('from ux import the_ux; RV.write(repr('
'type(the_ux.top_of_stack())))')
@ -361,15 +361,7 @@ def expect_ftux(cap_menu, cap_story, need_keypress, is_ftux_screen):
_, story = cap_story()
if not story:
break
# XXX test more here
if 'Enable NFC' in story:
need_keypress('x')
elif 'Enable USB' in story:
need_keypress('y')
elif 'Disable USB' in story:
need_keypress('x')
else:
raise ValueError(story)
need_keypress('y')
m = cap_menu()
assert m[0] == 'Ready To Sign'