diff options
| author | Taras Madan <tarasmadan@google.com> | 2024-08-26 12:32:02 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2024-08-27 15:12:58 +0000 |
| commit | e4f3ea1bc2e083feadcf5a6083a5d7e74e9fc53e (patch) | |
| tree | d9efa4202bea3cee892525837201d188c782179c /pkg/cover/templates | |
| parent | 5fc2677b4aeffac87aef5092b99ca41ccefa57fa (diff) | |
pkg/covermerger: add tooltips to every coverage number
Hover mouse onto the percent value to see details.
To test:
$ go run ./tools/syz-cover -heatmap upstream -from 2024-08-23 -to 2024-08-23
$ google-chrome upstream.html
Diffstat (limited to 'pkg/cover/templates')
| -rw-r--r-- | pkg/cover/templates/heatmap.html | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/pkg/cover/templates/heatmap.html b/pkg/cover/templates/heatmap.html index ba39b00f5..622a27636 100644 --- a/pkg/cover/templates/heatmap.html +++ b/pkg/cover/templates/heatmap.html @@ -91,6 +91,25 @@ .data_row:hover { background-color: #ffff99 !important; } + .cover_percent { + position: relative; + display: inline-block; + } + .cover_percent .tooltiptext { + visibility: hidden; + background-color: black; + color: #fff; + text-align: left; + border-radius: 6px; + padding: 5px 0; + + /* Position the tooltip */ + position: absolute; + z-index: 1; + } + .cover_percent:hover .tooltiptext { + visibility: visible; + } {{ end }} {{ define "body" }} @@ -137,9 +156,10 @@ {{$child.Name}} </div> </div> - {{ range $cov := $child.Coverage }} - <div class="date_column"> - {{ $cov }}% + {{ range $i, $cov := $child.Coverage }} + <div class="date_column cover_percent"> + {{$cov}}% + <pre class="tooltiptext">{{ index $child.Tooltips $i }}</pre> </div> {{ end }} <div class="instrumented_column"> |
