From e0f6bb78aacca8bd9ef08edf49f7c9bf61ebb35f Mon Sep 17 00:00:00 2001 From: Ryan Vogel <89211796+R44VC0RP@users.noreply.github.com> Date: Sat, 21 Nov 2026 09:59:03 -0500 Subject: [PATCH] iOS: the Hex key's mark sits on the suggestions' line #2201 moved the strip's words up onto Apple's line, 8 pt below iOS's band, but the Hex mark stayed centred in the 27 pt strip, about 5 pt below them. It now centres on the same line (KeyboardMetrics.stripTextCenter), 16 pt tall so it clears the band; the Duo and landscape, where the line is the strip's middle, keep the 19 pt mark. Verified in the iOS 27.2 simulator (iPhone 17 Pro, Messages): the mark spans 17.3-32.3 pt below the panel's edge, centred on the words (19-31 pt). --- ios/HEXShared/FullKeyboard/FullKeyboardView.swift | 1 + ios/HEXShared/FullKeyboard/HexKeyViews.swift | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ios/HEXShared/FullKeyboard/FullKeyboardView.swift b/ios/HEXShared/FullKeyboard/FullKeyboardView.swift index 824224a9c..bf0437199 100644 --- a/ios/HEXShared/FullKeyboard/FullKeyboardView.swift +++ b/ios/HEXShared/FullKeyboard/FullKeyboardView.swift @@ -632,6 +632,7 @@ final class FullKeyboardView: UIView { hexKey.inStrip = hex.row < 0 hexKey.frame = hex.hitFrame.offsetBy(dx: 0, dy: lift) hexKey.keycapFrame = hex.frame.offsetBy(dx: -hex.hitFrame.minX, dy: -hex.hitFrame.minY) + hexKey.markCenterY = layout.metrics.stripTop + layout.metrics.stripTextCenter - hex.hitFrame.minY } if let globe = layout.key(.globe), emojiPanel == nil || routedTarget.isSearching { globeButton.isHidden = false diff --git a/ios/HEXShared/FullKeyboard/HexKeyViews.swift b/ios/HEXShared/FullKeyboard/HexKeyViews.swift index 7279c4254..3e36c3695 100644 --- a/ios/HEXShared/FullKeyboard/HexKeyViews.swift +++ b/ios/HEXShared/FullKeyboard/HexKeyViews.swift @@ -16,6 +16,9 @@ final class HexKeyControl: UIControl { var cornerRadius: CGFloat = FullKeyboardPalette.cornerRadius { didSet { if cornerRadius != oldValue { setNeedsDisplay() } } } /// The drawn keycap inside the control's (larger) touch target. var keycapFrame: CGRect = .zero { didSet { if keycapFrame != oldValue { setNeedsDisplay() } } } + /// In the strip, the suggestions' line in this view's coordinates + /// (`KeyboardMetrics.stripTextCenter`): the mark centres on it, beside the words. + var markCenterY: CGFloat? { didSet { if markCenterY != oldValue { setNeedsDisplay() } } } /// The finger landed on the key, with when (wall clock, from the touch's own timestamp). var onPress: ((TimeInterval) -> Void)? @@ -143,9 +146,12 @@ final class HexKeyControl: UIControl { palette.keyPressedFill.setFill() UIBezierPath(roundedRect: cap, cornerRadius: cap.height / 2).fill() } - // In the strip the mark keeps its 19 pt in the 26 pt pill as in the Duo's 36 pt one. - let markSize: CGFloat = inStrip ? min(19, cap.height) : min(19, cap.height * 0.56) - let markRect = CGRect(x: cap.midX - markSize / 2, y: cap.midY - markSize / 2, width: markSize, height: markSize) + // 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. + 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) + let markRect = CGRect(x: cap.midX - markSize / 2, y: markMidY - markSize / 2, width: markSize, height: markSize) if isWarm { HexMarkPath.draw(in: context, rect: markRect, color: palette.textBase, coreColor: palette.warmCore) } else {