Repository navigation
Country picker: searchable, name-sorted sheet on iOS and macOS - #1
Merged
Merged
Conversation
Replace the native Country dropdown Picker with a tappable row that presents a sheet containing a search bar and a list of countries sorted by name (locale-aware), with a checkmark on the current selection. - LocationPickerModel: add selectedCountryName and countries(matching:) which sorts by name and filters by search term. - LocationPickerView: Country row opens CountryPickerSheet (NavigationStack + .searchable); selecting a row reuses selectCountry and dismisses. - Add "Search" / "Cancel" strings (EN/TR/AR) to the catalog. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015bPk9UojsfzaVV4N2DWtm6
The picker lives in Sources/Shared so it already drives both apps, but a macOS sheet has no intrinsic size and `.searchable` doesn't render a field reliably inside a sheet there. - Give the macOS sheet an explicit frame. - Use the native `.searchable` field on iOS; on macOS use an explicit search TextField pinned above the list via `.safeAreaInset`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015bPk9UojsfzaVV4N2DWtm6
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.
What
Replaces the native Country dropdown
Pickerwith a sheet that presents a search bar and a list of countries sorted by name (locale-aware), with a checkmark on the current selection. Works on both the iOS app and the macOS menu-bar app.Previously the country list rendered in raw API order (e.g.
KUZEY KIBRIS, TURKIYE, MONAKO…) with no way to search.Changes
LocationPickerModel— addsselectedCountryName(for the picker row) andcountries(matching:), which sorts by name vialocalizedCaseInsensitiveCompareand filters by the trimmed search term.LocationPickerView— the Country row is now a tappableLabeledContent(with a chevron hint) that presentsCountryPickerSheet. Selecting a row reuses the existingselectCountry(_:)flow (cascading city/district loads) and dismisses.CountryPickerSheet—NavigationStack+Listwith a Cancel button:.searchablepull-down search field.TextFieldpinned above the list via.safeAreaInset(.searchabledoesn't render reliably inside a macOS sheet), plus an explicit sheet frame since macOS sheets have no intrinsic size.Localizable.xcstrings— addsSearchandCancelkeys with TR/AR translations.City and District pickers are unchanged.
Testing
/runand confirm the Country sheet opens, searches, and selects (and the menu bar keeps counting down).simctl launchand confirm the Today flow still works after selecting a country.🤖 Generated with Claude Code
Generated by Claude Code