fix(backup): stop import spinner on arch rejection + reading-time Snackbar duration#40
Merged
Merged
Conversation
On WRONG_ARCH/CORRUPT/not-rootfs the import is rejected, but stopImportSpinner() was missing in that branch (it's present in the success and catch paths), so the braille spinner kept running and overwrote the button text every 90ms — the button looked stuck spinning forever. Stop the spinner so the rejection ends cleanly.
…ime) Snackbar only offers SHORT/LONG; the arch-mismatch rejection text is too long to read in LONG (~2.75s). Add SnackbarDuration (pure, unit-tested): ~200 wpm reading speed + base, clamped to [3s, 10s]. Route the import Snackbars (rejection, manifest/ checksum warnings, success, failure) through a showImportSnackbar() helper that sets the computed duration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small UX fixes in the backup import flow.
1. Spinner stuck on rejection. When an imported rootfs is rejected (wrong arch / corrupt / not-a-rootfs),
stopImportSpinner()was missing in that branch (it's present in the success and catch paths), so the braille spinner kept overwriting the button text every 90ms — the button looked stuck spinning forever. Now the spinner stops and the rejection ends cleanly.2. Snackbar too short for long messages. Snackbar only offers SHORT/LONG (~2.75s); the arch-mismatch message is too long to read in time. Added
util/SnackbarDuration(pure, unit-tested): ~200 wpm reading speed (320ms/word) + 1.5s base, clamped to [3s, 10s]. AshowImportSnackbar()helper routes the import messages (rejection, manifest/checksum warnings, success, failure) through the computed duration. Example: the arch-mismatch text goes from 2.75s to ~6s; short ones stay at the 3s floor.Verified locally: brace balance,
SnackbarDurationTestpasses (pure JVM).