[results feed] Add link to test history on try results

Fetch more history, in bigger chunks, for a single test view

Change-Id: I6fee25865da2c3480a4a38b2c9a10b8dc8381903
Reviewed-on: https://dart-review.googlesource.com/c/dart_ci/+/159901
Reviewed-by: Alexander Thomas <athom@google.com>
diff --git a/results_feed/lib/src/components/app_component.dart b/results_feed/lib/src/components/app_component.dart
index efc4c1a..804e9ed 100644
--- a/results_feed/lib/src/components/app_component.dart
+++ b/results_feed/lib/src/components/app_component.dart
@@ -21,6 +21,11 @@
 import '../services/firestore_service.dart';
 import '../services/build_service.dart';
 
+const historyInitialRange = Duration(days: 21);
+const historyInitialRangeSingleTest = Duration(days: 180);
+const commitFetchSize = 100;
+const commitFetchSizeSingleText = 1000;
+
 @Component(
     selector: 'results-feed',
     pipes: [commonPipes],
@@ -96,8 +101,8 @@
     if (commits.isNotEmpty) {
       fetchDate = commits.values.last.created;
       final initialRange = filterService.filter.singleTest == null
-          ? Duration(days: 21)
-          : Duration(days: 60);
+          ? historyInitialRange
+          : historyInitialRangeSingleTest;
       infiniteScrollEnabled =
           fetchDate.isAfter(DateTime.now().subtract(initialRange));
     }
@@ -124,7 +129,9 @@
       }();
 
   Future<IntRange> fetchEarlierCommits(int before) async {
-    final fetchAmount = filterService.filter.singleTest == null ? 100 : 500;
+    final fetchAmount = filterService.filter.singleTest == null
+        ? commitFetchSize
+        : commitFetchSizeSingleText;
     final newCommits =
         (await _firestoreService.fetchCommits(before, fetchAmount))
             .map((x) => Commit.fromDocument(x));
diff --git a/results_feed/lib/src/components/results_panel.html b/results_feed/lib/src/components/results_panel.html
index 1c16849..65b82f6 100644
--- a/results_feed/lib/src/components/results_panel.html
+++ b/results_feed/lib/src/components/results_panel.html
@@ -49,12 +49,18 @@
           [for]="logs"
           [preferredPositions]="preferredTooltipPositions">
         <div *deferredContent>
-          <h4>Logs</h4>
+          <h4>{{change.name}}</h4>
           <div *ngFor="let configuration of change.configurations.configurations">
+            {{configuration}}
+            <a
+                href="https://dart-ci.firebaseapp.com/#showLatestFailures=false&test={{change.name}}&configurations={{configuration}}"
+                target="_blank">
+              history
+            </a>
             <a *ngIf="buildbucketID(change.patchset, configuration) != null"
                target="_blank"
                href="https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/{{buildbucketID(change.patchset, configuration)}}/+/steps/test_results/0/logs/new_test_failures__logs_/0">
-              {{configuration}}
+              log
             </a>
           </div>
         </div>
diff --git a/results_feed/lib/src/components/results_selector_panel.html b/results_feed/lib/src/components/results_selector_panel.html
index 611e83a..0c07656 100644
--- a/results_feed/lib/src/components/results_selector_panel.html
+++ b/results_feed/lib/src/components/results_selector_panel.html
@@ -70,12 +70,18 @@
           [for]="logs"
           [preferredPositions]="preferredTooltipPositions">
         <div *deferredContent>
-          <h4>Logs</h4>
+          <h4>{{change.name}}</h4>
           <div *ngFor="let configuration of change.configurations.configurations">
+            {{configuration}}
+            <a
+                href="https://dart-ci.firebaseapp.com/#showLatestFailures=false&test={{change.name}}&configurations={{configuration}}"
+                target="_blank">
+              history
+            </a>
             <a *ngIf="buildbucketID(change.patchset, configuration) != null"
                target="_blank"
                href="https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/{{buildbucketID(change.patchset, configuration)}}/+/steps/test_results/0/logs/new_test_failures__logs_/0">
-              {{configuration}}
+              log
             </a>
           </div>
         </div>