From 3daead7d71f3ee34fdde5d8cd5aa25344a29727e Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Mon, 10 Aug 2026 08:44:48 +0200 Subject: [PATCH] fix(apple): the sub-screens' legends sit where the launcher's does MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Carries the display-corner inset (previous commit) through the three screens that pin the same legend pill — settings, add-host, pair — so they don't drift from the launcher the moment the user opens one. Each of those trays is `maxWidth: .infinity, alignment: .leading`, so the pill is left-aligned there too and the iPad's short centre indicator is never in its way; the keyboard tray sits ABOVE the legend in the stack, so pulling the tray down doesn't put keycaps over the strip. And the settings tab strip now takes its padding from the row metrics instead of two fixed numbers. It was the other half of the iPad sizing complaint: the tier work grew the fields under it while the tab pills stayed at phone scale, which read as a tab bar that belonged to a different screen. macOS + tvOS typecheck. Re-landed on the probe spelling: the corner inset is read from `\.displayBottomInset` (DisplayBottomInsetProbe via ContentView), never asked of UIKit during body — the original spelling froze the update graph of any view that called it on device (see the legend-pinning commit). --- .../PunktfunkClient/Home/GamepadAddHostView.swift | 6 +++++- .../Settings/GamepadSettingsView.swift | 13 ++++++++++--- .../PunktfunkClient/Trust/GamepadPairView.swift | 6 +++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/clients/apple/Sources/PunktfunkClient/Home/GamepadAddHostView.swift b/clients/apple/Sources/PunktfunkClient/Home/GamepadAddHostView.swift index 6a2c602a..751c4f31 100644 --- a/clients/apple/Sources/PunktfunkClient/Home/GamepadAddHostView.swift +++ b/clients/apple/Sources/PunktfunkClient/Home/GamepadAddHostView.swift @@ -14,6 +14,7 @@ import SwiftUI struct GamepadAddHostView: View { @Environment(\.gamepadInk) private var ink @Environment(\.gamepadMetrics) private var metrics + @Environment(\.displayBottomInset) private var displayBottomInset @Environment(\.dismiss) private var dismiss @Environment(\.gamepadHostedInShell) private var hostedInShell let onAdd: (StoredHost) -> Void @@ -77,7 +78,10 @@ struct GamepadAddHostView: View { bottomTray // Equal distance from the left and bottom edges for the legend pill (see GamepadHomeView). .padding(.horizontal, compact ? 12 : 18) - .padding(.bottom, compact ? 12 : 18) + .padding( + .bottom, + gamepadLegendBottomPadding( + compact ? 12 : 18, tier: metrics.tier, displayBottom: displayBottomInset)) .padding(.top, compact ? 6 : 10) } // No aurora — the same clean Liquid-Glass-over-dark base as the gamepad settings screen. diff --git a/clients/apple/Sources/PunktfunkClient/Settings/GamepadSettingsView.swift b/clients/apple/Sources/PunktfunkClient/Settings/GamepadSettingsView.swift index c55df340..3290d2cd 100644 --- a/clients/apple/Sources/PunktfunkClient/Settings/GamepadSettingsView.swift +++ b/clients/apple/Sources/PunktfunkClient/Settings/GamepadSettingsView.swift @@ -47,6 +47,7 @@ enum GpSettingsTab: String, CaseIterable, Hashable { struct GamepadSettingsView: View { @Environment(\.gamepadInk) private var ink @Environment(\.gamepadMetrics) private var metrics + @Environment(\.displayBottomInset) private var displayBottomInset @Environment(\.dismiss) private var dismiss @Environment(\.gamepadHostedInShell) private var hostedInShell /// The saved-host store — the pin picker writes `setPinned` through it and the profile rows @@ -175,7 +176,10 @@ struct GamepadSettingsView: View { // Equal distance from the left and bottom edges for the legend pill (see GamepadHomeView). .padding(.leading, compact ? 12 : 18) .padding(.trailing, 22) - .padding(.bottom, compact ? 12 : 18) + .padding( + .bottom, + gamepadLegendBottomPadding( + compact ? 12 : 18, tier: metrics.tier, displayBottom: displayBottomInset)) .padding(.top, compact ? 6 : 10) .frame(maxWidth: .infinity, alignment: .leading) } @@ -260,8 +264,11 @@ struct GamepadSettingsView: View { // foreground meant white-on-white wherever a palette's accent is pale: Graphite's is // a light grey (luma ≈ 0.80), so its selected tab was unreadable. .foregroundStyle(selected ? ink.onAccent : ink.fg(0.55)) - .padding(.horizontal, 13) - .padding(.vertical, 7) + // Proportional to the row metrics rather than fixed, so the strip grows with the + // fields under it — a tab bar at phone scale above iPad-scale rows was half the + // "does not adapt to larger screens" complaint. + .padding(.horizontal, metrics.rowHPad * 0.8) + .padding(.vertical, metrics.rowVPad * 0.55) .background { // One shared capsule that MOVES between pills, rather than one per pill fading // in and out — the highlight travels the way the press did. A Liquid Glass diff --git a/clients/apple/Sources/PunktfunkClient/Trust/GamepadPairView.swift b/clients/apple/Sources/PunktfunkClient/Trust/GamepadPairView.swift index 5fbe843f..a2647f29 100644 --- a/clients/apple/Sources/PunktfunkClient/Trust/GamepadPairView.swift +++ b/clients/apple/Sources/PunktfunkClient/Trust/GamepadPairView.swift @@ -20,6 +20,7 @@ import SwiftUI struct GamepadPairView: View { @Environment(\.gamepadInk) private var ink @Environment(\.gamepadMetrics) private var metrics + @Environment(\.displayBottomInset) private var displayBottomInset @Environment(\.dismiss) private var dismiss @Environment(\.gamepadHostedInShell) private var hostedInShell let host: StoredHost @@ -81,7 +82,10 @@ struct GamepadPairView: View { // Equal distance from the left and bottom edges for the legend pill (see // GamepadHomeView). .padding(.horizontal, compact ? 12 : 18) - .padding(.bottom, compact ? 12 : 18) + .padding( + .bottom, + gamepadLegendBottomPadding( + compact ? 12 : 18, tier: metrics.tier, displayBottom: displayBottomInset)) .padding(.top, compact ? 6 : 10) } // Hosted in the shell, the field is the shell's own (see GamepadAddHostView's twin).