feat(project): remove drag-to-move for annual goal cells

Goal text cells no longer get move borders or drag handling; clicking a
cell still highlights it. The weekly meeting table keeps its move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 14:02:51 +09:00
parent fbb6c648a5
commit b7c24c07e7
11 changed files with 26 additions and 194 deletions
+6 -33
View File
@@ -463,47 +463,20 @@ const server = http.createServer(function (req, res) {
console.log("PASS merged meeting rowspan, independent numeric cells and both column orders");
const interactive = await browser.newPage({ viewport: { width: 1600, height: 1000 } });
let releaseMove, startedMove;
const moveGate = new Promise(function (resolve) { releaseMove = resolve; });
const moveStarted = new Promise(function (resolve) { startedMove = resolve; });
const moveRequests = [];
await interactive.route("**/project/api/**", async function (route) {
const request = route.request();
if (request.url().endsWith("/goals/cells/move")) {
const payload = request.postDataJSON(); moveRequests.push(payload); startedMove();
await moveGate;
await route.fulfill({ json: { ok: true, body: payload.body } });
} else await route.fulfill({ json: { ok: true } });
});
await interactive.route("**/project/api/**", function (route) { return route.fulfill({ json: { ok: true } }); });
await interactive.addInitScript(function () {
localStorage.setItem("pj_goal_col_w", JSON.stringify({ y: 240, m1: 240, m2: 240 }));
});
await interactive.goto("http://127.0.0.1:" + server.address().port + "/project/goals/2026");
const sourceCell = interactive.locator('tr[data-row-id="10"] td[data-month="1"]');
const targetCell = interactive.locator('tr[data-row-id="11"] td[data-month="2"]');
await sourceCell.locator(".pj-goal-text").evaluate(function (editor) {
// 연간 목표 셀 끌어서 이동은 2026-10-07 요청으로 없앴다 — 이동 테두리가 없어야 한다
await sourceCell.locator(".pj-goal-text").click();
assert.equal(await interactive.locator("#pj-goal-table .pj-goal-move-edge").count(), 0);
await targetCell.locator(".pj-goal-text").evaluate(function (editor) {
editor.value = "pj-rich:v1:" + JSON.stringify([{ text: "드래그 이동", bold: true, italic: true, underline: true, size: 24, color: "#ff0000" }]);
});
await sourceCell.locator(".pj-goal-text").click();
const edge = await sourceCell.locator('.pj-goal-move-edge[data-edge="bottom"]').boundingBox();
const dest = await targetCell.boundingBox();
await interactive.mouse.move(edge.x + edge.width / 2, edge.y + edge.height / 2);
await interactive.mouse.down();
await interactive.mouse.move(dest.x + dest.width / 2, dest.y + dest.height / 2, { steps: 6 });
assert(await targetCell.evaluate(function (td) { return td.classList.contains("is-goal-move-target"); }));
await interactive.mouse.up(); await moveStarted;
assert.equal(moveRequests.length, 1);
assert.equal(await sourceCell.locator(".pj-goal-text").textContent(), "드래그 이동");
assert.equal(await targetCell.locator(".pj-goal-text").textContent(), "");
releaseMove();
await interactive.waitForFunction(function () {
return document.querySelector('tr[data-row-id="10"] .pj-goal-text[data-month="1"]').textContent === "";
});
const moved = await targetCell.locator(".pj-goal-text").evaluate(function (editor) { return JSON.parse(editor.value.slice(11))[0]; });
assert.equal(moved.text, "드래그 이동"); assert.equal(moved.color, "#ff0000"); assert.equal(moved.size, 24);
assert(moved.bold && moved.italic && moved.underline);
assert.deepEqual(await targetCell.evaluate(function (td) { return [td.colSpan, td.rowSpan]; }), [1, 1]);
console.log("PASS actual mouse border drag, delayed atomic response, all text formats, unchanged cell geometry");
console.log("PASS goal cells have no drag-move borders");
await targetCell.click({ button: "right" });
await interactive.getByRole("menuitem", { name: "현재 열 너비 자동 맞춤" }).click();
+5 -51
View File
@@ -752,58 +752,12 @@ function meetServer(env, st) {
menu(table.querySelector("th.pj-goal-area-name"));
check("[너비 메뉴] 구역 이름 편집 메뉴에도 맞춤 제공", !!action("색 바꾸기") && !!action("현재 열 너비 자동 맞춤"));
});
await section(async function () {
const gate = deferred(), env = makeEnv(PAGE.goals_admin, GOALS_URL);
const st = goalsServer(env, { moveHook: async function (body) { await gate.promise; return { body: { ok: true, body: body.body } }; } });
await boot(env);
const source = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]'), target = env.d.querySelector('.pj-goal-text[data-row="11"][data-month="2"]');
type(env, source, "pj-rich:v1:" + JSON.stringify([{ text: "이동할 글", color: "#ff0000", size: 24, bold: true, italic: true, underline: true }]));
const original = source.value;
const drop = beginGoalMove(env, source, target);
check("[셀 이동] 대상 미리보기·일반 범위 선택과 분리", target.closest("td").classList.contains("is-goal-move-target") && env.d.documentElement.classList.contains("pj-goal-moving"));
drop(); await settle();
check("[셀 이동] 먼저 초안 저장·이동은 한 번·응답 전 원본 유지", st.moves === 1 && source.value === original && target.value === "" && source.getAttribute("contenteditable") === "false" && target.getAttribute("contenteditable") === "false");
const moveIndex = env.calls.findIndex(function (c) { return /cells\/move$/.test(c.url); });
check("[셀 이동] 글 PUT 뒤 원자적 이동 API", moveIndex > env.calls.findIndex(function (c) { return c.method === "PUT" && /rows\/10\/cells\/1$/.test(c.url); }));
gate.resolve(); await settle();
const run = JSON.parse(target.value.slice(11))[0];
check("[셀 이동] 성공 뒤 원본 비우기·대상 글과 모든 서식 보존", source.value === "" && run.text === "이동할 글" && run.color === "#ff0000" && run.size === 24 && run.bold && run.italic && run.underline);
const count = env.calls.length; fire(env, source, "blur"); fire(env, target, "blur"); await settle();
check("[셀 이동] 저장 기준값·초안 정리·후속 blur 중복 저장 없음", env.calls.length === count && !env.w.localStorage.getItem("pj_draft:goal:10:1") && source.getAttribute("contenteditable") === "true" && target.closest("td").classList.contains("is-goal-active"));
});
for (const failure of ["network", "conflict", "save"]) await section(async function () {
const env = makeEnv(PAGE.goals_admin, GOALS_URL);
const st = goalsServer(env, { moveHook: function () { return failure === "network" ? "NETWORK" : { status: 409, body: { detail: "다른 창에서 수정" } }; },
cellHook: failure === "save" ? function () { return { status: 503, body: { detail: "저장 장애" } }; } : null });
await boot(env);
const source = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]'), target = env.d.querySelector('.pj-goal-text[data-row="11"][data-month="2"]');
if (failure === "save") type(env, source, "미저장 초안");
const before = source.value; beginGoalMove(env, source, target)(); await settle();
check("[셀 이동 " + failure + "] 실패해도 양쪽 내용·편집 가능 상태 유지", source.value === before && target.value === "" && source.getAttribute("contenteditable") === "true" && !env.d.documentElement.classList.contains("pj-goal-moving"));
check("[셀 이동 " + failure + "] 저장 실패면 이동 API 생략", failure !== "save" || !st.moves);
});
await section(async function () {
await section(async function () { // 연간 목표 셀 끌어서 이동 — 2026-10-07 요청으로 없앰(회의록 표 이동은 그대로)
const env = makeEnv(PAGE.goals_admin, GOALS_URL), st = goalsServer(env); await boot(env);
const source = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]'), target = env.d.querySelector('.pj-goal-text[data-row="11"][data-month="2"]');
target.value = "대상 기존 글"; let confirmations = 0;
env.w.erpConfirm = function () { confirmations++; return Promise.resolve(false); };
beginGoalMove(env, source, target)(); await settle();
check("[셀 이동] 덮어쓰기 취소는 두 내용 유지·이동 없음", confirmations === 1 && !st.moves && source.value === "original" && target.value === "대상 기존 글");
env.w.erpConfirm = function () { return Promise.resolve(true); };
beginGoalMove(env, source, target)(); await settle();
check("[셀 이동] 확인 뒤 덮어쓰기·원본 비우기", st.moves === 1 && source.value === "" && target.textContent === "original");
});
await section(async function () {
const env = makeEnv(PAGE.goals_admin, GOALS_URL), st = goalsServer(env); await boot(env);
const source = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]'), target = env.d.querySelector('.pj-goal-text[data-row="11"][data-month="2"]');
beginGoalMove(env, source, target); key(env, env.d, "Escape"); await settle();
check("[셀 이동] Esc 취소는 원본 유지·이동 요청 없음", !st.moves && source.value === "original" && !env.d.documentElement.classList.contains("pj-goal-moving"));
beginGoalMove(env, source, target); env.w.dispatchEvent(new env.w.Event("blur")); await settle();
check("[셀 이동] 창 포커스 이탈도 이동 취소·드래그 정리", !st.moves && !env.d.querySelector(".is-goal-move-target"));
beginGoalMove(env, source, source)(); await settle();
check("[셀 이동] 자기 셀에 놓기 = 변경 없음", !st.moves && source.value === "original");
const ro = makeEnv(PAGE.goals_ro, GOALS_URL); goalsServer(ro); await boot(ro);
check("[셀 이동] 보기 전용에는 이동 테두리 없음", !ro.d.querySelector(".pj-goal-move-edge"));
const source = env.d.querySelector('.pj-goal-text[data-row="10"][data-month="1"]');
check("[셀 이동 없음] 연간 목표 글 칸에 이동 테두리 없음", !env.d.querySelector("#pj-goal-table .pj-goal-move-edge"));
source.closest("td").dispatchEvent(new env.w.MouseEvent("mousedown", { bubbles: true, cancelable: true, button: 0 }));
check("[셀 이동 없음] 누르면 칸 표시만", source.closest("td").classList.contains("is-goal-active") && !st.moves);
});
// ════════════════════ [9] 매출 자동 갱신 — 정상 조용히 · 실패/일부 실패 안내 + 재시도 · 권한 없음 ════════════════════