Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/web/src/page/security/kit/findings-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ export const findingBadge = <M>(h: HtmlBuilder<M>, finding: SecurityAuditFinding
])
: bucketBadge(h, bucketOf(finding))

/** A compact estimated severity for narrow columns; pair it with `unverifiedChip`. */
export const estimatedSeverityBadge = <M>(h: HtmlBuilder<M>, finding: SecurityAuditFinding): Html =>
badge(h, { variant: "outline", className: "border-dashed" }, [BUCKET_LABEL[bucketOf(finding)]])

/** A scored lead's mark: its severity, quieter and labelled, until something proves it. */
export const unverifiedChip = <M>(h: HtmlBuilder<M>): Html =>
h.span(
Expand Down
12 changes: 5 additions & 7 deletions apps/web/src/page/security/tabs/view-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import {
} from "./derive"
import { canRunAudits, Message, type Model } from "./model"
import { bucketOf, countByBucket, isUnverified } from "../kit/findings"
import { findingBadge } from "../kit/findings-view"
import { estimatedSeverityBadge, unverifiedChip } from "../kit/findings-view"
import { auditSteps, emptyOnRamp } from "./view-empty"
import { leadsLine, stopSummaryOf } from "../kit/outcome"
import { emptyMessage } from "@maple/views/ui/empty"
Expand Down Expand Up @@ -281,10 +281,7 @@ const leadCounts = (h: H, findings: ReadonlyArray<SecurityAuditFinding>): Html =
h.Class(cn(hstackClass({ gap: "1.5", inline: true }), ROW_LINK_LIFT)),
h.Title(countTitle(counts[severity], severity, unverified)),
],
[
severityDot(h, severity),
String(counts[severity]),
],
[severityDot(h, severity), String(counts[severity])],
),
),
...(toValidate === 0
Expand Down Expand Up @@ -510,15 +507,15 @@ const findingItem = (h: H, finding: SecurityAuditFinding, repository: string): H
[h.Class("w-16 shrink-0")],
[
isUnverified(finding)
? findingBadge(h, finding)
? estimatedSeverityBadge(h, finding)
: finding.verdict === "needs_validation"
? h.span([h.Class("text-xs text-muted-foreground normal-case")], ["To validate"])
: finding.overallSeverity === null
? ""
: securitySeverityBadge(h, finding.overallSeverity),
],
),
vstack(h, { shrink: true, as: "span" }, [
vstack(h, { shrink: true, grow: true, as: "span" }, [
typography(h, { size: "sm", truncate: true }, [finding.record.title]),
typography(h, { size: "xs", tone: "muted", truncate: true }, [
Arr.join(
Expand All @@ -527,6 +524,7 @@ const findingItem = (h: H, finding: SecurityAuditFinding, repository: string): H
),
]),
]),
...(isUnverified(finding) ? [h.span([h.Class("shrink-0")], [unverifiedChip(h)])] : []),
],
`${finding.targetId}/${finding.fingerprint}`,
)
Expand Down
Loading