Q124: the file scan covers the whole file and says what it did and did not check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-08 20:09:03 -04:00
1 parent 91fa6b5f1e
commit 7a9059fbea
9 files changed
+175 -31

No files matched your search

+6 -1
View File
@@ -171,7 +171,12 @@ export const zh: Record<string, string> = {
"Catalog": "目录",
"Check": "检查",
"Choose": "选择",
"Clean": "正常",
"No findings": "未发现问题",
"Partly scanned": "部分扫描",
"Scanned before whole-file checks existed: only its first MiB was checked.": "在全文件检查之前扫描:只检查了前 1 MiB。",
"Contents not inspected": "内容未检查",
"Checked for secrets and the antivirus test string across the whole file; no antivirus engine ran.": "已在整个文件中检查密钥和杀毒测试串;未运行杀毒引擎。",
"Its compressed or encoded contents were not opened.": "其压缩或编码的内容未被打开检查。",
"Close": "关闭",
"Close agent details": "关闭智能体详情",
"Cloud": "云端",
+1 -1
View File
@@ -143,7 +143,7 @@ function FilesFilter({
}) {
const options: ReadonlyArray<{ id: FileScanState | "all"; label: string }> = [
{ id: "all", label: t("All files") },
{ id: FILE_SCAN_STATE.APPROVED, label: t("Clean") },
{ id: FILE_SCAN_STATE.APPROVED, label: t("No findings") },
{ id: FILE_SCAN_STATE.BLOCKED, label: t("Blocked") },
];
return (
@@ -1,6 +1,7 @@
import { Icon, Pill } from "../../shared/ui";
import type { FileObjectRecord } from "../../../../shared/domain";
import { FILE_COLOR_MAP, parseScanLabels } from "./file-helpers";
import { t } from "../../i18n/i18n";
export function FileIcon({ kind, big = false }: { kind: string; big?: boolean }) {
const map = FILE_COLOR_MAP[kind] ?? FILE_COLOR_MAP.doc;
@@ -45,3 +46,19 @@ export function ScanLabelStrip({ file }: { file: FileObjectRecord }) {
</div>
);
}
/** What the scan found, worded for what it checked: secret patterns and the antivirus test string, never a full antivirus pass. */
export function ScanPill({ file }: { file: FileObjectRecord }) {
if (file.scanState !== "approved") return <Pill tone="red">{t("Blocked")}</Pill>;
const labels = parseScanLabels(file);
if (labels.includes("scan:legacy-sample")) {
return <span title={t("Scanned before whole-file checks existed: only its first MiB was checked.")}><Pill tone="amber">{t("Partly scanned")}</Pill></span>;
}
const sealed = labels.includes("scan:contents-not-inspected");
const scope = t("Checked for secrets and the antivirus test string across the whole file; no antivirus engine ran.");
return (
<span title={sealed ? `${scope} ${t("Its compressed or encoded contents were not opened.")}` : scope}>
<Pill tone={sealed ? "amber" : "green"}>{sealed ? t("Contents not inspected") : t("No findings")}</Pill>
</span>
);
}
+3 -3
View File
@@ -1,4 +1,4 @@
import { Avatar, Icon, Pill } from "../../shared/ui";
import { Avatar, Icon } from "../../shared/ui";
import type {
AgentRecord,
EmployeeRecord,
@@ -6,7 +6,7 @@ import type {
FileObjectRecord,
} from "../../../../shared/domain";
import { formatRelative } from "../types";
import { FileIcon, ScanLabelStrip } from "./FileVisuals";
import { FileIcon, ScanLabelStrip, ScanPill } from "./FileVisuals";
import { fileGrantCount, isAgentOwner, resolveOwnerName, shortChecksum, shortObjectRef } from "./file-helpers";
import { t } from "../../i18n/i18n";
@@ -92,7 +92,7 @@ export function PinnedCard({
sha:{shortChecksum(file.sha256)} · obj:{shortObjectRef(file.storagePath)}
</div>
<div className="row" style={{ gap: 6 }}>
<Pill tone={file.scanState === "approved" ? "green" : "red"}>{file.scanState === "approved" ? t("Clean") : t("Blocked")}</Pill>
<ScanPill file={file} />
<span className="mono" style={{ color: "var(--text-3)", fontSize: 12 }}>{grantCount}</span>
</div>
<ScanLabelStrip file={file} />
+2 -2
View File
@@ -7,7 +7,7 @@ import type {
FileObjectRecord,
} from "../../../../shared/domain";
import { formatBytes, formatRelative } from "../types";
import { FileIcon } from "./FileVisuals";
import { FileIcon, ScanPill } from "./FileVisuals";
import { fileGrantCount, isAgentOwner, resolveOwnerName, shortChecksum, shortObjectRef } from "./file-helpers";
import { t } from "../../i18n/i18n";
@@ -89,7 +89,7 @@ function FileRow({
<span style={{ color: "var(--text-2)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{owner}</span>
</div>
<div className="row" style={{ gap: 6, minWidth: 0 }}>
<Pill tone={canOpen ? "green" : "red"}>{canOpen ? t("Clean") : t("Blocked")}</Pill>
<ScanPill file={file} />
<span className="mono" style={{ color: "var(--text-3)", fontSize: 12 }}>{grantCount}</span>
</div>
<div style={{ color: "var(--text-3)", fontSize: 12 }}>{formatRelative(file.updatedAt ?? file.createdAt)}</div>