From e4f3ea1bc2e083feadcf5a6083a5d7e74e9fc53e Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Mon, 26 Aug 2024 12:32:02 +0200 Subject: 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 --- pkg/cover/templates/heatmap.html | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'pkg/cover/templates') 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}} - {{ range $cov := $child.Coverage }} -
- {{ $cov }}% + {{ range $i, $cov := $child.Coverage }} +
+ {{$cov}}% +
{{ index $child.Tooltips $i }}
{{ end }}
-- cgit mrf-deployment