trezor-firmware icon indicating copy to clipboard operation
trezor-firmware copied to clipboard

Model-specific homescreen layouts

Open matejcik opened this issue 3 years ago • 0 comments

Currently the homescreen layout is custom written in apps.homescreen. This is becoming more complex as we are adding more different models.

A proposed split would look vaguely like:

  • move HomescreenBase to ui.components.common
  • move Homescreen, Lockscreen, RecoveryHomescreen to ui.components.tt, quite possibly to a common file homescreen.py
  • move ui.header_warning and ui.header_error to ui.components.tt.homescreen (they are not used anywhere else)
  • extract appropriate parameters
    • for Homescreen, the list of possible headers should come in as (for now) error_header: str | None, warning_header: str | None. In the future we can pass in something like list[tuple[Level, str]] and the homescreen would decide whether to render everything or only the first/last one.
  • provide trezor.ui.layout.show_homescreen(...) and friends

matejcik avatar May 19 '22 10:05 matejcik