Skip to content

Country picker: searchable, name-sorted sheet on iOS and macOS - #1

Merged
olcayertas merged 2 commits into
mainfrom
claude/country-picker-sheet-search-mhsyxs
Jun 29, 2026
Merged

olcayertas merged 2 commits into
mainfrom
claude/country-picker-sheet-search-mhsyxs

Conversation

@olcayertas

Copy link
Copy Markdown
Owner

What

Replaces the native Country dropdown Picker with 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 — adds selectedCountryName (for the picker row) and countries(matching:), which sorts by name via localizedCaseInsensitiveCompare and filters by the trimmed search term.
  • LocationPickerView — the Country row is now a tappable LabeledContent (with a chevron hint) that presents CountryPickerSheet. Selecting a row reuses the existing selectCountry(_:) flow (cascading city/district loads) and dismisses.
  • CountryPickerSheet — NavigationStack + List with a Cancel button:
    • iOS: native .searchable pull-down search field.
    • macOS: explicit search TextField pinned above the list via .safeAreaInset (.searchable doesn't render reliably inside a macOS sheet), plus an explicit sheet frame since macOS sheets have no intrinsic size.
  • Localizable.xcstrings — adds Search and Cancel keys with TR/AR translations.

City and District pickers are unchanged.

Testing

⚠️ Built in a Linux environment with no Xcode toolchain, so this has not been compiled or run. Per the project checklist, please verify before merging:

  • macOS: /run and confirm the Country sheet opens, searches, and selects (and the menu bar keeps counting down).
  • iOS: build + simctl launch and confirm the Today flow still works after selecting a country.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 2 commits June 28, 2026 08:34
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
@olcayertas
olcayertas merged commit 3acc124 into main Jun 29, 2026
3 checks passed
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.

2 participants