Move grouped notes into severity tooltip

This commit is contained in:
2026-04-21 13:14:30 +00:00
parent 1fb62f17c8
commit 37e4309524
3 changed files with 16 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
"id": "kosmos-storage-audit", "id": "kosmos-storage-audit",
"title": "Kosmos Storage Audit", "title": "Kosmos Storage Audit",
"description": "Analyzes media references and risky storage locations across Foundry data and public roots.", "description": "Analyzes media references and risky storage locations across Foundry data and public roots.",
"version": "0.0.21", "version": "0.0.22",
"compatibility": { "compatibility": {
"minimum": "13", "minimum": "13",
"verified": "13" "verified": "13"

View File

@@ -394,22 +394,18 @@ function renderGroupedTable(groups, { includeOwner=false, includeReason=false, i
`<th>${localize("KSA.Table.References")}</th>` `<th>${localize("KSA.Table.References")}</th>`
]; ];
if (includeOwner) headers.push(`<th>${localize("KSA.Field.OwnerPackage")}</th>`); if (includeOwner) headers.push(`<th>${localize("KSA.Field.OwnerPackage")}</th>`);
if (includeReason) headers.push(`<th>${localize("KSA.Table.Note")}</th>`);
if (includeSources) headers.push(`<th>${localize("KSA.Field.Source")}</th>`); if (includeSources) headers.push(`<th>${localize("KSA.Field.Source")}</th>`);
const rows = groups.map(group => { const rows = groups.map(group => {
const note = includeReason
? buildGroupedTooltip(group)
: "";
const cells = [ const cells = [
`<td><span class="storage-audit__severity storage-audit__severity--inline severity-${group.severity}">${severityLabel(group.severity)}</span></td>`, `<td><span class="storage-audit__severity storage-audit__severity--inline storage-audit__severity--hint severity-${group.severity}" ${note ? `title="${escapeHtml(note)}"` : ""}>${severityLabel(group.severity)}</span></td>`,
`<td><code>${escapeHtml(group.target)}</code></td>`, `<td><code>${escapeHtml(group.target)}</code></td>`,
`<td>${group.count ?? ""}</td>` `<td>${group.count ?? ""}</td>`
]; ];
if (includeOwner) cells.push(`<td><code>${escapeHtml(group.ownerLabel ?? "")}</code></td>`); if (includeOwner) cells.push(`<td><code>${escapeHtml(group.ownerLabel ?? "")}</code></td>`);
if (includeReason) {
const note = group.targetKind === "wildcard"
? `${group.shortReason ?? group.reason ?? ""} ${localize("KSA.Finding.WildcardNoMatch")}`
: (group.shortReason ?? group.reason ?? "");
cells.push(`<td>${escapeHtml(note.trim())}</td>`);
}
if (includeSources) { if (includeSources) {
cells.push(`<td>${renderGroupedSourcesCell(group.sources ?? [])}</td>`); cells.push(`<td>${renderGroupedSourcesCell(group.sources ?? [])}</td>`);
} }
@@ -424,6 +420,13 @@ function renderGroupedTable(groups, { includeOwner=false, includeReason=false, i
`; `;
} }
function buildGroupedTooltip(group) {
const note = group.targetKind === "wildcard"
? `${group.shortReason ?? group.reason ?? ""} ${localize("KSA.Finding.WildcardNoMatch")}`
: (group.shortReason ?? group.reason ?? "");
return note.trim();
}
function renderGroupedSourcesCell(sources) { function renderGroupedSourcesCell(sources) {
if (!sources.length) return ""; if (!sources.length) return "";
return `<div class="storage-audit__source-list">${sources.map(source => `<div>${source.renderedSource ?? renderPlainSourceLabel(source)}</div>`).join("")}</div>`; return `<div class="storage-audit__source-list">${sources.map(source => `<div>${source.renderedSource ?? renderPlainSourceLabel(source)}</div>`).join("")}</div>`;

View File

@@ -290,6 +290,10 @@
min-width: 0; min-width: 0;
} }
.storage-audit__severity--hint {
cursor: help;
}
.severity-high .storage-audit__severity { .severity-high .storage-audit__severity {
background: color-mix(in srgb, #b03e29 80%, transparent); background: color-mix(in srgb, #b03e29 80%, transparent);
color: white; color: white;