"""Review navigation that does not assume a post-approval status modal. `scenario_navigator.review_approve()` appends `USE_CASE_STATUS_DISMISS` on touch devices, expecting an `NbglReviewStatus` screen after the confirm. This app deliberately returns straight to its home screen instead: over BLE that screen's sync wait can fail to auto-dismiss and block the next APDU, and the wallet shows its own success UI once the broadcast completes. See `show_status_and_home_if_needed` in `src/main.rs`. So drive the navigation directly rather than changing the app to suit the framework's default. """ from ragger.navigator import NavInsID #: Text on the final review page. On touch devices this is NBGL's own hold #: button; on Nano it is the finish title passed to `NbglReview::titles`. TOUCH_FINISH = "^Hold to sign$" NANO_FINISH = r"^Sign (transaction|message)$" def approve_review(device, navigator, path, test_name, nano_text=NANO_FINISH): """Page through a review and approve it.""" if device.is_nano: navigate, validate, text = NavInsID.RIGHT_CLICK, [NavInsID.BOTH_CLICK], nano_text else: navigate, validate, text = (NavInsID.SWIPE_CENTER_TO_LEFT, [NavInsID.USE_CASE_REVIEW_CONFIRM], TOUCH_FINISH) navigator.navigate_until_text_and_compare( navigate_instruction=navigate, validation_instructions=validate, text=text, path=path, test_case_name=test_name, screen_change_after_last_instruction=True, )