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

Delizia tap-to-swipe hotfix #4571

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Conversation

matejcik
Copy link
Contributor

@matejcik matejcik commented Feb 3, 2025

This implements tap-to-swipe functionality on Delizia, to avoid problematic swipes.

points of interest:

  • df6f791 should probably be a separate PR fixing rust-analyzer, but it's here for now πŸ€·β€β™€οΈ
  • a929f51 is a generic pager impl that we can (and ideally should) use everywhere
  • e234e25 introduces PaginateFull trait that is using Pager instead of just returning a total. this is used throughout Delizia, for now the original Paginate is kept for backwards compatibility.

the big changes in above are refactors of Paragraphs and FormattedText pagination, where we don't have to go from the beginning every time, because we now remember on which page we are (until then we only knew on which offset in source data we are)

8dc1e12 is the big hotfix -- introduce a virtual button in Footer and respond to clicks to that button by (a) replaying an artificial swipe to an internally swipable component, or (b) returning FlowMsg::Next up the stack, for SwipeFlow to pick up, which should respond by

  • checking that no action has happened in response to Next
  • checking that an action is registered for swipe-up
  • if yes, triggering that action
    this way all the flows written to work with swipe-up will magically also work with footer-click

the rest are some patches for some problems.

another important refactor in cf490d0 is that Frame now has its own map() function that maps only the content message to something. Messages from button(s), either header or footer, are always mapped to themselves.

@matejcik matejcik force-pushed the matejcik/hotfix-haha-delizia-swipe branch 3 times, most recently from e0c31d3 to e581a3d Compare February 4, 2025 12:40
Copy link

github-actions bot commented Feb 4, 2025

core UI changes device test click test persistence test
T2T1 Model T test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
T3B1 Safe 3 test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
T3T1 Safe 5 test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
All main(screens)

@matejcik matejcik force-pushed the matejcik/hotfix-haha-delizia-swipe branch 3 times, most recently from 39f7ee6 to e12346a Compare February 5, 2025 12:49
@matejcik matejcik marked this pull request as ready for review February 5, 2025 13:45
@matejcik matejcik requested a review from prusnak as a code owner February 5, 2025 13:45
@matejcik matejcik requested review from obrusvit and removed request for prusnak February 5, 2025 13:45
@matejcik matejcik self-assigned this Feb 5, 2025
@matejcik
Copy link
Contributor Author

matejcik commented Feb 5, 2025

Monero failure is spurious. Perhaps #3463 will help with those.

@Hannsek
Copy link
Contributor

Hannsek commented Feb 11, 2025

TODO:

  • extend the hold/tap to confirm zone as much as possible - not directly related to this PR but would be nice to tackle it here as it would help with the UX
  • extend the tap zone on all screens to the bottom half (bottom two thirds) of the diplay, including the footer
  • replace "swipe up" with "tap to continue"
  • edit tutorial according to Figma

translations:

DE: Zum Fortfahren tippen
FR: Toucher pour continuer
ES: Toca para continuar
PT-BR: Toque para continuar
IT: Tocca per continuare
CS: Klepnutím pokračujte

Copy link
Contributor

@obrusvit obrusvit left a comment

Choose a reason for hiding this comment

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

A few comments for now, I'd like to review and test more later on.

@obrusvit
Copy link
Contributor

I think we can proceed with the points from @Hannsek

  • regarding the touch zone of the footer, it is now at double the size of the footer (74 px), roughly 1/3 of the screen and IMHO it's not bad.

@Hannsek
Copy link
Contributor

Hannsek commented Feb 20, 2025

regarding the touch zone of the footer, it is now at double the size of the footer (74 px), roughly 1/3 of the screen and IMHO it's not bad.

Can we do even more?

@obrusvit obrusvit added the T3T1 Trezor Safe 5 label Feb 20, 2025
@matejcik
Copy link
Contributor Author

replace "swipe up" with "tap to continue"

what do we think about replacing the same string id?
it would mean that the instruction is wrong when you have an outdated translation blob

@obrusvit
Copy link
Contributor

obrusvit commented Feb 20, 2025

what do we think about replacing the same string id?
it would mean that the instruction is wrong when you have an outdated translation blob

Having "Tap to confirm" under instruction__swipe_up sounds like something which might bite in the future. Even if it is only for Delizia.
And on the contrary, if we introduce a new ID, then you'd see english version of the new instruction if you have old blob... But the old instruction wouldn't matter because it's still valid: users can still swipe.

I'm in favor of introducing the new one.

@matejcik
Copy link
Contributor Author

FR: Toucher pour continuer

we translate "Tap to confirm" as "Appuyez pour confirmer", we should probably use the same word here?

IT: Tocca per continuare

"Tocca e continua", same as "hold to continue" is "Premi e continua" ?

  • edit tutorial according to Figma

so we're getting rid of "tap to start"?

also we need translations for the new text:

Tap the lower half of the screen to continue, or swipe down to go back.

@matejcik
Copy link
Contributor Author

Having "Tap to confirm" under instruction__swipe_up sounds like something which might bite in the future. Even if it is only for Delizia.

i mean, we can fully rename the key πŸ€·β€β™€οΈ
but we probably can afford one more empty key

PaginateFull uses Pager instead of reporting just the total number of
pages. Delizia will rely on this trait; going forward, we'll want
PaginateFull to replace Paginate, but this refactor would be too big if
we also needed to include Caesar and Bolt in it
We introduce a new variant FlowMsg::Next, used only internally (for
now). Sending FlowMsg::Next indicates we want to proceed to the next
screen of the flow.

If there is internal pagination, Next will play a simulated swipe to the
child component.
this generally simplifies the mappings of Frame messages, but also
relies on the button actions being properly set up.
@matejcik matejcik force-pushed the matejcik/hotfix-haha-delizia-swipe branch from e12346a to 88daace Compare February 21, 2025 14:35
@matejcik
Copy link
Contributor Author

  • extend the hold/tap to confirm zone as much as possible - not directly related to this PR but would be nice to tackle it here as it would help with the UX
  • extend the tap zone on all screens to the bottom half (bottom two thirds) of the diplay, including the footer

these two are the same thing. i tried to extend over the whole screen except header, please test

  • replace "swipe up" with "tap to continue"

done

  • edit tutorial according to Figma

done

@obrusvit
Copy link
Contributor

I'll do final pass including the tutorial later on.

@Hannsek
Copy link
Contributor

Hannsek commented Feb 21, 2025

these two are the same thing. i tried to extend over the whole screen except header, please test

Does swipe down to go back work?

@Hannsek
Copy link
Contributor

Hannsek commented Feb 21, 2025

extend the hold/tap to confirm zone as much as possible - not directly related to this PR but would be nice to tackle it here as it would help with the UX
extend the tap zone on all screens to the bottom half (bottom two thirds) of the diplay, including the footer
these two are the same thing

They are not. The first one is about the confirmation screen where the middle confirmation button is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T3T1 Trezor Safe 5
Projects
Status: πŸ”Ž Needs review
Development

Successfully merging this pull request may close these issues.

3 participants