[perf] cluster-summary2-sk show commit details for xbar.

By default display the commit details if xbar is provided.

Bug: skia:10014
Change-Id: I59780de029cbb837bd99cf7e65fc408268210da1
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/301937
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
diff --git a/perf/modules/cluster-summary2-sk/cluster-summary2-sk.ts b/perf/modules/cluster-summary2-sk/cluster-summary2-sk.ts
index a5add72..8ab7f1d 100644
--- a/perf/modules/cluster-summary2-sk/cluster-summary2-sk.ts
+++ b/perf/modules/cluster-summary2-sk/cluster-summary2-sk.ts
@@ -54,6 +54,7 @@
   Status,
   SkPerfConfig,
   ColumnHeader,
+  CommitDetail,
 } from '../json';
 import { PlotSimpleSkTraceEventDetails } from '../plot-simple-sk/plot-simple-sk';
 import { PlotSimpleSk } from '../plot-simple-sk/plot-simple-sk';
@@ -345,6 +346,20 @@
       if (xbar !== -1) {
         this.graph.xbar = xbar;
       }
+
+      // If step_point is set then display the commit
+      // details for the xbar location.
+      if (step && step.offset > 0) {
+        const commitIDAtXBar = {
+          offset: step.offset,
+        };
+        ClusterSummary2Sk.lookupCids([commitIDAtXBar])
+          .then((json: CommitDetail[]) => {
+            this.commits!.details = json;
+          })
+          .catch(errorMessage);
+      }
+
       // Populate rangelink.
       if (window.sk.perf.commit_range_url !== '') {
         // First find the commit at step_fit, and the next previous commit that has data.