feat(project): subtask rows and a wide view for the meeting task table

- Subtask rows (one level, parent_id): hover button / right-click to add, Tab to make a row the
  subtask of the row above, Shift+Tab to move it back; inherits the parent's project, no section
- Apply on a subtask row creates the task under the parent row's task (server-checked)
- "크게 열기" moves the same table into a wide window (same rows and saves), Esc/x to close
- Server: PUT parent_id with one-level rules; add rejects grandchildren
- Help + docs; tests (real PostgreSQL rules + parent apply, jsdom rows/Tab/wide view)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 16:20:05 +09:00
parent 1bdcd59287
commit 6fd01314d5
17 changed files with 343 additions and 60 deletions
+50
View File
@@ -523,6 +523,7 @@ function meetServer(env, st) {
const out = function (r) {
return { id: r.id, title: r.title || "", assignee_email: r.assignee_email || "", project_id: r.project_id || null,
project_name: r.project_name || "", stage_id: r.stage_id || null, stage_name: r.stage_name || "", task_id: r.task_id,
parent_id: r.parent_id || null,
registered: r.task_id != null, visible: r.visible !== false, task_exists: true };
};
env.route("GET", /\/goals\/meetings\/([\d-]+)\/quick-tasks$/, function (u) {
@@ -692,6 +693,55 @@ function meetServer(env, st) {
}
});
// ════════════════════ [2g4] 세부 작업 줄(↳·Tab·Shift+Tab) · [크게 열기] ════════════════════
await section(async function () {
const env = makeEnv(PAGE.meeting_admin, MEET_URL);
meetServer(env);
const q = quickServer(env, { rows: [{ id: 1, title: "부모 작업", project_id: 7, project_name: "브랜드" }] });
await boot(env); await settle(); await wait(5); await settle();
const d = env.d;
const trs = function () { return Array.from(d.querySelectorAll("#pj-meet-quick tbody tr")); };
const inputOf = function (tr) { return tr.querySelector('input[data-field="title"]'); };
const type = async function (inp, v) {
inp.value = v; inp.dispatchEvent(new env.w.Event("input", { bubbles: true }));
inp.dispatchEvent(new env.w.Event("focusout", { bubbles: true })); await settle(); await wait(5); await settle();
};
trs()[0].querySelector('[data-quick="add-sub"]').click(); await settle();
const sub = trs()[1];
check("[2g4] ↳ → 바로 아래 세부 작업 줄(들여쓰기·프로젝트는 위 줄·섹션 없음)", sub.classList.contains("is-sub") &&
inputOf(sub).placeholder === "세부 작업 제목" && /브랜드/.test(sub.querySelector(".pj-meet-quick-inherit").textContent) &&
d.activeElement === inputOf(sub));
await type(inputOf(sub), "세부 하나");
const saved = Object.values(q.rows).find(function (r) { return r.title === "세부 하나"; });
check("[2g4] 세부 작업 줄 저장 = parent_id(위 줄), 프로젝트 칸 없이", !!saved && saved.parent_id === 1 && !saved.project_id, saved);
check("[2g4] 위 줄 [적용] 전에는 세부 작업 [적용] 못 함", trs()[1].querySelector('[data-quick="apply"]').disabled);
// 아래 빈 맨 위 단계 줄 — 제목을 쓰고 Tab = 위 줄(부모 작업)의 세부 작업으로, Shift+Tab = 다시 위 단계로
const top = trs().find(function (tr) { return !tr.classList.contains("is-sub") && !inputOf(tr).value; });
await type(inputOf(top), "둘째");
const key = function (inp, shift) {
const e = new env.w.KeyboardEvent("keydown", { key: "Tab", shiftKey: !!shift, bubbles: true, cancelable: true });
inp.dispatchEvent(e); return e.defaultPrevented;
};
const tabbed = key(inputOf(trs().find(function (tr) { return inputOf(tr).value === "둘째"; })));
await settle(); await wait(5); await settle();
const second = Object.values(q.rows).find(function (r) { return r.title === "둘째"; });
check("[2g4] Tab = 위 줄의 세부 작업으로(저장)", tabbed && second.parent_id === 1 &&
trs().find(function (tr) { return inputOf(tr).value === "둘째"; }).classList.contains("is-sub"), second);
key(inputOf(trs().find(function (tr) { return inputOf(tr).value === "둘째"; })), true);
await settle(); await wait(5); await settle();
check("[2g4] Shift+Tab = 위 단계로(저장)", second.parent_id === null &&
!trs().find(function (tr) { return inputOf(tr).value === "둘째"; }).classList.contains("is-sub"), second);
// 크게 열기 — 같은 표가 넓은 창으로(줄 그대로), Esc 로 제자리
const nRows = trs().length;
d.querySelector('#pj-meet-quick [data-quick="expand"]').click(); await settle();
const modal = d.body.querySelector(".pj-meet-quick-modal");
check("[2g4] 크게 열기 → 같은 표를 넓은 창으로(body 에, 제목 'N주차 작업 등록')", !!modal && !!modal.querySelector("table.pj-meet-quick-table") &&
!d.querySelector("#pj-meet-quick table") && /4주차 작업 등록/.test(modal.querySelector("h3").textContent) &&
modal.querySelectorAll("tbody tr").length === nRows && nRows > 0);
d.dispatchEvent(new env.w.KeyboardEvent("keydown", { key: "Escape", bubbles: true, cancelable: true })); await settle();
check("[2g4] Esc → 닫히고 표는 제자리", !d.body.querySelector(".pj-meet-quick-modal") && !!d.querySelector("#pj-meet-quick table.pj-meet-quick-table"));
});
// ════════════════════ [2h] 회의록은 누구나 수정 · [회의 완료](관리자)면 잠금 ════════════════════
await section(async function () {
const env = makeEnv(PAGE.meeting_member, MEET_URL);