fix(charts): address review — glide opt-in, no shadowed var, truncate cap

- The 80ms left/top transition moved out of .chart-tooltip: it eased the
  snap-positioned goal tooltip but made cursor-following tooltips
  (sankey, time-series) trail the pointer by a frame. Goal projection
  opts back in via inline style; the component comment documents the
  split.
- setRelation reuses _draw()'s targetAmount const instead of declaring
  a local 'target' that shadowed the target-date const.
- Sankey context line gets max-w-64 so truncate has a constraint to
  fire against on deep flows.
- Component comment now says 10x12 padding, matching the declaration.
This commit is contained in:
Guillem Arias
2026-06-05 10:50:43 +02:00
parent 6491787012
commit 712dda7fa3
4 changed files with 33 additions and 25 deletions

View File

@@ -550,7 +550,9 @@ export default class extends Controller {
// what's hovered. No color swatch — the hover highlight on the diagram
// itself already says which ribbon the card belongs to.
#tooltipContext(label) {
return `<div class="text-xs text-secondary mb-1 truncate">${label}</div>`;
// max-w-64 gives truncate a constraint to fire against — an absolute
// tooltip otherwise grows to fit and never ellipsizes deep flows.
return `<div class="max-w-64 text-xs text-secondary mb-1 truncate">${label}</div>`;
}
#showTooltip(event, value, percentage, contextHtml = null) {