Skip to content

feat(data): point empty wallet at the scan-QR button - #680

Open
dobby-coder[bot] wants to merge 1 commit into
masterfrom
dobby/empty-wallet-scan-qr-649
Open

feat(data): point empty wallet at the scan-QR button#680
dobby-coder[bot] wants to merge 1 commit into
masterfrom
dobby/empty-wallet-scan-qr-649

Conversation

@dobby-coder

@dobby-coder dobby-coder Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What

Refocuses the empty wallet on scanning a Yivi QR code as the primary call to action, following the direction that supersedes the earlier attempts in #614 and #615 (both since closed).

  • Rewrites the empty-state copy data_tab.empty.title / data_tab.empty.subtitle (nl, en and de) to tell users to scan a Yivi QR code, with the "+" button mentioned as a secondary way to obtain data.
  • Moves the pointing graphic in _NoCredentialsYet from the "+" button onto the scan-QR button (IrmaQrScanButton). The "+" button stays in place, just no longer the thing the graphic points at.

How

The scan-QR button lives in HomeScreen (as the floating action button), while the graphic lives in the data tab's subtree. To let the graphic find the button's location, HomeScreen now owns the button's GlobalKey and passes it down into DataTab. HomeScreen becomes a StatefulWidget so the key is stable across rebuilds; it stays scoped to the State rather than a top-level global, because a truly global key would clash while GoRouter keeps two HomeScreen instances alive during a transition (the same reason the old code passed the "+" key down the tree).

The pointing widget's rotation math is unchanged: it already aims at whatever render box it is handed, so retargeting the key is enough.

Testing

  • flutter analyze clean on the changed files (one pre-existing onReorder deprecation is untouched).
  • flutter test in yivi_core passes (168 tests), including locale_completeness_test which checks the three locale files stay in sync.
  • The on-device integration test empty-app-shows-image still asserts the graphic is present; its key was renamed from to_add_data_button_pointing_image to to_scan_button_pointing_image to match.

Note for review

The graphic now points down at the scan button at the bottom of the screen rather than up at the "+" in the app bar. The layout of the empty state is unchanged, so let me know if you'd like the graphic repositioned within the column for a shorter, clearer point.

Closes #649

Refocus the empty wallet on scanning a Yivi QR code as the primary call
to action. The empty-state copy (data_tab.empty.title/subtitle, nl/en/de)
now tells users to scan a Yivi QR code, and the pointing graphic in
_NoCredentialsYet points at the scan-QR button instead of the "+" button.
The "+" button stays available as a secondary way to obtain data.

The scan-QR button lives in HomeScreen, so its key is created there and
passed down into the data tab; HomeScreen becomes stateful to hold a
page-scoped key (a truly global key would clash while GoRouter keeps
multiple HomeScreen instances alive during transitions).

Closes #649

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dobby-coder
dobby-coder Bot requested a review from w-ensink July 25, 2026 01:29
@github-actions

Copy link
Copy Markdown

🎬 Recorded 1 changed integration test(s) on iOS simulator (iPhone 16 Pro or nearest available):

  • yivi_app/integration_test/data_search_test.dart

Download the videos from the Artifacts section of the run: https://github.com/privacybydesign/irmamobile/actions/runs/30138570318

@dobby-coder dobby-coder Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: approve

Rules Dobby 2 — sign-off (cycle 1)

Rule sweep + review pass complete on this self-authored PR. No blocking issues.

Correctness (verified against the diff):

  • GlobalKey rework is sound: _scanButtonKey is owned by _HomeScreenState, wrapped around the scan FAB via KeyedSubtree, and threaded down DataTab → _AllCredentialsList → _NoCredentialsYet → _ToScanButtonPointingImage. Scoping it to the State (not a top-level global) is the right call given GoRouter keeps two HomeScreen instances alive across transitions.
  • The StatelessWidget → StatefulWidget conversion drops no needed const constructor; the rotation math is untouched and null-guards the render boxes.
  • Integration-test key rename (to_add_data_button_pointing_imageto_scan_button_pointing_image) matches the widget's Transform key. Consistent.

i18n: title/subtitle changed symmetrically in nl, en and de; copy is plain and instructional in all three.

Closing ref: closingIssuesReferences correctly resolves to issue #649 (the intended issue) — auto-close on merge is wired.

No conventional-commit workflow in this repo, and the title is conventional anyway.

One non-blocking nit inline (already flagged by the author) — not merge-blocking.

children: [
SizedBox(height: theme.defaultSpacing),
_ToAddDataButtonPointingImage(addDataButtonKey: addDataButtonKey),
_ToScanButtonPointingImage(scanButtonKey: scanButtonKey),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (nit): in portrait the pointing graphic sits at the top of the column while the scan FAB is center-docked at the bottom, so the arrow points across the whole screen (through the title/subtitle) rather than at a nearby target — a weaker affordance than the old short up-point to the app-bar "+". You already flagged this in the "Note for review"; repositioning the graphic lower in the column would give a shorter, clearer point. Not blocking sign-off.

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.

Refocus the empty wallet on scanning a Yivi QR code instead of the "+" button

0 participants