From 4e8840cf61e8e3c4fd26b3f270f0deffc4259cad Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Thu, 29 Oct 2026 01:00:21 -0500 Subject: [PATCH] Fill the status bar column and cap the HUD row width on iPhone Duo The next-dev counterpart of the fixes in LoopKit/Loop#2627 that LoopKit/Loop#2606 didn't have. - The status table now extends under the leading and trailing safe areas, as it did before it was hosted in SwiftUI, so the HUD row's grey fills the vertical status bar column beside the time instead of leaving a white box. Cell content still stays within the safe area. - The HUD cell's background matches the HUD view, so the cell is grey where it extends past the HUD. - The HUD row is capped at 500 pt and centered, so on the unfolded Duo it no longer stretches across the display with the CGM pill against the display corner. Every iPhone in portrait is narrower, so phones are unchanged. --- Loop/Views/HUDViewTableViewCell.swift | 4 ++++ Loop/Views/StatusTableView.swift | 2 +- LoopUI/Views/StatusBarHUDView.swift | 8 ++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Loop/Views/HUDViewTableViewCell.swift b/Loop/Views/HUDViewTableViewCell.swift index 7dc949cfe7..57efeed68f 100644 --- a/Loop/Views/HUDViewTableViewCell.swift +++ b/Loop/Views/HUDViewTableViewCell.swift @@ -12,4 +12,8 @@ class HUDViewTableViewCell: UITableViewCell { @IBOutlet var hudView: StatusBarHUDView! + override func awakeFromNib() { + super.awakeFromNib() + backgroundColor = .secondarySystemBackground + } } diff --git a/Loop/Views/StatusTableView.swift b/Loop/Views/StatusTableView.swift index 6f59b1be3a..be4012a8f2 100644 --- a/Loop/Views/StatusTableView.swift +++ b/Loop/Views/StatusTableView.swift @@ -127,7 +127,7 @@ struct StatusTableView: View { var body: some View { ActionTabView { wrappedView - .ignoresSafeArea(edges: .bottom) + .ignoresSafeArea(edges: [.horizontal, .bottom]) .onChange(of: viewModel.temporaryPresetsManager.activeOverride) { _, _ in Task { await viewController.reloadData(animated: true) diff --git a/LoopUI/Views/StatusBarHUDView.swift b/LoopUI/Views/StatusBarHUDView.swift index 1d348e4fbb..aa1b7e240f 100644 --- a/LoopUI/Views/StatusBarHUDView.swift +++ b/LoopUI/Views/StatusBarHUDView.swift @@ -51,11 +51,15 @@ public class StatusBarHUDView: UIView, NibLoadable { containerView.translatesAutoresizingMaskIntoConstraints = false self.addSubview(containerView) - // Use AutoLayout to have the stack view fill its entire container. + // Fill the container, up to a phone-like width on wide displays such as iPhone Duo's inner display. + let fillWidth = containerView.widthAnchor.constraint(equalTo: widthAnchor) + fillWidth.priority = .defaultHigh NSLayoutConstraint.activate([ containerView.centerXAnchor.constraint(equalTo: centerXAnchor), containerView.centerYAnchor.constraint(equalTo: centerYAnchor), - containerView.widthAnchor.constraint(equalTo: widthAnchor), + fillWidth, + containerView.widthAnchor.constraint(lessThanOrEqualTo: widthAnchor), + containerView.widthAnchor.constraint(lessThanOrEqualToConstant: 500), containerView.heightAnchor.constraint(equalTo: heightAnchor), ])