feat(project): 업무 편집을 아사나식 오른쪽 슬라이드 패널로 전환

- 제목을 "[프로젝트/세션]의 업무 편집" 형식으로 바꾸고 버튼 줄 가운데에 배치
- 담당자·세션·우선순위·마감일을 한 줄에 나열
- 중앙 모달 대신 화면 오른쪽에서 슬라이드로 열고 닫히는 전체 높이 패널로
  전환(배경 클릭/Esc/저장/삭제 등 모든 닫기 경로 애니메이션 통일)
- 왼쪽 모서리 드래그로 패널 너비 조절(최소 420px, 최대 화면 절반, 마지막
  너비는 localStorage 에 기억)
- 더 이상 쓰지 않는 "새 업무 소형 고정" 관련 CSS/JS 정리

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-22 16:59:03 +09:00
parent 6795265c9a
commit 1e7f328011
5 changed files with 121 additions and 44 deletions
+33 -19
View File
@@ -404,13 +404,28 @@
.pj-modal { position: fixed; inset: 0; background: rgba(20,22,26,.46); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.pj-modal[hidden] { display: none; }
.pj-modal-card { background: #fff; border-radius: 16px; padding: 22px; width: min(480px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: 90vh; overflow-y: auto; }
/* 업무 편집 팝업만 고정 크기(800x1100). 카드 자체는 겉으로 스크롤 없이
고정하고, 그 안의 .pj-modal-body 하나가 전체 스크롤 컨테이너다(아래로
늘어나는 하위 업무·댓글 포함 모든 섹션을 한 번에 스크롤). */
/* 업무 편집/새 업무 — 아사나처럼 화면 오른쪽에서 슬라이드로 열리는 전체
높이 패널(중앙 카드가 아니다). 오버레이는 옅게 깔고, 패널은 오른쪽에
붙여 연 상태(.pj-panel-open, JS 가 reflow 뒤에 붙인다)에서 transform 이
0 으로 슬라이드된다. 왼쪽 모서리(.pj-task-panel-resizer)를 드래그해
너비를 바꾼다(최소 420px, 최대 화면 절반 — CSS max-width + JS 클램프). */
#pj-modal-task { justify-content: flex-end; align-items: stretch; background: rgba(20,22,26,.32); }
.pj-task-modal-card {
width: 800px; max-width: 96vw; height: 1100px; max-height: 94vh;
display: flex; flex-direction: column; overflow: hidden;
width: 640px; max-width: 50vw; min-width: 420px;
height: 100vh; max-height: 100vh;
border-radius: 0; box-shadow: -14px 0 36px rgba(0,0,0,.2);
display: flex; flex-direction: column; overflow: hidden; position: relative;
transform: translateX(100%);
transition: transform .28s cubic-bezier(.22,.8,.24,1);
}
#pj-modal-task.pj-panel-open .pj-task-modal-card { transform: translateX(0); }
.pj-task-panel-resizer {
position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
cursor: col-resize; z-index: 6; background: transparent;
}
.pj-task-panel-resizer:hover, .pj-task-panel-resizer.is-dragging { background: var(--pj-accent-tint); }
.pj-task-modal-card > .pj-t-title-input { flex: none; }
.pj-task-modal-card .pj-modal-body { flex: 1 1 auto; min-height: 0; }
.pj-task-modal-card .pj-modal-actions { flex: none; }
@@ -428,23 +443,22 @@
팝업 전체(.pj-modal-body)와 같이 늘어난다. */
.pj-comment-full .pj-comment-list { max-height: none; overflow-y: visible; }
@media (max-width: 720px) {
.pj-task-modal-card { width: min(480px, 94vw); height: auto; max-height: 90vh; overflow-y: auto; display: block; }
.pj-modal-body { display: block; height: auto; overflow-y: visible; }
.pj-task-modal-card { width: 100vw; max-width: 100vw; min-width: 0; }
.pj-side-2col { display: block; }
}
/* "새 업무" 작성 — 하위업무/첨부/연결/댓글 칸이 전부 숨는 홑겹 폼이라
800x1100 대신 작게 고정(뷰포트 너비와 무관하게 항상 이 크기). */
.pj-task-modal-card.pj-modal-compact {
width: 480px; max-width: 96vw; height: 700px; max-height: 90vh;
display: block; overflow-y: auto;
}
.pj-task-modal-card.pj-modal-compact .pj-modal-body { display: block; height: auto; overflow-y: visible; }
.pj-modal-card h3 { margin: 0 0 16px; font-size: 17px; }
.pj-modal-hint { margin: -6px 0 14px; font-size: 12px; color: #6b7280; }
/* 업무 편집 팝업 — 아사나식 레이아웃(큰 무테 제목 + 작은 메타 칩 한 줄). */
.pj-modal-kicker { margin: 0 0 2px; font-size: 11px; font-weight: 700; color: var(--pj-ink-soft);
text-transform: uppercase; letter-spacing: .04em; }
/* [프로젝트/세션]의 업무 편집 — 버튼 줄 가운데에 겹쳐 표시(버튼 레이아웃에
영향 없게 절대 위치, 텍스트가 길면 잘라낸다). */
.pj-modal-kicker-center {
position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
margin: 0; max-width: 44%; overflow: hidden; text-overflow: ellipsis;
white-space: nowrap; pointer-events: none;
}
.pj-t-title-input {
display: block; width: 100%; border: none !important; background: transparent !important;
font-size: 19px !important; font-weight: 700; padding: 4px 4px !important; margin: 0 0 14px !important;
@@ -476,16 +490,16 @@
.pj-modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
/* 업무 편집 팝업은 버튼 줄이 맨 위에 고정이다 — 설명/하위업무가 길어도
스크롤하지 않고 저장·취소할 수 있다. 카드는 padding 22px 을 가진 스크롤
컨테이너이기도 해서(compact 모드), 좌우로 음수 마진을 줘 카드 폭을 꽉
채우고 sticky 로 고정한다. 높이를 34px 로 바짝 낮춰(줄바꿈 금지) 카드
맨 위 모서리에 딱 붙이고, 바로 아래 제목과는 16px 여백을 둬서 절대
겹치지 않게 한다 — 버튼이 다 안 들어가면 가로 스크롤. */
컨테이너라, 좌우로 음수 마진을 줘 카드 폭을 꽉 채우고 sticky 로
고정한다. 높이를 34px 로 바짝 낮춰(줄바꿈 금지) 카드 맨 위 모서리에 딱
붙이고, 바로 아래 제목 입력칸과는 16px 여백을 둬서 절대 겹치지 않게
한다 — 버튼이 다 안 들어가면 가로 스크롤. 제목([프로젝트/세션]의 업무
편집)은 이 줄 가운데에 절대위치로 겹쳐 보여준다(.pj-modal-kicker-center). */
.pj-modal-actions-top {
position: sticky; top: 0; z-index: 3; flex: none;
height: 34px; box-sizing: border-box;
margin: -22px -22px 16px; padding: 0 22px;
background: #fff; border-bottom: 1px solid #eef0f2;
border-radius: 16px 16px 0 0;
flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
}
.pj-modal-actions-top .pj-btn { flex: none; padding: 4px 9px; font-size: 11.5px; }
+73 -11
View File
@@ -25,6 +25,33 @@
function openModal(m) { if (m) m.hidden = false; }
function closeModal(m) { if (m) m.hidden = true; }
// 업무 편집 팝업 전용 — 아사나처럼 오른쪽에서 슬라이드로 열고 닫는다.
// hidden 을 먼저 풀고 reflow 를 강제한 뒤 .pj-panel-open 을 붙여야
// transform 트랜지션이 (display:none 상태에서 곧장) 걸린다. 닫을 때는
// transitionend 를 기다렸다가 hidden 을 다시 세운다(이벤트가 안 오는
// 경우를 대비해 타임아웃도 같이 건다).
function openSlidePanel(m) {
if (!m) return;
m.hidden = false;
void m.offsetWidth;
m.classList.add("pj-panel-open");
}
function closeSlidePanel(m) {
if (!m || m.hidden) return;
m.classList.remove("pj-panel-open");
const card = m.querySelector(".pj-task-modal-card");
let done = false;
function finish() { if (done) return; done = true; m.hidden = true; }
if (card) {
card.addEventListener("transitionend", function onEnd(e) {
if (e.target !== card || e.propertyName !== "transform") return;
card.removeEventListener("transitionend", onEnd);
finish();
});
setTimeout(finish, 320);
} else finish();
}
function wireModalClose(modal) {
if (!modal) return;
modal.addEventListener("click", function (e) {
@@ -188,11 +215,6 @@
return "rgba(" + r + "," + g + "," + b + "," + alpha + ")";
}
function setTaskModalCompact(compact) {
const card = document.querySelector("#pj-modal-task .pj-task-modal-card");
if (card) card.classList.toggle("pj-modal-compact", !!compact);
}
// 멤버 선택 후보 카드(아이콘 위 / 이름 가운데 / 체크박스 아래) — 새 프로젝트
// 모달(홈·프로젝트 페이지)과 멤버 배정 모달 3곳이 전부 이 함수 하나를 쓴다.
// /api/assignable-users 응답의 avatar 필드를 그대로 쓰므로 페이지별
@@ -2660,6 +2682,39 @@
// ── 업무 모달 ──
const taskModal = el("pj-modal-task");
// 패널 너비 드래그 리사이즈 — 왼쪽 모서리를 끌면 오른쪽에 고정된 패널이
// 넓어진다(최소 420px, 최대 화면 절반). 마지막 너비는 기억해둔다.
(function initTaskPanelResize() {
const card = taskModal.querySelector(".pj-task-modal-card");
const handle = el("pj-task-panel-resizer");
if (!card || !handle) return;
const WKEY = "pj_task_panel_w";
const saved = parseInt(localStorage.getItem(WKEY) || "", 10);
if (saved) card.style.width = saved + "px";
handle.addEventListener("mousedown", function (e) {
e.preventDefault();
const startX = e.clientX;
const startW = card.getBoundingClientRect().width;
handle.classList.add("is-dragging");
document.body.style.userSelect = "none";
function mv(ev) {
const maxW = window.innerWidth * 0.5;
const w = Math.max(420, Math.min(maxW, startW + (startX - ev.clientX)));
card.style.width = w + "px";
}
function up() {
document.removeEventListener("mousemove", mv);
document.removeEventListener("mouseup", up);
handle.classList.remove("is-dragging");
document.body.style.userSelect = "";
try { localStorage.setItem(WKEY, String(Math.round(card.getBoundingClientRect().width))); } catch (_) {}
}
document.addEventListener("mousemove", mv);
document.addEventListener("mouseup", up);
});
})();
let currentTaskId = null;
// 시작일/시간 지정은 폼에서 뺐다(더 이상 이 팝업에서 편집 안 함) — 저장 시
// 값을 그대로 보존해서 보내기 위해 열려 있는 업무의 원본을 들고 있는다.
@@ -2706,7 +2761,7 @@
if (save) { el("pj-save-task").click(); return; }
}
taskSnapshot = null;
closeModal(taskModal);
closeSlidePanel(taskModal);
} finally { taskClosing = false; }
}
taskModal.addEventListener("click", function (e) {
@@ -2761,9 +2816,16 @@
}
function openTaskModal(task, presetStageId) {
setTaskModalCompact(!task);
const projName = task ? (task.project_name || currentProject.name || "") : (currentProject.name || "");
el("pj-task-modal-title").textContent = "[" + projName + "]의 " + (task ? "업무 편집" : "새 업무");
// [프로젝트명/세션 이름]의 업무 편집 — 새 업무는 아직 세션이 고정되지
// 않았을 수 있어 프로젝트명만.
const stageName = task ? (task.stage_name || "") : "";
const titleText = task
? "[" + projName + (stageName ? "/" + stageName : "") + "]의 업무 편집"
: "새 업무";
const titleEl = el("pj-task-modal-title");
titleEl.textContent = titleText;
titleEl.title = titleText;
el("pj-t-id").value = task ? task.id : "";
el("pj-t-title").value = task ? task.title : "";
if (descEditor) { descEditor.setTaskId(task ? task.id : null); descEditor.setHtml(task ? (task.description || "") : ""); }
@@ -2787,7 +2849,7 @@
if (subtaskBlock) el("pj-subtask-block").hidden = !task;
if (linksBlock) el("pj-links-block").hidden = !task;
if (task) { loadAttachments(task.id); loadComments(task.id); loadTaskExtras(task); }
openModal(taskModal);
openSlidePanel(taskModal);
taskSnapshot = taskFormSnapshot();
}
@@ -2971,7 +3033,7 @@
else res = await api("POST", "/project/api/projects/" + projectId + "/tasks", payload);
mergeTask(res.task);
taskSnapshot = null;
closeModal(taskModal);
closeSlidePanel(taskModal);
refreshActiveView();
} catch (e) { alert("저장 실패: " + e.message); }
});
@@ -2992,7 +3054,7 @@
try {
await api("DELETE", "/project/api/tasks/" + id);
tasks = tasks.filter(function (x) { return String(x.id) !== String(id); });
closeModal(taskModal);
closeSlidePanel(taskModal);
refreshActiveView();
} catch (e) { alert("삭제 실패: " + e.message); }
});