Skip to content

Improve Back Navigation Logic in ScanView #775

Open
@Advaitgaur004

Description

@Advaitgaur004

There seems to be a structural issue with how back navigation is handled in the ScanSeedQRView, similarly this also includes(ScanPSBTView, ScanWalletDescriptorView, or ScanAddressView.) which inherits from ScanView.

In the run() method of ScanView, the BACK_BUTTON(Please Note its not RET_CODE__BACK_BUTTON) case isn’t explicitly handled. Here BACK_BUTTON means --> If someone click left or right it break from the continues loop and camera stop video stream mode that make total sense to me because of this,

if self.hw_inputs.check_for_low(HardwareButtonsConstants.KEY_RIGHT) or self.hw_inputs.check_for_low(HardwareButtonsConstants.KEY_LEFT):
       self.camera.stop_video_stream_mode()
        break

Now problem is BackStackView isnt perfectly handle as flow most likely goes to ScanView. As a result, if none of the branches match, it defaults to returning to MainMenuView, regardless of the user’s previous context.

Example of Confusing UX Flow:

  • Tools -> Address Explorer -> Scan a Seed -> Back -> lands on Main Menu [It should land on Address Explore Menu]
  • Tools -> Verify Address -> Back -> Main Menu, ahhh [It should land to Tool Menu]
  • Seeds -> Scan a SeedQR -> Back -> Main Menu again [It should land to Seeds Menu]

This creates and unexpected navigation flow, which can confuse users who expect to go back to the previous tool or menu.


If back_destination is used as a parameter in ScanView and passed as args when calling any View in scan_view, it can lead to issues when users attempt to go further back, resulting in a navigation loop. This happens because the BackStackView may remain linked to the previous scan-related view—such as ScanSeedQRView, ScanPSBTView, ScanWalletDescriptorView, or ScanAddressView.

if selected_menu_num == RET_CODE__BACK_BUTTON:
       return Destination(BackStackView)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions