Skip to content

Commit af4623e

Browse files
committed
MISC fix tooltips
1 parent cf110dd commit af4623e

2 files changed

Lines changed: 63 additions & 4 deletions

File tree

‎site/css/style.css‎

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,58 @@ body {
255255
}
256256

257257
.status-badge {
258-
cursor: help;
259258
font-size: 0.9rem;
260259
margin-left: 0.3rem;
260+
display: inline-flex;
261+
align-items: center;
262+
gap: 0.15rem;
263+
}
264+
265+
.help-tip {
266+
position: relative;
267+
display: inline-flex;
268+
align-items: center;
269+
cursor: pointer;
270+
}
271+
272+
.help-tip-icon {
273+
display: inline-flex;
274+
align-items: center;
275+
justify-content: center;
276+
width: 14px;
277+
height: 14px;
278+
border-radius: 50%;
279+
background: var(--color-border);
280+
color: var(--color-text-secondary);
281+
font-size: 0.6rem;
282+
font-weight: 700;
283+
line-height: 1;
284+
}
285+
286+
.help-tip-bubble {
287+
display: none;
288+
position: absolute;
289+
bottom: calc(100% + 6px);
290+
left: 50%;
291+
transform: translateX(-50%);
292+
background: var(--color-text);
293+
color: #fff;
294+
font-size: 0.75rem;
295+
font-weight: 400;
296+
line-height: 1.4;
297+
padding: 0.4rem 0.6rem;
298+
border-radius: var(--radius);
299+
white-space: normal;
300+
width: max-content;
301+
max-width: 260px;
302+
z-index: 100;
303+
box-shadow: var(--shadow-md);
304+
pointer-events: none;
305+
}
306+
307+
.help-tip:hover .help-tip-bubble,
308+
.help-tip:focus .help-tip-bubble {
309+
display: block;
261310
}
262311

263312
.completeness-score {

‎site/js/app.js‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,17 +400,26 @@
400400
fetch_error: { icon: "⚠️", label: "Fetch error", description: "This mapping set could not be retrieved from its source URL." },
401401
};
402402

403+
function renderHelpTip(text) {
404+
return '<span class="help-tip" tabindex="0" role="button" aria-label="More info">' +
405+
'<span class="help-tip-icon">?</span>' +
406+
'<span class="help-tip-bubble">' + escapeHtml(text) + '</span>' +
407+
'</span>';
408+
}
409+
403410
function renderStatus(status) {
404411
var info = STATUS_INFO[status || "ok"] || STATUS_INFO["ok"];
405-
return '<span class="status-badge" title="' + escapeHtml(info.label + ": " + info.description) + '">' +
406-
info.icon + '</span>';
412+
return '<span class="status-badge">' +
413+
info.icon +
414+
renderHelpTip(info.label + ": " + info.description) +
415+
'</span>';
407416
}
408417

409418
function renderFairScore(score) {
410419
if (score == null) return "";
411420
var pct = Math.round(score * 100);
412421
var color = pct >= 70 ? "#059669" : pct >= 40 ? "#d97706" : "#dc2626";
413-
return '<span class="completeness-score" title="Metadata completeness: ' + pct + '% — indicates how rich the metadata provided by the source is"' +
422+
return '<span class="completeness-score"' +
414423
' style="--score-color: ' + color + '">' +
415424
'<svg class="completeness-ring" viewBox="0 0 36 36">' +
416425
'<circle cx="18" cy="18" r="15.9" fill="none" stroke="#e5e7eb" stroke-width="3"/>' +
@@ -419,6 +428,7 @@
419428
' stroke-dashoffset="25" stroke-linecap="round"/>' +
420429
'</svg>' +
421430
'<span class="completeness-pct">' + pct + '%</span>' +
431+
renderHelpTip("Metadata completeness: " + pct + "%. Indicates how rich the metadata provided by the source is.") +
422432
'</span>';
423433
}
424434

0 commit comments

Comments
 (0)