Procházet zdrojové kódy

Fix AI Companion recordings list top alignment in scroll view

Wrap the list stack in a document container with the same Auto Layout
pattern as Settings: pin document top/leading/trailing/width to the clip
and use bottom >= clip.bottom plus bottom >= stack.bottom so short
content no longer stretches the stack and pins rows to the bottom.

Co-authored-by: Cursor <cursoragent@cursor.com>
huzaifahayat12 před 2 měsíci
rodič
revize
bb383a73c8
1 změnil soubory, kde provedl 18 přidání a 6 odebrání
  1. 18 6
      zoom_app/ViewController.swift

+ 18 - 6
zoom_app/ViewController.swift

@@ -6644,12 +6644,19 @@ class ViewController: NSViewController {
         listClip.drawsBackground = false
         listScroll.contentView = listClip
 
+        // Wrapper document view (same pattern as Settings scroll): without a bottom
+        // `>= clip` chain, a vertical stack as documentView can stretch to the clip height
+        // and leave rows pinned to the bottom.
+        let listDocument = NSView()
+        listDocument.translatesAutoresizingMaskIntoConstraints = false
+
         let listStack = NSStackView()
         listStack.translatesAutoresizingMaskIntoConstraints = false
         listStack.orientation = .vertical
         listStack.alignment = .leading
         listStack.spacing = 10
-        listScroll.documentView = listStack
+        listScroll.documentView = listDocument
+        listDocument.addSubview(listStack)
         container.addSubview(listScroll)
 
         let listEmpty = makeLabel("No recordings yet.", size: 12, color: secondaryText, weight: .regular, centered: true)
@@ -6694,11 +6701,16 @@ class ViewController: NSViewController {
             listScroll.bottomAnchor.constraint(equalTo: container.bottomAnchor, constant: -16),
             listScroll.trailingAnchor.constraint(equalTo: container.trailingAnchor, constant: -16),
 
-            // Pin document view to the clip view without horizontal insets: when the clip is still
-            // width 0 during layout, leading/trailing + width - 16 over-constrains and breaks.
-            listStack.topAnchor.constraint(equalTo: listClip.topAnchor, constant: 8),
-            listStack.leadingAnchor.constraint(equalTo: listClip.leadingAnchor),
-            listStack.trailingAnchor.constraint(equalTo: listClip.trailingAnchor),
+            listDocument.topAnchor.constraint(equalTo: listClip.topAnchor),
+            listDocument.leadingAnchor.constraint(equalTo: listClip.leadingAnchor),
+            listDocument.trailingAnchor.constraint(equalTo: listClip.trailingAnchor),
+            listDocument.widthAnchor.constraint(equalTo: listClip.widthAnchor),
+            listDocument.bottomAnchor.constraint(greaterThanOrEqualTo: listClip.bottomAnchor),
+
+            listStack.topAnchor.constraint(equalTo: listDocument.topAnchor, constant: 8),
+            listStack.leadingAnchor.constraint(equalTo: listDocument.leadingAnchor),
+            listStack.trailingAnchor.constraint(equalTo: listDocument.trailingAnchor),
+            listDocument.bottomAnchor.constraint(greaterThanOrEqualTo: listStack.bottomAnchor, constant: 8),
 
             listEmpty.centerXAnchor.constraint(equalTo: listScroll.centerXAnchor),
             listEmpty.centerYAnchor.constraint(equalTo: listScroll.centerYAnchor),