diff --git a/ios/HEXShared/FullKeyboard/HexKeyViews.swift b/ios/HEXShared/FullKeyboard/HexKeyViews.swift index 3e36c3695..05e49cf66 100644 --- a/ios/HEXShared/FullKeyboard/HexKeyViews.swift +++ b/ios/HEXShared/FullKeyboard/HexKeyViews.swift @@ -147,7 +147,7 @@ final class HexKeyControl: UIControl { UIBezierPath(roundedRect: cap, cornerRadius: cap.height / 2).fill() } // In the strip the mark sits on the suggestions' line, as tall as fits around it there - // (16 pt on a phone held upright, where the line is 8 pt below iOS's band), else 19 pt. + // (19 pt, or less where the line leaves less room). let markMidY = inStrip ? (markCenterY ?? cap.midY) : cap.midY let room = inStrip ? 2 * min(markMidY - cap.minY, cap.maxY - markMidY) : cap.height let markSize: CGFloat = inStrip ? min(19, room) : min(19, cap.height * 0.56) diff --git a/ios/HEXShared/FullKeyboard/KeyboardLayout.swift b/ios/HEXShared/FullKeyboard/KeyboardLayout.swift index 5c5ba235a..10eb81464 100644 --- a/ios/HEXShared/FullKeyboard/KeyboardLayout.swift +++ b/ios/HEXShared/FullKeyboard/KeyboardLayout.swift @@ -183,14 +183,12 @@ nonisolated struct KeyboardMetrics: Equatable, Sendable { /// Elsewhere it's the strip less half a point above and below, at most 36 pt. var stripPillHeight: CGFloat { stripHeight == Self.stripBarHeight ? stripHeight : min(stripHeight - 1, 36) } - /// Apple's bar centres its words and dividers 27 pt above row 1's keycaps (iOS 27.2, - /// iPhone 17 Pro: 25.3 pt below the panel's edge, keycaps at 52 pt). In the phone's portrait - /// strip that's 8 pt down, high in the 27 pt the band leaves; Hex centred them in the strip, - /// 5.7 pt below Apple's. Elsewhere the strip is Apple's bar and they centre in it. - static let barTextAboveKeys: CGFloat = 27 - var stripTextCenter: CGFloat { - stripHeight == Self.stripBarHeight ? stripHeight + stripBottom - Self.barTextAboveKeys : stripHeight / 2 - } + /// Where the strip's words, dividers and Hex mark centre: on its middle, so a word sits in + /// the middle of its pill as Apple's does. Apple's words are 27 pt above row 1's keycaps + /// (25.3 pt below the panel's edge on the iPhone 17 Pro, iOS 27.2), but its pill reaches + /// 11 pt up into the band iOS draws over a third-party keyboard; putting Hex's words on + /// Apple's line left them high in a pill that can't (#2201), so they sit 5.5 pt lower. + var stripTextCenter: CGFloat { stripHeight / 2 } /// Apple's keycap corners (iOS 27.2: the same on every iPhone, measured from screenshots /// against keys Hex drew at known radii). diff --git a/ios/HEXShared/FullKeyboard/KeyboardStripView.swift b/ios/HEXShared/FullKeyboard/KeyboardStripView.swift index 8d4b9f16d..ab555bc33 100644 --- a/ios/HEXShared/FullKeyboard/KeyboardStripView.swift +++ b/ios/HEXShared/FullKeyboard/KeyboardStripView.swift @@ -4,8 +4,8 @@ import UIKit /// the iOS 27.2 simulator): SF 17 pt regular in muted ink, slots a third of the keyboard wide, /// 1 × 24 pt dividers ending on the thirds, and a pending autocorrection as a full-slot /// capsule with the divider beside it hidden. iOS's band above the keyboard takes the top of -/// Apple's bar, so the words and dividers sit on Apple's line high in the 27 pt below it -/// (`KeyboardMetrics.stripTextCenter`) and the pills fill it. The centred +/// Apple's bar, so the pills fill the 27 pt below it and the words and dividers centre in it +/// (`KeyboardMetrics.stripTextCenter`). The centred /// `Undo dictation` chip or a status message replaces the slots when needed. @MainActor final class KeyboardStripView: UIView {