Bug 1402023 - Limit the 'Recent Activity' list in the Library to a maximum of 6 items. r=Gijs
authorMike de Boer <mdeboer@mozilla.com>
Thu, 21 Sep 2017 18:25:41 +0200
changeset 382227 9bb338b4b503e30c7511d65f9ecd7dfc035b4bc9
parent 382226 f81f645704e4cdfaeebeb21d53d5d749718c3959
child 382228 ae2699e5b050cc2e607bbca597060dc300cac65e
push id32551
push userkwierso@gmail.com
push dateThu, 21 Sep 2017 23:29:53 +0000
treeherdermozilla-central@d6d6fd889f7b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1402023
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;