Преглед изворни кода

Inset work and education entry cards with explicit constraints

Pin inner stack views with leading/trailing margins inside each entry card
so fields align with the main profile form. Use NSEdgeInsets() instead of
.unavailable .zero for AppKit compatibility.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 пре 3 недеља
родитељ
комит
ed98ab2c3f
1 измењених фајлова са 15 додато и 10 уклоњено
  1. 15 10
      App for Indeed/Views/MyProfilePageView.swift

+ 15 - 10
App for Indeed/Views/MyProfilePageView.swift

@@ -883,6 +883,11 @@ final class MyProfilePageView: NSView {
883 883
 
884 884
 // MARK: - Work experience & education rows
885 885
 
886
+private enum ProfileEntryCardLayout {
887
+    /// Horizontal inset of fields inside each work/education entry card (matches main profile form).
888
+    static let horizontalInset: CGFloat = 28
889
+}
890
+
886 891
 private final class WorkExperienceEntryView: NSView {
887 892
     var onDelete: (() -> Void)?
888 893
 
@@ -981,17 +986,17 @@ private final class WorkExperienceEntryView: NSView {
981 986
         inner.spacing = 16
982 987
         inner.alignment = .leading
983 988
         inner.translatesAutoresizingMaskIntoConstraints = false
984
-        inner.edgeInsets = NSEdgeInsets(top: 16, left: 18, bottom: 16, right: 18)
989
+        inner.edgeInsets = NSEdgeInsets()
985 990
         inner.userInterfaceLayoutDirection = .leftToRight
986 991
         ProfileLayoutEnforcement.applyForcedLTR(to: inner)
987 992
         inner.pinAllArrangedSubviewWidthsEqualToStackWidth()
988 993
 
989 994
         addSubview(inner)
990 995
         NSLayoutConstraint.activate([
991
-            inner.leftAnchor.constraint(equalTo: leftAnchor),
992
-            inner.rightAnchor.constraint(equalTo: rightAnchor),
993
-            inner.topAnchor.constraint(equalTo: topAnchor),
994
-            inner.bottomAnchor.constraint(equalTo: bottomAnchor)
996
+            inner.leadingAnchor.constraint(equalTo: leadingAnchor, constant: ProfileEntryCardLayout.horizontalInset),
997
+            inner.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -ProfileEntryCardLayout.horizontalInset),
998
+            inner.topAnchor.constraint(equalTo: topAnchor, constant: 16),
999
+            inner.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -16)
995 1000
         ])
996 1001
     }
997 1002
 
@@ -1255,17 +1260,17 @@ private final class EducationEntryView: NSView {
1255 1260
         inner.spacing = 14
1256 1261
         inner.alignment = .leading
1257 1262
         inner.translatesAutoresizingMaskIntoConstraints = false
1258
-        inner.edgeInsets = NSEdgeInsets(top: 14, left: 18, bottom: 14, right: 18)
1263
+        inner.edgeInsets = NSEdgeInsets()
1259 1264
         inner.userInterfaceLayoutDirection = .leftToRight
1260 1265
         ProfileLayoutEnforcement.applyForcedLTR(to: inner)
1261 1266
         inner.pinAllArrangedSubviewWidthsEqualToStackWidth()
1262 1267
 
1263 1268
         addSubview(inner)
1264 1269
         NSLayoutConstraint.activate([
1265
-            inner.leftAnchor.constraint(equalTo: leftAnchor),
1266
-            inner.rightAnchor.constraint(equalTo: rightAnchor),
1267
-            inner.topAnchor.constraint(equalTo: topAnchor),
1268
-            inner.bottomAnchor.constraint(equalTo: bottomAnchor)
1270
+            inner.leadingAnchor.constraint(equalTo: leadingAnchor, constant: ProfileEntryCardLayout.horizontalInset),
1271
+            inner.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -ProfileEntryCardLayout.horizontalInset),
1272
+            inner.topAnchor.constraint(equalTo: topAnchor, constant: 14),
1273
+            inner.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -14)
1269 1274
         ])
1270 1275
     }
1271 1276