Refine BIM comment modal controls

This commit is contained in:
CODEX
2026-06-20 17:40:15 +03:00
parent d70f6e0886
commit 405113fa4f
4 changed files with 256 additions and 67 deletions
+10 -4
View File
@@ -1606,14 +1606,20 @@ const sanitizeCommentSubitems = (value) => {
if (!item || typeof item !== "object") {
return [];
}
const title = sanitizeCommentText(item.title ?? item.text ?? item.name, 300);
if (!title) {
const kind = item.kind === "text" ? "text" : "checker";
const rawContent = kind === "text"
? (item.body ?? item.title ?? item.text ?? item.name)
: (item.title ?? item.text ?? item.name ?? item.body);
const content = sanitizeCommentText(rawContent, kind === "text" ? 4000 : 300);
if (!content) {
return [];
}
return [{
id: stringOrNull(item.id) || `sub_${randomBase64Url(8)}`,
title,
done: item.done === true,
kind,
title: content,
body: kind === "text" ? content : "",
done: kind === "checker" && item.done === true,
createdAt: stringOrNull(item.createdAt) || nowIso()
}];
});