فهرست منبع

Fix Schedule pagination to auto-load meetings in six-card batches.

Made-with: Cursor
huzaifahayat12 3 ماه پیش
والد
کامیت
508e743cb2
1فایلهای تغییر یافته به همراه6 افزوده شده و 8 حذف شده
  1. 6 8
      meetings_app/ViewController.swift

+ 6 - 8
meetings_app/ViewController.swift

@@ -5734,6 +5734,11 @@ private extension ViewController {
         guard nextCount > schedulePageVisibleCount else { return }
         schedulePageVisibleCount = nextCount
         renderSchedulePageCards()
+        // If we're still near the bottom after adding a batch (large viewport),
+        // immediately evaluate again so pagination keeps advancing in chunks of 6.
+        DispatchQueue.main.async { [weak self] in
+            self?.schedulePageScrolled()
+        }
     }
 
     private func schedulePageScrolled() {
@@ -5742,7 +5747,7 @@ private extension ViewController {
         let contentHeight = scroll.documentView?.bounds.height ?? 0
         guard contentHeight > 0 else { return }
         let remaining = contentHeight - (contentBounds.origin.y + contentBounds.height)
-        if remaining < 180 {
+        if remaining <= 200 {
             appendSchedulePageBatchIfNeeded()
         }
     }
@@ -5809,13 +5814,6 @@ private extension ViewController {
             spacer.setContentHuggingPriority(.defaultLow, for: .horizontal)
             pagination.addArrangedSubview(spacer)
 
-            let loadMore = makeSchedulePagePillButton(
-                title: "Load more",
-                action: #selector(schedulePageLoadMorePressed(_:))
-            )
-            loadMore.widthAnchor.constraint(equalToConstant: 118).isActive = true
-            pagination.addArrangedSubview(loadMore)
-
             stack.addArrangedSubview(pagination)
             pagination.widthAnchor.constraint(equalTo: stack.widthAnchor).isActive = true
         }