Skip to content

Fix "Test again" leaving the result screen on top - #59

Open
StarMusa88 wants to merge 1 commit into
librespeed:masterfrom
StarMusa88:fix/test-again-navigation
Open

StarMusa88 wants to merge 1 commit into
librespeed:masterfrom
StarMusa88:fix/test-again-navigation

Conversation

@StarMusa88

Copy link
Copy Markdown

Problem

Tapping Test again reused the tab-switch navigation helper, which does popUpTo(start) { saveState = true } + restoreState = true. That saved the result screen and immediately restored it on top of the speedtest screen, so the restarted test ran hidden behind the result and only appeared after pressing Back.

Fix

Pop the result off the back stack instead, then start the test:

onTestAgain = { serverName ->
    //pop the result off the stack instead of using the tab helper:
    //its saveState/restoreState would put this result screen back on
    //top of the speedtest screen, hiding the test it just started
    navController.popBackStack(Destination.SPEEDTEST.route, inclusive = false)
    speedtestViewModel.testAgain(serverName)
}

Testing

  • Verified on device: tapping Test again now shows the speedtest screen running immediately (no Back press needed), and the fresh result appears when it finishes.
  • ./gradlew :app:lintDebug :app:testDebugUnitTest -Proborazzi.test.verify=true passes.

This change was developed with the help of OpenCode.

"Test again" used the tab-switch helper, whose popUpTo(saveState) +
restoreState immediately restored the result screen on top of the
speedtest screen, so the test ran hidden behind the result and only
appeared after pressing Back. Pop the result off the stack instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant