Bug 1402023 - Limit the 'Recent Activity' list in the Library to a maximum of 6 items. r?Gijs draft
authorMike de Boer <mdeboer@mozilla.com>
Thu, 21 Sep 2017 18:25:41 +0200
changeset 668422 a340b85a5bfb32e7f3ae3a73977e0a991e43dfbc
parent 668421 9fc78cd116b922b0a8ddf6ecb3991e2816b61065
child 732696 602cc6ba5a9b820ce3fd97c05cdc7087f15af1e3
push id81038
push usermdeboer@mozilla.com
push dateThu, 21 Sep 2017 16:31:22 +0000
reviewersGijs
bugs1402023
milestone57.0a1
Bug 1402023 - Limit the 'Recent Activity' list in the Library to a maximum of 6 items. r?Gijs MozReview-Commit-ID: AVHRKvAJjWe
browser/components/customizableui/content/panelUI.js
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -527,17 +527,22 @@ const PanelUI = {
     // Since the library is the first view shown, we don't want to add a blocker
     // to the event, which would make PanelMultiView wait to show it.
     let container = this.clearLibraryRecentHighlights();
     if (!this.libraryRecentHighlightsEnabled) {
       this._loadingRecentHighlights = false;
       return;
     }
 
-    let highlights = await NewTabUtils.activityStreamLinks.getHighlights({ withFavicons: true });
+    let highlights = await NewTabUtils.activityStreamLinks.getHighlights({
+      // As per bug 1402023, hard-coded limit, until Activity Stream develops a
+      // richer list.
+      numItems: 6,
+      withFavicons: true
+    });
     // If there's nothing to display, or the panel is already hidden, get out.
     if (!highlights.length || viewNode.panelMultiView.getAttribute("panelopen") != "true") {
       this._loadingRecentHighlights = false;
       return;
     }
 
     container.hidden = container.previousSibling.hidden =
       container.previousSibling.previousSibling.hidden = false;