Skip to content

fix(receive): keep 'Scan another' reachable on short screens - #8

Merged
BlackPool25 merged 1 commit into
mainfrom
fix/scan-another-visible
Aug 3, 2026
Merged

BlackPool25 merged 1 commit into
mainfrom
fix/scan-another-visible

Conversation

@BlackPool25

Copy link
Copy Markdown
Owner

What & Why

After a file was received, the "Scan another" button in the saved card was clipped below the fold on phone-sized screens: the card is a non-scrolling Center > ConstrainedBox > Card > Column that overflowed (RenderFlex overflow ~8px), pushing the trailing button off-screen. The only workaround was switching tabs away and back to the Receive tab.

The phase cards are now wrapped in a shrink-wrap SingleChildScrollView inside the Center:

  • On tall screens the viewport hugs the card and Center still centers it — identical rendering to before.
  • On short screens the card scrolls, so "Scan another" (and any other trailing action) is always reachable.

No change to the restart flow itself: _restart() already stops the camera, disposes the decoder, resets the buffer, and returns to the idle card while reusing the same CameraController (the correct camera_android pattern — the controller must not be disposed between scans).

How it was tested

  • New regression: saved card on a short screen: Scan another stays reachable by scrolling and starts a fresh session — completes a real transfer (Rust FFI) at 480x360 logical, asserts the button starts below the fold, scrolls it into view, taps it, returns to idle, and starts a fresh scan with no stale VERIFIED/result. Fails on the previous code with A RenderFlex overflowed by 8.0 pixels.

  • New: saved card on a tall screen: Scan another is visible without scrolling — the layout renders exactly like pre-fix.

  • cd flutter_app/rust && cargo build --lib && cd flutter_app && flutter analyze && flutter test — 111 tests pass.

  • flutter analyze + flutter test

  • Manually tested on: Flutter Android (short-screen overflow reproduced and fixed at 480x360; tall screen unchanged)

Checklist

  • No wire-format/codec change
  • CHANGELOG / docs updated if user-facing
  • If AI-assisted, I reviewed and understood every line

… reachable on short screens

The saved card (icon + title + body + SavedFilePreview + Open file + Scan
another) exceeds the body height on short phone screens, so the trailing
Scan another button overflowed below the fold and was unreachable. Wrap
the Center > ConstrainedBox card content in a shrink-wrapping
SingleChildScrollView: tall screens render pixel-identical (the viewport
hugs the card and Center still centers it), short screens scroll to
reveal the trailing action. Regression test drives the full receive flow
on a 480x360 surface where the card cannot fit, scrolls to Scan another,
restarts, and starts a fresh session; a tall-surface test pins the
unchanged happy-path layout.
@BlackPool25
BlackPool25 merged commit c7418f4 into main Aug 3, 2026
2 checks passed
@BlackPool25
BlackPool25 deleted the fix/scan-another-visible branch August 3, 2026 08:56
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