feat(project): compact links and add file icons

This commit is contained in:
2026-10-04 13:17:22 +09:00
parent e2fc14a584
commit ed7da57066
5 changed files with 136 additions and 43 deletions
+25 -14
View File
@@ -731,16 +731,14 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
margin: 0 -22px 0 -8px; padding: 0 22px 0 8px;
}
.pj-task-modal-card .pj-modal-actions { flex: none; }
/* 위에서 아래로 쭉 쌓는 단일 칼럼 — 메타 → 설명 → 하위업무 →
(첨부파일|연결된 프로젝트 2열) → 댓글(팝업 너비 전체) 순서. 각 구간은
/* 위에서 아래로 쭉 쌓는 단일 칼럼 — 메타(프로젝트 연결 포함) → 설명 → 하위업무 →
첨부파일 → 댓글(팝업 너비 전체) 순서. 각 구간은
.pj-task-extra 의 위쪽 구분선으로 나뉘고, 넘치는 부분은 이 전체가 세로로
스크롤한다. */
.pj-modal-body { display: flex; flex-direction: column; overflow-y: auto; }
.pj-desc-block { min-width: 0; padding-top: 10px; margin-top: 14px; border-top: 1px solid #eef0f2; }
.pj-subtask-full { min-width: 0; }
/* 첨부파일 | 연결된 프로젝트 — 나란히 2열. */
.pj-side-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.pj-side-2col .pj-task-extra { min-width: 0; }
#pj-attach-block { min-width: 0; }
/* 댓글 — 팝업 너비 전체, 목록 자체는 더 이상 안에서 스크롤하지 않고
팝업 전체(.pj-modal-body)와 같이 늘어난다. */
.pj-comment-full .pj-comment-list { max-height: none; overflow-y: visible; }
@@ -763,7 +761,6 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-comment-dock .pj-comment-form textarea { border: none !important; box-shadow: none !important; padding: 8px 8px; font-size: 14px; outline: none; background: transparent; }
@media (max-width: 720px) {
.pj-task-modal-card { width: 100vw; max-width: 100vw; min-width: 0; }
.pj-side-2col { display: block; }
}
.pj-modal-card h3 { margin: 0 0 16px; font-size: var(--pj-heading-size); line-height: var(--pj-heading-leading); font-weight: 500; letter-spacing: normal; }
.pj-modal-hint { margin: -6px 0 14px; font-size: 12px; color: #6b7280; }
@@ -942,9 +939,17 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
.pj-attach-list, .pj-comment-list { list-style: none; margin: 0 0 6px; padding: 0; max-height: 160px; overflow-y: auto; }
.pj-attach-item { display: flex; align-items: center; gap: 8px; padding: 5px 4px; font-size: 13px; }
.pj-attach-item a { color: #2b4a85; text-decoration: none; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-attach-item a { display: flex; align-items: center; gap: 8px; min-width: 0; color: #2b4a85; text-decoration: none; flex: 1; }
.pj-attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-attach-icon { flex: none; font-size: 22px; color: #6b7280; }
.pj-attach-icon.is-image { color: #7c5ce0; }
.pj-attach-icon.is-excel { color: #21834d; }
.pj-attach-icon.is-text { color: #64748b; }
.pj-attach-icon.is-ppt { color: #c85a29; }
.pj-attach-icon.is-document { color: #356ac3; }
.pj-attach-icon.is-pdf { color: #c43c3c; }
.pj-attach-item a:hover { text-decoration: underline; }
.pj-attach-size { font-size: 11px; color: #9aa1a9; }
.pj-attach-size { flex: none; font-size: 11px; color: #9aa1a9; }
.pj-comment-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 2px; }
.pj-comment-main { flex: 1; }
@@ -1428,21 +1433,27 @@ label.pj-desc-fmtbtn {
}
/* ── 연결된 프로젝트(멀티호밍) 칩 ── */
.pj-link-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pj-projects-row { gap: 8px; padding: 4px 0; flex-wrap: nowrap; overflow-x: auto; }
.pj-projects-row[hidden] { display: none; }
.pj-projects-label { display: inline-flex; align-items: center; gap: 4px; }
.pj-link-chips { display: flex; flex: 0 1 auto; min-width: 32px; max-width: 25%; gap: 6px; overflow-x: auto; }
.pj-link-chips .pj-empty-sm { padding: 0 2px; white-space: nowrap; }
.pj-projects-row.is-readonly .pj-link-chips { max-width: none; flex: 1; }
.pj-link-chip {
display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
display: inline-flex; flex: none; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap;
padding: 3px 6px 3px 10px; border-radius: 999px; background: #eef0f2; color: #333;
}
.pj-link-chip .pj-link-del { border: none; background: transparent; cursor: pointer; color: #9aa1a9; font-size: 13px; line-height: 1; padding: 2px; }
.pj-link-chip .pj-link-del:hover { color: #c22b10; }
/* 세로로 쌓기 — 옆 칼럼이 좁아 가로 배치면 select 글자가 잘린다. */
.pj-link-form { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
/* 좁은 패널에서도 한 줄을 유지하며 프로젝트 줄 안에서만 가로 스크롤. */
.pj-link-form { display: flex; flex: 1; min-width: 360px; gap: 6px; align-items: center; }
.pj-link-form[hidden] { display: none; }
.pj-link-form select {
width: 100% !important; flex: none; margin: 0 !important;
width: 0 !important; min-width: 90px; flex: 1; margin: 0 !important;
padding: 6px 8px !important; border: 1px solid #d8dce2 !important; border-radius: 8px;
font-size: 11.5px !important; font-family: inherit; box-sizing: border-box;
}
.pj-link-form .pj-btn { align-self: flex-end; }
.pj-link-form .pj-btn { flex: none; padding: 6px 8px; font-size: 11.5px; white-space: nowrap; }
/* ── 알림센터 ── */
.pj-inbox { list-style: none; margin: 0; padding: 0; }
+31 -1
View File
@@ -6567,6 +6567,34 @@
});
// ── 첨부파일 ──
function attachmentIconHtml(a) {
const suffix = String(a.filename || "").trim().toLowerCase().match(/\.([^.]+)$/);
const ext = suffix ? suffix[1] : "";
const mime = String(a.content_type || "").split(";")[0].trim().toLowerCase();
// 확장자를 먼저 확인 — CSV/마크다운처럼 MIME 이 일반 text 인 파일도 구분한다.
let kind;
if (/^(png|jpe?g|gif|webp|bmp|svg|tiff?|ico|heic|heif|avif)$/.test(ext)) kind = "image";
else if (/^(xlsx?|xlsm|xlsb|xltx?|xltm|csv|ods)$/.test(ext)) kind = "excel";
else if (/^(pptx?|pptm|ppsx?|ppsm|potx?|potm|odp)$/.test(ext)) kind = "ppt";
else if (/^(docx?|docm|dotx?|dotm|hwp|hwpx|odt|rtf)$/.test(ext)) kind = "document";
else if (ext === "pdf") kind = "pdf";
else if (/^(txt|text|md|markdown|log|json|xml|ya?ml|ini|conf)$/.test(ext)) kind = "text";
else if (mime.startsWith("image/")) kind = "image";
else if (/excel|spreadsheet|opendocument.spreadsheet|csv/.test(mime)) kind = "excel";
else if (/powerpoint|presentation/.test(mime)) kind = "ppt";
else if (/msword|wordprocessing|opendocument.text|hwp|rtf/.test(mime)) kind = "document";
else if (mime === "application/pdf") kind = "pdf";
else if (mime.startsWith("text/") || /json|xml/.test(mime)) kind = "text";
else kind = "file";
const types = {
image: ["image", "이미지 파일"], excel: ["table_chart", "엑셀 파일"],
text: ["article", "텍스트 파일"], ppt: ["slideshow", "PPT 파일"],
document: ["description", "문서 파일"], pdf: ["picture_as_pdf", "PDF 파일"],
file: ["draft", "파일"],
};
return '<span class="material-symbols-outlined pj-attach-icon is-' + kind +
'" role="img" aria-label="' + types[kind][1] + '" title="' + types[kind][1] + '">' + types[kind][0] + '</span>';
}
function fmtSize(n) {
if (n < 1024) return n + " B";
if (n < 1048576) return (n / 1024).toFixed(1) + " KB";
@@ -6586,7 +6614,8 @@
li.className = "pj-attach-item";
// 댓글에 붙은 파일은 "댓글" 표시 — 아래 댓글 목록에도 같은 파일이 보인다(같은 파일임을 알 수 있게).
li.innerHTML =
'<a href="/project/api/attachments/' + a.id + '/download">' + escapeHtml(a.filename) + "</a>" +
'<a href="/project/api/attachments/' + a.id + '/download">' + attachmentIconHtml(a) +
'<span class="pj-attach-name">' + escapeHtml(a.filename) + "</span></a>" +
(a.comment_id != null ? '<span class="pj-attach-from-comment" title="댓글에 첨부한 파일">댓글</span>' : "") +
'<span class="pj-attach-size">' + fmtSize(a.size_bytes) + "</span>" +
(canManage && !taskReadOnly ? '<button type="button" class="pj-icon-btn pj-attach-del" data-id="' + a.id + '">×</button>' : "");
@@ -7937,6 +7966,7 @@
ctxSeq++;
taskId = opts.taskId; homeProjectId = opts.projectId; onChange = opts.onChange || null;
readOnly = !!opts.readOnly;
el("pj-links-block").classList.toggle("is-readonly", readOnly);
if (linkForm) linkForm.hidden = readOnly;
if (!readOnly) loadProjects();
},