" : ""));
if (tot) {
+ // #2929: percentages mirror the top-of-page basis — share of TOTAL
+ // INPUT (same denominator as the cache-hit % above). The
+ // unattributed tile's chips instead show their share of that
+ // bucket's parent total — "what eats the 2.6M" is the useful split.
+ const inp = Number(tot.input) || 0;
+ const parentU = Number(tot.ttlRepay) || 0;
+ const pc = (x) => (x >= 10 ? x.toFixed(0) : x.toFixed(1)) + "%";
+ const pctIn = (v) => (+v > 0 && inp > 0) ? '
" : "";
+ const pctU = (v) => (parentU > 0 && +v > 0) ? " (" + pc((+v / parentU) * 100) + ")" : "";
parts.push('
');
- mini(parts, t("det.ce_new"), fmtW(tot.newContent || 0));
- mini(parts, t("det.ce_comp"), fmtW(tot.compRepay || 0), false, (tot.compRepay || 0) > 0 ? t("det.ce_comp_hint") : "");
+ mini(parts, t("det.ce_new"), fmtW(tot.newContent || 0) + pctIn(tot.newContent || 0));
+ mini(parts, t("det.ce_comp"), fmtW(tot.compRepay || 0) + pctIn(tot.compRepay || 0), false, (tot.compRepay || 0) > 0 ? t("det.ce_comp_hint") : "");
// #2929: the unattributed bucket shows its own composition INSIDE the
// tile (label · value · then the parts, top to bottom) — containment
// rendered as layout, not as a caption floating beside the tiles.
- const plainUnattrib = () => '
' + t("det.ce_ttl") + '
' + fmtW(tot.ttlRepay || 0) + "
";
+ const plainUnattrib = () => '
' + t("det.ce_ttl") + '
' + fmtW(tot.ttlRepay || 0) + pctIn(tot.ttlRepay || 0) + "
";
if (seam && (seam.missed > 0 || seam.providerTtl.count > 0 || seam.providerSide.count > 0 || seam.rewinds.count > 0)) {
var uChips = [];
- if (seam.missed > 0 || seam.suspects > 0) uChips.push('
' + t("det.attr_seam") + " " + fmtW(seam.missed) + (seam.suspects > 0 ? " ×" + seam.suspects : "") + "");
- if (seam.providerTtl.missed > 0 || seam.providerTtl.count > 0) uChips.push('
' + t("det.attr_ttl") + " " + fmtW(seam.providerTtl.missed) + (seam.providerTtl.count > 0 ? " ×" + seam.providerTtl.count : "") + "");
- if (seam.providerSide.missed > 0 || seam.providerSide.count > 0) uChips.push('
' + t("det.attr_provider") + " " + fmtW(seam.providerSide.missed) + (seam.providerSide.count > 0 ? " ×" + seam.providerSide.count : "") + "");
- if (seam.rewinds.missed > 0 || seam.rewinds.count > 0) uChips.push('
' + t("det.attr_rewind") + " " + fmtW(seam.rewinds.missed) + (seam.rewinds.count > 0 ? " ×" + seam.rewinds.count : "") + "");
+ if (seam.missed > 0 || seam.suspects > 0) uChips.push('
' + t("det.attr_seam") + " " + fmtW(seam.missed) + (seam.suspects > 0 ? " ×" + seam.suspects : "") + pctU(seam.missed) + "");
+ if (seam.providerTtl.missed > 0 || seam.providerTtl.count > 0) uChips.push('
' + t("det.attr_ttl") + " " + fmtW(seam.providerTtl.missed) + (seam.providerTtl.count > 0 ? " ×" + seam.providerTtl.count : "") + pctU(seam.providerTtl.missed) + "");
+ if (seam.providerSide.missed > 0 || seam.providerSide.count > 0) uChips.push('
' + t("det.attr_provider") + " " + fmtW(seam.providerSide.missed) + (seam.providerSide.count > 0 ? " ×" + seam.providerSide.count : "") + pctU(seam.providerSide.missed) + "");
+ if (seam.rewinds.missed > 0 || seam.rewinds.count > 0) uChips.push('
' + t("det.attr_rewind") + " " + fmtW(seam.rewinds.missed) + (seam.rewinds.count > 0 ? " ×" + seam.rewinds.count : "") + pctU(seam.rewinds.missed) + "");
if (seam.abortCorrelated > 0) uChips.push('
' + t("det.attr_abort") + " ×" + seam.abortCorrelated + "");
var uRest = Math.max(0, (tot.ttlRepay || 0) - seam.missed - seam.providerTtl.missed - seam.providerSide.missed - seam.rewinds.missed);
- if (uRest > 8192) uChips.push('
' + t("det.attr_rest", { x: fmtW(uRest) }) + "");
+ if (uRest > 8192) uChips.push('
' + t("det.attr_rest", { x: fmtW(uRest) }) + pctU(uRest) + "");
if (uChips.length) {
- parts.push('
' + t("det.ce_ttl") + '
' + fmtW(tot.ttlRepay || 0) + '
'
+ parts.push('
' + t("det.ce_ttl") + '
' + fmtW(tot.ttlRepay || 0) + pctIn(tot.ttlRepay || 0) + '
'
+ '
' + escapeHtml(t("det.ce_breakdown")) + "
" + uChips.join("
") + "
");
} else {
parts.push(plainUnattrib());
@@ -1388,7 +1397,7 @@ export const WEB_CLIENT = `(function () {
} else {
parts.push(plainUnattrib());
}
- mini(parts, t("det.ce_residual"), fmtW(tot.residual || 0));
+ mini(parts, t("det.ce_residual"), fmtW(tot.residual || 0) + pctIn(tot.residual || 0));
parts.push("
");
}
const folds = ledger.folds || [];