fix(project): center weekly meeting labels

This commit is contained in:
2026-10-03 18:45:27 +09:00
parent d89875db7e
commit e2fc14a584
5 changed files with 21 additions and 3 deletions
+16 -1
View File
@@ -330,7 +330,19 @@ const server = http.createServer(function (req, res) {
topDifference: (short.getBoundingClientRect().top - long.getBoundingClientRect().top) / zoom,
oneLine: document.querySelector('tr[data-item="4"]').getBoundingClientRect().height / zoom,
emptySlot: document.querySelector('tr[data-item="4"] .pj-meet-week-slot').getBoundingClientRect().height,
cellsAtTop: Array.from(row.querySelectorAll("td, th.pj-meet-c-label")).every(c => getComputedStyle(c).verticalAlign === "top"),
cellsAtTop: Array.from(row.querySelectorAll("td")).every(c => getComputedStyle(c).verticalAlign === "top"),
namesCentered: Array.from(document.querySelectorAll(".pj-meet-sec th")).every(th => {
const box = th.getBoundingClientRect(), line = th.querySelector(".pj-meet-label-line");
let text;
if (line) text = line.getBoundingClientRect();
else {
const node = th.firstChild, start = node.textContent.search(/\S/);
const range = document.createRange();
range.setStart(node, start); range.setEnd(node, start + node.textContent.trim().length);
text = range.getBoundingClientRect();
}
return getComputedStyle(th).verticalAlign === "middle" && Math.abs((box.top + box.bottom - text.top - text.bottom) / 2) / zoom <= 2;
}),
labels, clipped: long.scrollHeight > long.clientHeight };
});
}
@@ -339,6 +351,7 @@ const server = http.createServer(function (req, res) {
assert(Math.abs(m.long - (m.line * lines + m.top + m.bottom)) <= 1, JSON.stringify(m));
assert(Math.abs(m.row - m.long - m.border) <= 1, JSON.stringify(m));
assert(Math.abs(m.topDifference) <= 1 && m.cellsAtTop && !m.clipped, JSON.stringify(m));
assert(m.namesCentered, "meeting section and item names must stay vertically centered");
assert(m.oneLine <= m.line + m.top + m.bottom + m.border + 1 && m.emptySlot === 0, JSON.stringify(m));
assert.deepEqual(m.labels.map(b => b.text), ["자동입력", "실적 미사용"]);
assert(m.labels.every(b => b.rightOfName && b.sameLine && b.fits), JSON.stringify(m.labels));
@@ -359,6 +372,8 @@ const server = http.createServer(function (req, res) {
window.dispatchEvent(new Event("resize"));
});
checkMeeting(await meetingMetrics(), 3);
await meetingPage.locator("#pj-meet-order").click();
checkMeeting(await meetingMetrics(), 3);
await meetingPage.locator("#pj-meet-table").screenshot({ path: path.join(__dirname, ".out", readonly ? "meeting-layout-ro.png" : "meeting-layout-admin.png") });
await meetingPage.close();
console.log("PASS meeting row height, equal padding, top alignment, inline automatic/unused labels, shrink and 75% zoom" + (readonly ? " (read-only)" : ""));