Skip to content

feat(signup): country picker for the phone number - #330

Merged
jvsena42 merged 4 commits into
mainfrom
feat/phone-country-picker
Sep 18, 2026
Merged

jvsena42 merged 4 commits into
mainfrom
feat/phone-country-picker

Conversation

@jvsena42

Copy link
Copy Markdown
Owner

The SMS signup field used to require a hand-typed E.164 number, and a wrong one spends one of the two weekly SMS attempts. Now the user picks a country and types the number the way they normally would.

Shared

  • DialingCountries: every region and its calling code. It can split a pasted +44 … back into country + national part, and it drops a trunk 0 (except in IT/VA/SM/CI, where the 0 is part of the number).
  • PhoneVerificationViewModel holds country (starting on the device region, deviceRegionCode() expect/actual) beside the national number, and joins them only in internationalNumber. A number entered with its own + moves the picker instead of getting prefixed twice. The resumed-code path splits the stored number the same way.
  • Tests: DialingCountriesTest (checks that no calling code is a prefix of another, trunk-zero rules, splitting) and a new PhoneVerificationViewModelTest.

Android: a flag + code button inside the field opens a full-height, searchable ModalBottomSheet. A dropdown menu doesn't work for ~240 rows, and it would sit under the keyboard.
iOS: the same button opens a sheet with a List + .searchable, the native pattern.
Both search by name (ignoring case and accents), by ISO code, or by calling code. Names come from the platform's locale data. Once the number is valid, the hint reads it back in full ("We'll text +44 7700900123.").

Strings: 6 new keys in all 11 languages. signup_phone_hint is reworded, and signup_phone_placeholder is removed.

Verification

  • detektAll, :shared:jvmTest, :shared:compileKotlinMetadata, checkStringPlurals and :androidApp:assembleDebug all pass.
  • Android: new journey 27 driven on Pixel_Tablet in landscape and portrait. Results are in journeys/RESULTS.md.
  • ⚠️ iOS is not compiled or driven. This was written on Linux, so CountryPickerSheet.swift, the PhoneVerificationScreen.swift changes and Region.ios.kt need a Mac build and a pass of journey 27 before merging.

🤖 Generated with Claude Code

jvsena42 and others added 4 commits September 18, 2026 18:12
DialingCountries maps every region to its country calling code, splits a
pasted international number back into country and national part, and
drops a trunk 0 where it is not part of the number (Italy and Côte
d'Ivoire keep theirs). Names are left to the platforms' locale data.
deviceRegionCode() gives the picker its starting country.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds the picker's title, search prompt, empty state and button label, and
a read-back line for the full number, in all eleven languages. The hint no
longer asks for a country code, and the +31 placeholder goes: both
described typing the code by hand.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The number field used to require a hand-typed E.164 number, and a wrong
one spends one of the two weekly SMS attempts. The ViewModel now holds a
country (starting on the device region) beside the national number and
joins them only for the wire; a number entered with its own + moves the
picker rather than being prefixed twice.

Android opens a searchable ModalBottomSheet from a flag-and-code button
inside the field; iOS opens a List with .searchable in a sheet. Both
search by name (case- and accent-insensitive), ISO code or calling code,
and read the full number back once it is valid.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jvsena42
jvsena42 merged commit 550e86d into main Sep 18, 2026
8 checks passed
@jvsena42
jvsena42 deleted the feat/phone-country-picker branch September 18, 2026 21:21
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