Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 87 additions & 15 deletions Sources/DashUIKit/Components/AddressFieldView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@
#if canImport(UIKit)
import SwiftUI

/// Outside the view, not nested in it: `AddressFieldView` is generic over its
/// accessory, and a generic type cannot hold static stored properties.
private enum Layout {
static let hSpacing: CGFloat = 20
static let lPadding: CGFloat = 20
static let tPadding: CGFloat = 10
static let iconSize: CGFloat = 17
static let cornerRadius: CGFloat = 16
static let actionTapArea: CGFloat = 40
}

@available(iOS 15, macOS 12, *)
public struct AddressFieldView: View {

private enum Layout {
static let hSpacing: CGFloat = 20
static let lPadding: CGFloat = 20
static let tPadding: CGFloat = 10
static let iconSize: CGFloat = 17
static let cornerRadius: CGFloat = 16
static let actionTapArea: CGFloat = 40
}
public struct AddressFieldView<Accessory: View>: View {
Comment on lines 31 to +32

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# Inspect iOS-specific APIs that must be isolated or replaced for the iOS 14 path.
rg -n -C 3 '`@available`\(iOS|`@FocusState`|`#available`\(iOS|textInputAutocapitalization|disableAutocorrection' \
  Sources/DashUIKit/Components/AddressFieldView.swift

# Inspect declared deployment targets when project metadata is present.
for file in $(fd -HI -t f '^(Package\.swift|project\.pbxproj|.*\.podspec)$' . || true); do
  rg -n -C 2 'iOS|IPHONEOS_DEPLOYMENT_TARGET|platforms|macOS' "$file" || true
done

Repository: dashpay/DashUIKit

Length of output: 3522


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# Map and inspect the component and nearby availability-sensitive declarations.
ast-grep outline Sources/DashUIKit/Components/AddressFieldView.swift
sed -n '1,210p' Sources/DashUIKit/Components/AddressFieldView.swift
sed -n '240,370p' Sources/DashUIKit/Components/AddressFieldView.swift

# Check the package deployment declaration and related availability patterns.
rg -n -C 3 'platforms:|\.iOS\(|\.macOS\(|`@FocusState`|focused\(' Package.swift Sources/DashUIKit

Repository: dashpay/DashUIKit

Length of output: 14889


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
import re

path = Path("Sources/DashUIKit/Components/AddressFieldView.swift")
text = path.read_text()

public_annotations = re.findall(
    r'`@available`\(([^)]*)\)\s*(?:public\s+)?(?:struct|extension)\s+AddressFieldView',
    text,
)
focus_declarations = re.findall(r'^\s*`@FocusState`\b.*$', text, re.MULTILINE)
focus_uses = re.findall(r'\.focused\(\$isTextFieldFocused\)', text)
package = Path("Package.swift").read_text()

print("public AddressFieldView availability:")
for annotation in public_annotations:
    print(annotation)
print("FocusState declarations:", len(focus_declarations))
print("focused uses:", len(focus_uses))
print("package iOS 14:", bool(re.search(r'\.iOS\(\.v14\)', package)))
print("focus-dependent computed properties:")
for line_no, line in enumerate(text.splitlines(), 1):
    if "isTextFieldFocused" in line or "isFocusedState" in line:
        print(f"{line_no}: {line.strip()}")
PY

Repository: dashpay/DashUIKit

Length of output: 768


Restore iOS 14 and macOS 11 support for the public API.

Package.swift declares iOS 14 support, but AddressFieldView and its compatibility initializer require iOS 15 and macOS 12. The type also uses @FocusState in its focus-dependent state and both text-field branches. Isolate this behavior and provide an iOS 14 fallback before changing the public declarations to @available(iOS 14, macOS 11, *).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/DashUIKit/Components/AddressFieldView.swift` around lines 31 - 32,
Restore compatibility in AddressFieldView by isolating the `@FocusState-dependent`
behavior and text-field branches behind iOS 15/macOS 12 availability, and
provide an equivalent iOS 14/macOS 11 fallback. Then update AddressFieldView and
its compatibility initializer availability to iOS 14/macOS 11 while preserving
focus behavior on newer platforms.

Source: Coding guidelines


@Binding private var text: String
private let label: String
Expand All @@ -37,6 +39,11 @@ public struct AddressFieldView: View {
private var isDisabled: Bool
private var onScanQR: (() -> Void)?
private var onPaste: (() -> Void)?
/// Trailing content on the label row — a badge naming what the entered
/// address turned out to be, say. Sits opposite `label`, so it is for
/// something that describes the field rather than acts on it; the
/// controls that act live inside the field itself.
private let accessory: Accessory

@FocusState private var isTextFieldFocused: Bool

Expand All @@ -48,7 +55,8 @@ public struct AddressFieldView: View {
errorText: String? = nil,
isDisabled: Bool = false,
onScanQR: (() -> Void)? = nil,
onPaste: (() -> Void)? = nil
onPaste: (() -> Void)? = nil,
@ViewBuilder accessory: () -> Accessory
) {
self._text = text
self.label = label
Expand All @@ -58,14 +66,21 @@ public struct AddressFieldView: View {
self.isDisabled = isDisabled
self.onScanQR = onScanQR
self.onPaste = onPaste
self.accessory = accessory()
}

public var body: some View {
VStack(alignment: .leading, spacing: 10) {
Text(label)
.dashFont(.footnote)
.foregroundStyle(Color.dash.gray500)
.frame(maxWidth: .infinity, alignment: .leading)
HStack(spacing: 8) {
Text(label)
.dashFont(.footnote)
.foregroundStyle(Color.dash.gray500)

Spacer(minLength: 0)

accessory
}
.frame(maxWidth: .infinity, alignment: .leading)

HStack(alignment: .center, spacing: Layout.hSpacing) {
textField
Expand Down Expand Up @@ -101,6 +116,37 @@ public struct AddressFieldView: View {
}
}

}

@available(iOS 15, macOS 12, *)
public extension AddressFieldView where Accessory == EmptyView {
/// No label accessory — the original shape, unchanged for callers that
/// have nothing to put there.
init(
text: Binding<String>,
label: String,
placeholder: String,
hasError: Bool,
errorText: String? = nil,
isDisabled: Bool = false,
onScanQR: (() -> Void)? = nil,
onPaste: (() -> Void)? = nil
) {
self.init(
text: text,
label: label,
placeholder: placeholder,
hasError: hasError,
errorText: errorText,
isDisabled: isDisabled,
onScanQR: onScanQR,
onPaste: onPaste,
accessory: { EmptyView() })
}
}

@available(iOS 15, macOS 12, *)
extension AddressFieldView {
// MARK: - Subviews

private var showsPasteButton: Bool {
Expand Down Expand Up @@ -292,5 +338,31 @@ public struct AddressFieldView: View {
.padding()
}

@available(iOS 17, macOS 14, *)
#Preview("Label accessory") {
AddressFieldView(
text: .constant("yV1D1ivvSUyKPJnbFmzSTVh1MyZ3JbeVkY"),
label: "Address",
placeholder: "Dash address",
hasError: false
) {
// What the host puts here is its own: a badge naming the kind of
// address that was entered, decided by the host's own decoder.
HStack(spacing: 4) {
Image(systemName: "d.circle.fill")
.font(.system(size: 10, weight: .semibold))
Comment on lines +352 to +353

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use a DashIconSource for the badge icon.

Image(systemName:) bypasses the DashUIKit icon source contract. Select or add an appropriate DashIconSource, then render it with Image(dash: source).

As per coding guidelines, represent icons with DashIconSource and render them using Image(dash: source).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/DashUIKit/Components/AddressFieldView.swift` around lines 352 - 353,
Replace the direct Image(systemName:) badge icon in AddressFieldView with an
appropriate DashIconSource, then render that source using Image(dash: source)
while preserving the existing size and weight styling.

Source: Coding guidelines

Text("Transparent address")
.dashFont(.caption2)
}
Comment on lines +343 to +356

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Localize the preview strings.

"Address", "Dash address", and "Transparent address" are user-facing strings. Use NSLocalizedString(_, bundle: .module, comment:) for each string and add the corresponding localized entries.

Proposed change
-        label: "Address",
-        placeholder: "Dash address",
+        label: NSLocalizedString("Address", bundle: .module, comment: "DashUIKit"),
+        placeholder: NSLocalizedString("Dash address", bundle: .module, comment: "DashUIKit"),
...
-            Text("Transparent address")
+            Text(NSLocalizedString("Transparent address", bundle: .module, comment: "DashUIKit"))

As per coding guidelines, localize all user-facing strings with NSLocalizedString(_, bundle: .module, comment:).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
AddressFieldView(
text: .constant("yV1D1ivvSUyKPJnbFmzSTVh1MyZ3JbeVkY"),
label: "Address",
placeholder: "Dash address",
hasError: false
) {
// What the host puts here is its own: a badge naming the kind of
// address that was entered, decided by the host's own decoder.
HStack(spacing: 4) {
Image(systemName: "d.circle.fill")
.font(.system(size: 10, weight: .semibold))
Text("Transparent address")
.dashFont(.caption2)
}
AddressFieldView(
text: .constant("yV1D1ivvSUyKPJnbFmzSTVh1MyZ3JbeVk"),
label: NSLocalizedString("Address", bundle: .module, comment: "DashUIKit"),
placeholder: NSLocalizedString("Dash address", bundle: .module, comment: "DashUIKit"),
hasError: false
) {
// What the host puts here is its own: a badge naming the kind of
// address that was entered, decided by the host's own decoder.
HStack(spacing: 4) {
Image(systemName: "d.circle.fill")
.font(.system(size: 10, weight: .semibold))
Text(NSLocalizedString("Transparent address", bundle: .module, comment: "DashUIKit"))
.dashFont(.caption2)
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/DashUIKit/Components/AddressFieldView.swift` around lines 343 - 356,
Localize the preview’s user-facing strings in AddressFieldView by wrapping
“Address,” “Dash address,” and “Transparent address” with NSLocalizedString
using bundle: .module and appropriate comments; add matching entries to the
module’s localization resources.

Source: Coding guidelines

.foregroundStyle(Color.dash.blueText)
.padding(.horizontal, 8)
.padding(.vertical, 3)
.background(Color.dash.blueAlpha10)
.clipShape(Capsule())
}
.padding()
.background(Color.dash.primaryBackground)
}
Comment on lines +341 to +365

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Guard the iOS 17 preview with #if DEBUG.

The new #Preview uses an iOS 17-only declaration without the required debug guard. Wrap Lines 341-365 in #if DEBUG and #endif.

As per coding guidelines, preview-only code may require iOS 17 only when guarded by #if DEBUG.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/DashUIKit/Components/AddressFieldView.swift` around lines 341 - 365,
Wrap the iOS 17/macOS 14 `#Preview("Label accessory")` declaration in `#if
DEBUG` and `#endif`, preserving the existing preview implementation unchanged.

Source: Coding guidelines


#endif
#endif // canImport(UIKit)
65 changes: 53 additions & 12 deletions Sources/DashUIKit/Components/BottomSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,26 @@ public struct BottomSheet<Content: View>: View {
/// when natural sizing is needed — it guarantees `fillsHeight: false` and the modifier are
/// always applied together.
public var fillsHeight: Bool = true
/// Fill behind the whole sheet — grabber, header and content alike. Also
/// used as the presentation background so the home-indicator inset the
/// detent adds matches; a host that only restyles its own content would
/// otherwise get a strip of this colour along the bottom edge.
public var background: Color = .dash.primaryBackground
@ViewBuilder public var content: () -> Content

public init(
title: String = "",
showBackButton: Binding<Bool>,
onBackButtonPressed: (() -> Void)? = nil,
fillsHeight: Bool = true,
background: Color = .dash.primaryBackground,
@ViewBuilder content: @escaping () -> Content
) {
self.title = title
self._showBackButton = showBackButton
self.onBackButtonPressed = onBackButtonPressed
self.fillsHeight = fillsHeight
self.background = background
self.content = content
}

Expand All @@ -42,7 +49,7 @@ public struct BottomSheet<Content: View>: View {

contentSection
}
.background(Color.dash.primaryBackground)
.background(background)

if fillsHeight {
sheet.edgesIgnoringSafeArea(.bottom)
Expand Down Expand Up @@ -103,13 +110,13 @@ public struct BottomSheet<Content: View>: View {
.navigationBarHidden(true)
#endif
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.dash.primaryBackground)
.background(background)
}
} else {
// Natural height — no greedy NavigationView / maxHeight so the sheet can self-size.
content()
.frame(maxWidth: .infinity)
.background(Color.dash.primaryBackground)
.background(background)
}
}
}
Expand All @@ -134,6 +141,7 @@ public extension BottomSheet {
onBackButtonPressed: (() -> Void)? = nil,
fallback: CGFloat = 0,
maxHeightFraction: CGFloat = 0.95,
background: Color = .dash.primaryBackground,
cornerRadius: CGFloat? = nil,
@ViewBuilder content: @escaping () -> Content
) -> some View {
Expand All @@ -142,9 +150,14 @@ public extension BottomSheet {
showBackButton: showBackButton,
onBackButtonPressed: onBackButtonPressed,
fillsHeight: false,
background: background,
content: content
)
.selfSizingSheet(fallback: fallback, maxHeightFraction: maxHeightFraction, cornerRadius: cornerRadius)
.selfSizingSheet(
fallback: fallback,
maxHeightFraction: maxHeightFraction,
background: background,
cornerRadius: cornerRadius)
}
}

Expand All @@ -163,28 +176,34 @@ public extension View {
/// - fallback: Height used before the first measurement (avoids a `.medium` flash).
/// - maxHeightFraction: Caps the sheet at this fraction of the window height; taller content
/// is clipped, so wrap it in a `ScrollView`.
/// - background: Fill for the sheet and its presentation, so the bottom
/// safe-area strip matches the content. Defaults to the sheet's own.
/// - cornerRadius: Optional corner radius applied via `presentationCornerRadius` on
/// iOS 16.4..<26 (iOS 26+ keeps the system corner styling). When provided, the sheet
/// background is also filled so the bottom safe-area strip matches the content.
/// iOS 16.4..<26 (iOS 26+ keeps the system corner styling).
@ViewBuilder
func selfSizingSheet(
fallback: CGFloat = 0,
maxHeightFraction: CGFloat = 0.95,
background: Color = .dash.primaryBackground,
cornerRadius: CGFloat? = nil
Comment on lines +179 to 188

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Make the direct modifier default match the wrapped sheet.

selfSizingSheet(background:) defaults to .dash.primaryBackground independently of BottomSheet.background. A direct composition with a custom BottomSheet(background:) and .selfSizingSheet() therefore uses different colors for the content and presentation. The bottom inset can show the primary background again.

Propagate the sheet color through an environment value, or remove “Defaults to the sheet’s own” and require direct modifier calls to pass the same color.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/DashUIKit/Components/BottomSheet.swift` around lines 179 - 188, The
selfSizingSheet modifier’s default background must match the enclosing
BottomSheet background. Update the BottomSheet and selfSizingSheet flow to
propagate and reuse the configured sheet color via the existing environment
mechanism, or require the modifier caller to provide it explicitly; remove the
incorrect independent .dash.primaryBackground default and preserve matching
content and presentation colors.

) -> some View {
if #available(iOS 16.0, macOS 13.0, *) {
let modified = modifier(SelfSizingSheetModifier(fallback: fallback, maxHeightFraction: maxHeightFraction))
#if os(iOS)
if #available(iOS 16.4, *), let cornerRadius {
if #unavailable(iOS 26.0) {
// iOS 16.4..<26: apply the custom corner radius + fill the sheet background.
if #available(iOS 16.4, *) {
// The background is filled whatever the corner radius: the
// measured height excludes the home-indicator inset that
// `.presentationDetents([.height])` adds back, so that strip
// sits outside the sheet's own `VStack` and shows the system
// background unless this fills it.
if #unavailable(iOS 26.0), let cornerRadius {
modified
.presentationCornerRadius(cornerRadius)
.presentationBackground(Color.dash.primaryBackground)
.presentationBackground(background)
} else {
// iOS 26+: keep the system corner styling, just fill the background.
// iOS 26+ keeps the system corner styling.
modified
.presentationBackground(Color.dash.primaryBackground)
.presentationBackground(background)
Comment on lines 190 to +206

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="Sources/DashUIKit/Components/BottomSheet.swift"
rg -n -C 6 'presentationBackground|`#if` os\(iOS\)|macOS 13\.0|`@available`\(iOS 14' "$file"

Repository: dashpay/DashUIKit

Length of output: 4155


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- BottomSheet.swift ---'
sed -n '130,240p' Sources/DashUIKit/Components/BottomSheet.swift
printf '%s\n' '--- Package manifests and platform declarations ---'
fd -i -t f 'Package.swift|.*\.podspec|.*\.yml|.*\.yaml' . -x sh -c 'printf "\n--- %s ---\n" "$1"; rg -n -C 3 "platform|macOS|iOS|swift-tools-version" "$1"' sh {}
printf '%s\n' '--- selfSizingSheet usages ---'
rg -n -C 3 'selfSizingSheet|BottomSheet\.selfSizing|BottomSheet\(' Sources Tests 2>/dev/null || true

Repository: dashpay/DashUIKit

Length of output: 12451


🌐 Web query:

SwiftUI presentationBackground macOS availability macOS 13 documentation

💡 Result:

The presentationBackground(:) modifier in SwiftUI is available on macOS starting with macOS 13.3 [1][2]. It allows you to customize the background of modal presentations such as sheets, popovers, and full-screen covers [3][4]. Key details regarding this modifier include: Availability: It was introduced in iOS 16.4 and macOS 13.3 [1][2]. Functionality: The modifier applies a ShapeStyle (such as a color, gradient, or material) to the background of an enclosing presentation [5][3]. A secondary version, presentationBackground(alignment:content:), allows for more complex, custom view backgrounds [6][3]. Platform Behavior: Unlike the standard background(:) modifier, presentationBackground(_:) automatically fills the entire presentation area and supports translucency, allowing underlying views to show through when using appropriate styles [5][7][4]. When using this modifier, ensure that nested container views like List or Form have their default backgrounds disabled (e.g., using.scrollContentBackground(.hidden)) if you wish for your custom presentation background to be visible [3].

Citations:


Apply the presentation background on macOS 13.3 and later.

presentationBackground is available on macOS 13.3+, but the #if os(iOS) branch excludes macOS. The background parameter therefore has no effect on macOS presentations. Add a macOS 13.3 availability branch or narrow the API documentation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/DashUIKit/Components/BottomSheet.swift` around lines 190 - 206,
Update the macOS path in the availability-gated modifier flow around
SelfSizingSheetModifier so presentationBackground(background) is applied on
macOS 13.3 and later. Keep the existing iOS-specific corner-radius handling
intact, and ensure older macOS versions continue using the fallback behavior.

Source: Coding guidelines

}
} else {
modified
Expand Down Expand Up @@ -283,3 +302,25 @@ private struct SelfSizingSheetModifier: ViewModifier {
.padding()
}
}

@available(iOS 17, macOS 14, *)
#Preview("BottomSheet Custom Background") {
BottomSheet(
title: "Bottom Sheet",
showBackButton: .constant(false),
fillsHeight: false,
background: .dash.secondaryBackground
) {
VStack(alignment: .leading, spacing: 12) {
Text("Cards on a tinted sheet")
.dashFont(.calloutMedium)
.foregroundColor(.dash.primaryText)

Text("The host picks the fill; cards drawn on top keep their own.")
.dashFont(.body)
.foregroundColor(.dash.secondaryText)
.modifier(MenuViewModifier())
}
.padding()
}
}
Comment on lines +305 to +326

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="Sources/DashUIKit/Components/BottomSheet.swift"
rg -n -B 8 -A 4 '`#Preview`|`#if` DEBUG|`#endif`' "$file"

Repository: dashpay/DashUIKit

Length of output: 2543


Guard all #Preview declarations with #if DEBUG and #endif. These previews use iOS 17 and macOS 14 availability while BottomSheet supports iOS 14 and macOS 11.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/DashUIKit/Components/BottomSheet.swift` around lines 305 - 326, Wrap
the `#Preview` declaration for “BottomSheet Custom Background” in `#if` DEBUG and a
matching `#endif`, preserving its existing iOS 17/macOS 14 availability and
preview content.

Source: Coding guidelines

9 changes: 8 additions & 1 deletion docs/navigation-and-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Sheet chrome to put **inside** a SwiftUI `.sheet { }`: a grabber, a `NavigationB
title: "Details",
showBackButton: $showBack, // Binding<Bool>
onBackButtonPressed: { /* pop */ },
fillsHeight: true // greedy: fills the sheet
fillsHeight: true, // greedy: fills the sheet
background: .dash.primaryBackground // fill behind grabber, header and content
) {
MyContent()
}
Expand All @@ -94,6 +95,7 @@ the modifier are applied together:
showBackButton: .constant(false),
fallback: 240, // height before first measurement (avoids .medium flash)
maxHeightFraction: 0.95, // cap at 95% of window height (clip taller → use ScrollView)
background: .dash.secondaryBackground, // also fills the home-indicator strip
cornerRadius: 24 // iOS 16.4..<26; iOS 26+ keeps system corners
) {
MyContent()
Expand All @@ -107,6 +109,11 @@ a **no-op below iOS 16**. The measured content must have a finite intrinsic heig
greedy `Spacer`/`maxHeight: .infinity`), or the measurement is wrong.
`BottomSheetHeightPreferenceKey` is exposed for advanced cases.

`background` fills the sheet **and** its presentation. The measured height excludes the
home-indicator inset that `presentationDetents([.height])` adds back, so that strip lies
outside the sheet's own stack — without the presentation fill it shows the system
background as a pale band along the bottom edge, whatever the content is styled with.

---

## MenuViewModifier
Expand Down
Loading