Explorar o código

Align Ai companion content to the panel's left edge.

Pin Ai companion headers, cards, and empty-state copy to the content stack width so the page starts from the left side of the right panel.

Made-with: Cursor
huzaifahayat12 hai 2 meses
pai
achega
b6c62dde66
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      meetings_app/ViewController.swift

+ 7 - 1
meetings_app/ViewController.swift

@@ -1961,6 +1961,9 @@ private extension ViewController {
         contentStack.addArrangedSubview(subtitle)
         contentStack.setCustomSpacing(14, after: subtitle)
 
+        titleLabel.widthAnchor.constraint(equalTo: contentStack.widthAnchor).isActive = true
+        subtitle.widthAnchor.constraint(equalTo: contentStack.widthAnchor).isActive = true
+
         let endedMeetings = scheduleCachedMeetings
             .filter { $0.endDate < Date() }
             .sorted { $0.endDate > $1.endDate }
@@ -1975,9 +1978,12 @@ private extension ViewController {
             emptyLabel.maximumNumberOfLines = 2
             emptyLabel.lineBreakMode = .byWordWrapping
             contentStack.addArrangedSubview(emptyLabel)
+            emptyLabel.widthAnchor.constraint(equalTo: contentStack.widthAnchor).isActive = true
         } else {
             for meeting in endedMeetings {
-                contentStack.addArrangedSubview(aiCompanionMeetingCard(meeting))
+                let card = aiCompanionMeetingCard(meeting)
+                contentStack.addArrangedSubview(card)
+                card.widthAnchor.constraint(equalTo: contentStack.widthAnchor).isActive = true
             }
         }