Refine BIM comment modal constraints

This commit is contained in:
CODEX
2026-06-20 23:34:41 +03:00
parent eee3eecde3
commit 4be23070a1
3 changed files with 25 additions and 13 deletions
+11 -10
View File
@@ -553,6 +553,13 @@ const setCommentModalError = (message = "") => {
commentModalError.hidden = !text;
};
const setCommentModalSubtitle = (text = "") => {
if (!commentModalSubtitle) return;
const value = String(text || "").trim();
commentModalSubtitle.textContent = value;
commentModalSubtitle.hidden = !value;
};
const bringFloatingWindowToFront = (id) => {
if (!id) return;
floatingWindowOrder = [...floatingWindowOrder.filter((item) => item !== id), id];
@@ -1233,9 +1240,7 @@ const openCommentModalForTarget = () => {
commentTitleInput && (commentTitleInput.value = "");
commentBodyInput && (commentBodyInput.value = "");
commentReplyInput && (commentReplyInput.value = "");
if (commentModalSubtitle) {
commentModalSubtitle.textContent = "BIM-COMMENT";
}
setCommentModalSubtitle();
if (commentModalEditedMeta) {
const [x, y, z] = commentContextTarget.worldPos || [];
commentModalEditedMeta.textContent = Number.isFinite(x)
@@ -1263,9 +1268,7 @@ const openCommentModalForComment = (commentId) => {
commentTitleInput && (commentTitleInput.value = comment.title || "");
commentBodyInput && (commentBodyInput.value = comment.body || "");
commentReplyInput && (commentReplyInput.value = "");
if (commentModalSubtitle) {
commentModalSubtitle.textContent = comment.id || "BIM-COMMENT";
}
setCommentModalSubtitle();
if (commentModalEditedMeta) {
commentModalEditedMeta.textContent = `Последнее редактирование: ${formatDateTime(comment.updatedAt || comment.createdAt)}`;
}
@@ -1344,9 +1347,7 @@ const syncCommentModalAfterSave = (comment) => {
commentDraftSubitems = Array.isArray(comment.subitems)
? comment.subitems.map((item) => ({ ...item }))
: [];
if (commentModalSubtitle) {
commentModalSubtitle.textContent = comment.id || "BIM-COMMENT";
}
setCommentModalSubtitle();
if (commentModalEditedMeta) {
commentModalEditedMeta.textContent = `Последнее редактирование: ${formatDateTime(comment.updatedAt || comment.createdAt)}`;
}
@@ -5658,7 +5659,7 @@ const loadProjectSnapshot = async (project) => {
registerFloatingWindowElement("commentModal", commentModal);
setupDraggableFixedWindow(commentsPanel, commentsPanelHeader);
setupDraggableFixedWindow(commentModal, commentModalHeader);
setupResizableFixedWindow(commentModal, { minWidth: 560, minHeight: 420 });
setupResizableFixedWindow(commentModal, { minWidth: 660, minHeight: 420 });
commentsCollapseButton?.addEventListener("click", () => setCommentsCollapsed(true));
commentsRestoreButton?.addEventListener("click", () => {
commentsModeActive = true;