Skip to content

fix: keep TextField prompts as Text instead of dashFont - #9

Open
romchornyi wants to merge 1 commit into
masterfrom
fix/textfield-prompt-type
Open

fix: keep TextField prompts as Text instead of dashFont#9
romchornyi wants to merge 1 commit into
masterfrom
fix/textfield-prompt-type

Conversation

@romchornyi

@romchornyi romchornyi commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

master does not compile for iOS. The dashFont conversion in #8 turned two
TextField prompts into some View, but a prompt must be a Text:

SearchBar.swift:146:22       Cannot convert value of type 'some View' to expected argument type 'Text'
AddressFieldView.swift:126:22

What was done?

Reverts those two call sites to .font(Font.dash.subhead).

This is the correct call there regardless of the compile error: dashFont pairs a font
with a line height, and a line height cannot be applied to a Text at all — it is a
View modifier. Added a comment at both sites so the next sweep does not convert them
again.

Why CI and I both missed it: SearchBar and AddressFieldView are wrapped in
#if canImport(UIKit), so swift build on macOS never compiles them. The package has no
iOS build step, so nothing caught it before merge.

How Has This Been Tested?

swift build                                                        # macOS
xcodebuild -scheme DashUIKit -destination 'generic/platform=iOS Simulator' \
           -configuration Debug build                              # BUILD SUCCEEDED

The iOS build covers the UIKit-gated files and, under Debug, the #if DEBUG previews.

Worth considering as a follow-up: adding an iOS build to CI, since macOS-only
verification structurally cannot see roughly the UIKit half of this library.

Breaking Changes

None — restores what the code did before #8.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

Summary by CodeRabbit

  • Bug Fixes
    • Improved placeholder text styling in address fields and search bars on iOS 17 and later.
    • Ensured placeholder text displays with the correct font and formatting.

The dashFont conversion turned two TextField prompts into some View. A prompt
must be a Text, so both call sites failed to compile:

  SearchBar.swift:146      Cannot convert value of type 'some View' to Text
  AddressFieldView.swift:126

Reverts those two to .font(Font.dash.subhead), which is the correct call here
regardless — dashFont pairs a font with a line height, and a line height cannot
be applied to Text in the first place.

Both files are wrapped in #if canImport(UIKit), so swift build on macOS never
compiled them. Verified with xcodebuild against an iOS destination.
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 378b2e31-941c-4ea8-9e03-f159cbf0be31

📥 Commits

Reviewing files that changed from the base of the PR and between 8c39460 and 449c6ce.

📒 Files selected for processing (2)
  • Sources/DashUIKit/Components/AddressFieldView.swift
  • Sources/DashUIKit/Components/SearchBar.swift

📝 Walkthrough

Walkthrough

iOS 17+ prompts in AddressFieldView and SearchBar now apply Font.dash.subhead directly while remaining SwiftUI Text values. Comments document the prompt type constraint and line-height limitation.

Changes

Prompt typography

Layer / File(s) Summary
Update prompt font application
Sources/DashUIKit/Components/AddressFieldView.swift, Sources/DashUIKit/Components/SearchBar.swift
iOS 17+ TextField prompts use .font(Font.dash.subhead) instead of .dashFont(.subhead), with comments explaining the Text requirement.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • dashpay/DashUIKit#8: Updates the same iOS 17+ prompt typography behavior in SearchBar and AddressFieldView.

Suggested reviewers: jeanpierreroma

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: preserving TextField prompt Text by replacing dashFont usage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/textfield-prompt-type

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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