Commit a0f74c5c52

a0f74c5c52326c43995ee1296506a045e5aa082d

parent: 5da0306f24

Unsigned

cmc <hello@cleberg.net> · 2026-05-14 17:52 UTC

fix: center align medium widget

Layout: unified · split

Hutch.xcodeproj/project.pbxproj +12 −12
@@ -597,7 +597,7 @@
597597 ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
598598 CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements;
599599 CODE_SIGN_STYLE = Automatic;
600 CURRENT_PROJECT_VERSION = 85;
600 CURRENT_PROJECT_VERSION = 86;
601601 DEVELOPMENT_TEAM = ZCNAX3VL9D;
602602 ENABLE_PREVIEWS = YES;
603603 GENERATE_INFOPLIST_FILE = YES;
@@ -614,7 +614,7 @@
614614 "$(inherited)",
615615 "@executable_path/Frameworks",
616616 );
617 MARKETING_VERSION = 3.4.0;
617 MARKETING_VERSION = 3.4.1;
618618 PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch;
619619 PRODUCT_NAME = "$(TARGET_NAME)";
620620 STRING_CATALOG_GENERATE_SYMBOLS = YES;
@@ -634,7 +634,7 @@
634634 ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
635635 CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements;
636636 CODE_SIGN_STYLE = Automatic;
637 CURRENT_PROJECT_VERSION = 85;
637 CURRENT_PROJECT_VERSION = 86;
638638 DEVELOPMENT_TEAM = ZCNAX3VL9D;
639639 ENABLE_PREVIEWS = YES;
640640 GENERATE_INFOPLIST_FILE = YES;
@@ -651,7 +651,7 @@
651651 "$(inherited)",
652652 "@executable_path/Frameworks",
653653 );
654 MARKETING_VERSION = 3.4.0;
654 MARKETING_VERSION = 3.4.1;
655655 PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch;
656656 PRODUCT_NAME = "$(TARGET_NAME)";
657657 STRING_CATALOG_GENERATE_SYMBOLS = YES;
@@ -714,7 +714,7 @@
714714 APPLICATION_EXTENSION_API_ONLY = YES;
715715 CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements;
716716 CODE_SIGN_STYLE = Automatic;
717 CURRENT_PROJECT_VERSION = 85;
717 CURRENT_PROJECT_VERSION = 86;
718718 DEVELOPMENT_TEAM = ZCNAX3VL9D;
719719 GENERATE_INFOPLIST_FILE = NO;
720720 INFOPLIST_FILE = HutchWidgetExtension/Info.plist;
@@ -724,7 +724,7 @@
724724 "@executable_path/Frameworks",
725725 "@executable_path/../../Frameworks",
726726 );
727 MARKETING_VERSION = 3.4.0;
727 MARKETING_VERSION = 3.4.1;
728728 PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension;
729729 PRODUCT_NAME = "$(TARGET_NAME)";
730730 SKIP_INSTALL = YES;
@@ -743,7 +743,7 @@
743743 APPLICATION_EXTENSION_API_ONLY = YES;
744744 CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements;
745745 CODE_SIGN_STYLE = Automatic;
746 CURRENT_PROJECT_VERSION = 85;
746 CURRENT_PROJECT_VERSION = 86;
747747 DEVELOPMENT_TEAM = ZCNAX3VL9D;
748748 GENERATE_INFOPLIST_FILE = NO;
749749 INFOPLIST_FILE = HutchWidgetExtension/Info.plist;
@@ -753,7 +753,7 @@
753753 "@executable_path/Frameworks",
754754 "@executable_path/../../Frameworks",
755755 );
756 MARKETING_VERSION = 3.4.0;
756 MARKETING_VERSION = 3.4.1;
757757 PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension;
758758 PRODUCT_NAME = "$(TARGET_NAME)";
759759 SKIP_INSTALL = YES;
@@ -772,7 +772,7 @@
772772 APPLICATION_EXTENSION_API_ONLY = YES;
773773 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
774774 CODE_SIGN_STYLE = Automatic;
775 CURRENT_PROJECT_VERSION = 84;
775 CURRENT_PROJECT_VERSION = 86;
776776 DEVELOPMENT_TEAM = ZCNAX3VL9D;
777777 GENERATE_INFOPLIST_FILE = NO;
778778 INFOPLIST_FILE = HutchSafariExtension/Info.plist;
@@ -782,7 +782,7 @@
782782 "@executable_path/Frameworks",
783783 "@executable_path/../../Frameworks",
784784 );
785 MARKETING_VERSION = 3.3.1;
785 MARKETING_VERSION = 3.4.1;
786786 PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchSafariExtension;
787787 PRODUCT_NAME = "$(TARGET_NAME)";
788788 SKIP_INSTALL = YES;
@@ -801,7 +801,7 @@
801801 APPLICATION_EXTENSION_API_ONLY = YES;
802802 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
803803 CODE_SIGN_STYLE = Automatic;
804 CURRENT_PROJECT_VERSION = 84;
804 CURRENT_PROJECT_VERSION = 86;
805805 DEVELOPMENT_TEAM = ZCNAX3VL9D;
806806 GENERATE_INFOPLIST_FILE = NO;
807807 INFOPLIST_FILE = HutchSafariExtension/Info.plist;
@@ -811,7 +811,7 @@
811811 "@executable_path/Frameworks",
812812 "@executable_path/../../Frameworks",
813813 );
814 MARKETING_VERSION = 3.3.1;
814 MARKETING_VERSION = 3.4.1;
815815 PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchSafariExtension;
816816 PRODUCT_NAME = "$(TARGET_NAME)";
817817 SKIP_INSTALL = YES;
HutchWidgetExtension/NeedsAttentionWidget.swift +29 −33
@@ -99,37 +99,34 @@ private struct NeedsAttentionWidgetView: View {
9999 }
100100
101101 private func mediumView(snapshot: NeedsAttentionSnapshot) -> some View {
102 VStack(alignment: .leading, spacing: 0) {
103 HStack(alignment: .top, spacing: 12) {
104 Link(destination: HutchDeepLinkURL.home) {
105 metricColumn(
106 count: snapshot.unreadInboxThreads,
107 label: "Unread",
108 systemImage: "tray",
109 tint: unreadTint(for: snapshot.unreadInboxThreads)
110 )
111 }
112 Link(destination: HutchDeepLinkURL.trackers) {
113 metricColumn(
114 count: snapshot.assignedOpenTickets,
115 label: "Assigned",
116 systemImage: "ticket"
117 )
118 }
119 Link(destination: HutchDeepLinkURL.builds) {
120 metricColumn(
121 count: snapshot.failedBuilds,
122 label: "Failed",
123 systemImage: "hammer",
124 tint: failedTint(for: snapshot.failedBuilds)
125 )
126 }
102 HStack(alignment: .center, spacing: 12) {
103 Link(destination: HutchDeepLinkURL.home) {
104 metricColumn(
105 count: snapshot.unreadInboxThreads,
106 label: "Unread",
107 systemImage: "tray",
108 tint: unreadTint(for: snapshot.unreadInboxThreads)
109 )
110 }
111 Link(destination: HutchDeepLinkURL.trackers) {
112 metricColumn(
113 count: snapshot.assignedOpenTickets,
114 label: "Assigned",
115 systemImage: "ticket"
116 )
117 }
118 Link(destination: HutchDeepLinkURL.builds) {
119 metricColumn(
120 count: snapshot.failedBuilds,
121 label: "Failed",
122 systemImage: "hammer",
123 tint: failedTint(for: snapshot.failedBuilds)
124 )
127125 }
128 Spacer(minLength: 0)
129126 }
127 .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
130128 .padding(.horizontal, 16)
131 .padding(.top, 18)
132 .padding(.bottom, 16)
129 .padding(.vertical, 16)
133130 }
134131
135132 private func largeView(snapshot: NeedsAttentionSnapshot) -> some View {
@@ -203,13 +200,12 @@ private struct NeedsAttentionWidgetView: View {
203200 }
204201
205202 private func metricColumn(count: Int?, label: String, systemImage: String, tint: Color = .primary) -> some View {
206 VStack(alignment: .leading, spacing: 8) {
203 VStack(alignment: .center, spacing: 8) {
207204 HStack(alignment: .center, spacing: 10) {
208205 Image(systemName: systemImage)
209206 .font(.title3.weight(.semibold))
210207 .foregroundStyle(tint)
211 .frame(width: 24, alignment: .leading)
212 .padding(.trailing, 4)
208 .frame(width: 24, alignment: .center)
213209 Text(displayCount(count))
214210 .font(.system(size: 28, weight: .semibold, design: .rounded))
215211 .monospacedDigit()
@@ -222,9 +218,9 @@ private struct NeedsAttentionWidgetView: View {
222218 .foregroundStyle(.secondary)
223219 .lineLimit(1)
224220 .minimumScaleFactor(0.85)
225 .frame(height: 16, alignment: .topLeading)
221 .frame(height: 16, alignment: .center)
226222 }
227 .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
223 .frame(maxWidth: .infinity, alignment: .center)
228224 }
229225
230226 private func metricRow(count: Int?, label: String, systemImage: String, tint: Color = .primary) -> some View {