fix(graph): always show context % label on lead ring + fix hex alpha

This commit is contained in:
iliya 2026-03-28 12:36:04 +02:00
parent 36336cbd06
commit 899922da9b

View file

@ -254,7 +254,7 @@ export function drawContextRing(
// Background ring
ctx.beginPath();
ctx.arc(x, y, ringR, 0, Math.PI * 2);
ctx.strokeStyle = COLORS.holoBright + '15';
ctx.strokeStyle = hexWithAlpha(COLORS.holoBright, 0.08);
ctx.lineWidth = CONTEXT_RING.ringWidth;
ctx.stroke();
@ -282,13 +282,11 @@ export function drawContextRing(
ctx.lineWidth = CONTEXT_RING.ringWidth;
ctx.stroke();
// Percentage label
if (usage > CONTEXT_RING.percentLabelThreshold) {
ctx.font = '7px monospace';
ctx.textAlign = 'center';
ctx.fillStyle = ringColor;
ctx.fillText(`${Math.round(usage * 100)}%`, x, y - r - CONTEXT_RING.percentYOffset);
}
// Percentage label — always show for lead
ctx.font = '7px monospace';
ctx.textAlign = 'center';
ctx.fillStyle = ringColor;
ctx.fillText(`${Math.round(usage * 100)}% context`, x, y - r - CONTEXT_RING.percentYOffset);
}
function drawSelectionRing(