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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user