From 070dac466d3c7676bdb7409484f9a88ffcbf8d47 Mon Sep 17 00:00:00 2001 From: Rob Date: Thu, 2 May 2024 07:39:42 +0000 Subject: [PATCH] Demo fixes * PR Feedback - Fix incorrect english translation - Fix irrelevant comment - Fix bsn tests * Fix cards not showing up after setup There is a situation in which the freshly added cards don't show up on the success page after the initial setup, this happens (on non-mock builds) when you: 1. Start clean 2. Setup Wallet 3. Kill app 4. Continue Setup 5. Cards don't show up on success page The 'fix' here simply reverts the code to what it was previously, this code was changed because the cards are now persisted which should fix the underlying issue. But apparently it needs some more investigation, as it only fixes the issue in the flow where the app is not killed during the initial setup. * Fix dutch BSN voiceover The commas were pronounced by talkback, so using space separator instead. * Update translations --- wallet_app/lib/l10n/intl_en.arb | 6 +++--- wallet_app/lib/l10n/intl_nl.arb | 6 +++--- wallet_app/lib/src/util/helper/semantics_helper.dart | 4 ++-- .../lib/src/wallet_core/typed/typed_wallet_core.dart | 11 ++++++----- .../test/src/util/helper/semantics_helper_test.dart | 10 +++++----- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/wallet_app/lib/l10n/intl_en.arb b/wallet_app/lib/l10n/intl_en.arb index 32ea50135..cb2fe805c 100644 --- a/wallet_app/lib/l10n/intl_en.arb +++ b/wallet_app/lib/l10n/intl_en.arb @@ -1,6 +1,6 @@ { "@@locale": "en", - "@@last_modified": "2024-04-25T11:06:00+02:00", + "@@last_modified": "2024-04-30T09:41:14+02:00", "aboutScreenDescription": "This demo is realized by a collaboration of multiple organizations and was commissioned by the dutch government. For more information please refer to the website {url}.", "aboutScreenDescriptionLink": "edi.pleio.nl", "@aboutScreenDescriptionLink": { @@ -953,7 +953,7 @@ "organizationDetailScreenTitle": "About {name}", "organizationDetailScreenViewTerms": "View the general", "organizationDetailScreenWebsiteInfo": "Website", - "pageIndicatorSemanticsLabel": "Step {current} of {total}", + "pageIndicatorSemanticsLabel": "Step {current} out of {total}", "pidAddressCardTitle": "Residential address", "pidIdCardTitle": "Personal data", "pinBlockedScreenDescription": "You have entered your PIN code incorrectly too many times.\n\nDo you want to use the Wallet again? Then you have to start again. Clear the Wallet and choose a new PIN code.", @@ -972,7 +972,7 @@ } } }, - "pinErrorDialogForgotCodeCta": "FOTGOT PIN CODE?", + "pinErrorDialogForgotCodeCta": "FORGOT PIN CODE?", "pinErrorDialogNonFinalRoundFinalAttempt": "You can try 1 more time. If the following PIN code is invalid, the app will be temporary blocked.", "pinErrorDialogNonFinalRoundInitialAttempt": "PIN code incorrect, try again.", "pinErrorDialogNonFinalRoundNonFinalAttempt": "You can try {count} more times.", diff --git a/wallet_app/lib/l10n/intl_nl.arb b/wallet_app/lib/l10n/intl_nl.arb index b7cb1ac77..c42cf0a19 100644 --- a/wallet_app/lib/l10n/intl_nl.arb +++ b/wallet_app/lib/l10n/intl_nl.arb @@ -1,6 +1,6 @@ { "@@locale": "nl", - "@@last_modified": "2024-04-25T11:06:00+02:00", + "@@last_modified": "2024-04-30T09:41:14+02:00", "aboutScreenDescription": "Deze demo app is tot stand gekomen door een samenwerking van verschillende organisaties in opdracht van de Nederlandse Overheid. Voor meer informatie over deze app verwijzen we naar de website {url}.", "aboutScreenPrivacyCta": "Privacybeleid", "aboutScreenTermsCta": "Gebruiksvoorwaarden", @@ -565,7 +565,7 @@ "generalWCAGOpenLink": "Open link", "generalWCAGQr": "Scan QR code", "generalWCAGSeeAllActivities": "Bekijk alle activiteiten", - "generalWCAGStepper": "Stap {current} of {total}.", + "generalWCAGStepper": "Stap {current} van {total}.", "helpSheetCloseCta": "Sluiten", "helpSheetDescription": "Neem contact op met de helpdesk. De volgende gegevens kunnen nodig zijn.", "helpSheetErrorCode": "Foutcode: {code}", @@ -997,7 +997,7 @@ }, "pinKeyboardWCAGBackspaceLabel": "Verwijder", "pinKeyboardWCAGBackspaceLongPressHint": "Alles te verwijderen", - "pinKeyboardWCAGDigitKeyTapHint": "invoer", + "pinKeyboardWCAGDigitKeyTapHint": "kiezen", "pinScreenAboutAppTooltip": "Over de app", "pinScreenAttemptsCount": "{count, plural, one {Je hebt nog {count} poging} other {Je hebt nog {count} pogingen}}", "@pinScreenAttemptsCount": { diff --git a/wallet_app/lib/src/util/helper/semantics_helper.dart b/wallet_app/lib/src/util/helper/semantics_helper.dart index 01ba7a7f9..7b4dec9f7 100644 --- a/wallet_app/lib/src/util/helper/semantics_helper.dart +++ b/wallet_app/lib/src/util/helper/semantics_helper.dart @@ -2,13 +2,13 @@ class SemanticsHelper { SemanticsHelper._(); /// If the input solely consists of positive digits, this method - /// will return a comma separated list of those digits. Useful to + /// will return a space separated list of those digits. Useful to /// make a screen-reader read out the digits separately. /// Otherwise it returns the original input. static String splitNumberString(String input) { if (input.trim().length != input.length) return input; final isPositiveInt = int.tryParse(input)?.isNegative == false; - if (isPositiveInt) return input.split('').join(','); + if (isPositiveInt) return input.split('').join(' '); return input; } } diff --git a/wallet_app/lib/src/wallet_core/typed/typed_wallet_core.dart b/wallet_app/lib/src/wallet_core/typed/typed_wallet_core.dart index 4d8dc37aa..cd01fa694 100644 --- a/wallet_app/lib/src/wallet_core/typed/typed_wallet_core.dart +++ b/wallet_app/lib/src/wallet_core/typed/typed_wallet_core.dart @@ -68,11 +68,12 @@ class TypedWalletCore { } void _setupCardsStream() async { - _cards.onListen = () async { - await _isInitialized.future; - _walletCore.setCardsStream().listen((event) => _cards.add(event)); - }; - _cards.onCancel = () => _walletCore.clearCardsStream(); + //FIXME: Ideally we don't set the card stream until we start observing it (i.e. in onListen()) + //FIXME: but since the cards are not persisted yet that means we might miss events, so observing + //FIXME: the wallet_core cards stream through the complete lifecycle of the app for now. + //To reproduce issue: 1. Start clean, 2. Setup Wallet, 3. Kill app, 4. Continue Setup, 5. Cards don't show up on success page + await _isInitialized.future; + _walletCore.setCardsStream().listen((event) => _cards.add(event)); } void _setupRecentHistoryStream() { diff --git a/wallet_app/test/src/util/helper/semantics_helper_test.dart b/wallet_app/test/src/util/helper/semantics_helper_test.dart index badd609e8..9454e0b19 100644 --- a/wallet_app/test/src/util/helper/semantics_helper_test.dart +++ b/wallet_app/test/src/util/helper/semantics_helper_test.dart @@ -5,12 +5,12 @@ void main() { group('valid number strings', () { test('number starting with 0 is split correctly', () { String input = '01234'; - String expectedOutput = '0,1,2,3,4'; + String expectedOutput = '0 1 2 3 4'; expect(SemanticsHelper.splitNumberString(input), expectedOutput); }); test('number starting with 1 is split correctly', () { String input = '1234'; - String expectedOutput = '1,2,3,4'; + String expectedOutput = '1 2 3 4'; expect(SemanticsHelper.splitNumberString(input), expectedOutput); }); test('single digit number is split correctly', () { @@ -20,17 +20,17 @@ void main() { }); test('two digit number is split correctly', () { String input = '34'; - String expectedOutput = '3,4'; + String expectedOutput = '3 4'; expect(SemanticsHelper.splitNumberString(input), expectedOutput); }); test('8 digit number is split correctly', () { String input = '12345678'; - String expectedOutput = '1,2,3,4,5,6,7,8'; + String expectedOutput = '1 2 3 4 5 6 7 8'; expect(SemanticsHelper.splitNumberString(input), expectedOutput); }); test('9 digit number is split correctly', () { String input = '123456789'; - String expectedOutput = '1,2,3,4,5,6,7,8,9'; + String expectedOutput = '1 2 3 4 5 6 7 8 9'; expect(SemanticsHelper.splitNumberString(input), expectedOutput); }); });