Parcourir la source

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 il y a 2 mois
Parent
commit
ed98ab2c3f
1 fichiers modifiés avec 15 ajouts et 10 suppressions
  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 {
 
 // MARK: - Work experience & education rows
 
+private enum ProfileEntryCardLayout {
+    /// Horizontal inset of fields inside each work/education entry card (matches main profile form).
+    static let horizontalInset: CGFloat = 28
+}
+
 private final class WorkExperienceEntryView: NSView {
     var onDelete: (() -> Void)?
 
@@ -981,17 +986,17 @@ private final class WorkExperienceEntryView: NSView {
         inner.spacing = 16
         inner.alignment = .leading
         inner.translatesAutoresizingMaskIntoConstraints = false
-        inner.edgeInsets = NSEdgeInsets(top: 16, left: 18, bottom: 16, right: 18)
+        inner.edgeInsets = NSEdgeInsets()
         inner.userInterfaceLayoutDirection = .leftToRight
         ProfileLayoutEnforcement.applyForcedLTR(to: inner)
         inner.pinAllArrangedSubviewWidthsEqualToStackWidth()
 
         addSubview(inner)
         NSLayoutConstraint.activate([
-            inner.leftAnchor.constraint(equalTo: leftAnchor),
-            inner.rightAnchor.constraint(equalTo: rightAnchor),
-            inner.topAnchor.constraint(equalTo: topAnchor),
-            inner.bottomAnchor.constraint(equalTo: bottomAnchor)
+            inner.leadingAnchor.constraint(equalTo: leadingAnchor, constant: ProfileEntryCardLayout.horizontalInset),
+            inner.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -ProfileEntryCardLayout.horizontalInset),
+            inner.topAnchor.constraint(equalTo: topAnchor, constant: 16),
+            inner.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -16)
         ])
     }
 
@@ -1255,17 +1260,17 @@ private final class EducationEntryView: NSView {
         inner.spacing = 14
         inner.alignment = .leading
         inner.translatesAutoresizingMaskIntoConstraints = false
-        inner.edgeInsets = NSEdgeInsets(top: 14, left: 18, bottom: 14, right: 18)
+        inner.edgeInsets = NSEdgeInsets()
         inner.userInterfaceLayoutDirection = .leftToRight
         ProfileLayoutEnforcement.applyForcedLTR(to: inner)
         inner.pinAllArrangedSubviewWidthsEqualToStackWidth()
 
         addSubview(inner)
         NSLayoutConstraint.activate([
-            inner.leftAnchor.constraint(equalTo: leftAnchor),
-            inner.rightAnchor.constraint(equalTo: rightAnchor),
-            inner.topAnchor.constraint(equalTo: topAnchor),
-            inner.bottomAnchor.constraint(equalTo: bottomAnchor)
+            inner.leadingAnchor.constraint(equalTo: leadingAnchor, constant: ProfileEntryCardLayout.horizontalInset),
+            inner.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -ProfileEntryCardLayout.horizontalInset),
+            inner.topAnchor.constraint(equalTo: topAnchor, constant: 14),
+            inner.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -14)
         ])
     }