Merge branch 'fix/project-image-bar-nowrap'

This commit is contained in:
2026-10-22 12:18:37 +09:00
9 changed files with 21 additions and 9 deletions
@@ -289,5 +289,5 @@
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
<script src="/static/project-meeting-cells.js?v=20261012a" defer></script>
<script src="/static/project.js?v=20261022a" defer></script>
<script src="/static/project.js?v=20261022b" defer></script>
{% endblock %}
@@ -207,5 +207,5 @@
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
<script src="/static/project.js?v=20261022a" defer></script>
<script src="/static/project.js?v=20261022b" defer></script>
{% endblock %}
@@ -106,5 +106,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261022a" defer></script>
<script src="/static/project.js?v=20261022b" defer></script>
{% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20261022a" defer></script>
<script src="/static/project.js?v=20261022b" defer></script>
{% endblock %}
@@ -108,5 +108,5 @@
});
})();
</script>
<script src="/static/project.js?v=20261022a" defer></script>
<script src="/static/project.js?v=20261022b" defer></script>
{% endblock %}
@@ -476,5 +476,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261022a" defer></script>
<script src="/static/project.js?v=20261022b" defer></script>
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261022a" defer></script>
<script src="/static/project.js?v=20261022b" defer></script>
{% endblock %}
+4 -2
View File
@@ -2357,7 +2357,7 @@
const src = new URL(img.getAttribute("src") || img.src, location.href).href;
const nw = img.naturalWidth || 1200, nh = img.naturalHeight || 800;
const sw = (window.screen && screen.availWidth) || 1600, sh = (window.screen && screen.availHeight) || 900;
const w = Math.round(Math.min(Math.max(nw + 48, 480), sw * 0.95));
const w = Math.round(Math.min(Math.max(nw + 48, 560), sw * 0.95)); // 최소 560 — 아래 막대(다운로드 포함)가 한 줄로 다 들어가게
const h = Math.round(Math.min(Math.max(nh + 110, 360), sh * 0.95));
const left = Math.round(((window.screenX || 0) + Math.max(0, (window.outerWidth - w) / 2)));
const top = Math.round(((window.screenY || 0) + Math.max(0, (window.outerHeight - h) / 2)));
@@ -2374,9 +2374,11 @@
'html,body{margin:0;height:100%;overflow:hidden;background:#202226;color:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Helvetica,Arial,"Apple SD Gothic Neo","Malgun Gothic",sans-serif}' +
'#stage{position:fixed;inset:0;cursor:grab;touch-action:none}#stage.drag{cursor:grabbing}' +
'#img{position:absolute;left:0;top:0;transform-origin:0 0;user-select:none;-webkit-user-drag:none;box-shadow:0 6px 28px rgba(0,0,0,.45);background:#fff;max-width:none}' +
// 막대 = 내용 길이만큼 한 줄(2026-10-22 — left:50% 라 폭이 창 절반으로 잡혀 작은 창에서 단추 글자가 여러 줄이 됐다)
'#bar{position:fixed;left:50%;bottom:14px;transform:translateX(-50%);display:flex;align-items:center;gap:2px;padding:4px;' +
'width:max-content;max-width:calc(100vw - 16px);white-space:nowrap;' +
'background:rgba(40,42,47,.92);border:1px solid rgba(255,255,255,.08);border-radius:10px;box-shadow:0 6px 18px rgba(0,0,0,.35);z-index:2}' +
'#bar button{height:30px;min-width:34px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:#fff;cursor:pointer;' +
'#bar>*{flex:none}#bar button{height:30px;min-width:34px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:#fff;cursor:pointer;' +
'display:inline-flex;align-items:center;justify-content:center;font-family:inherit;font-weight:600;font-size:12.5px}' +
'#bar a{height:30px;padding:0 10px;border-radius:7px;color:#fff;text-decoration:none;display:inline-flex;align-items:center;gap:4px;font-weight:600;font-size:12.5px}' +
'#bar a:hover{background:rgba(255,255,255,.14)}#bar a:focus-visible{outline:2px solid #9d8cff;outline-offset:1px}' +
@@ -96,6 +96,16 @@ const server = http.createServer(async (req, res) => {
ok("[다운로드] = 첨부 다운로드 주소", /\/project\/api\/attachments\/7\/download$/.test(dlHref || ""), dlHref);
const [download] = await Promise.all([pop.waitForEvent("download"), pop.click("#dl")]);
ok("[다운로드] 누르면 파일 내려받기", download.suggestedFilename() === "photo.png" && downloads.length === 1, download.suggestedFilename());
// 작은 창(작은 사진) — 막대 단추 글자가 한 줄(예전엔 막대 폭이 창 절반으로 잡혀 "원본/보기"처럼 줄바꿈)
for (const w of [560, 480]) {
await pop.setViewportSize({ width: w, height: 400 });
const bar = await pop.evaluate(() => {
const b = document.getElementById("bar"), r = b.getBoundingClientRect();
const tall = Array.from(b.querySelectorAll("button, a")).filter(el => el.getBoundingClientRect().height > 32).map(el => el.textContent.trim());
return { tall: tall, h: Math.round(r.height), inside: r.left >= 0 && r.right <= innerWidth };
});
ok("창 폭 " + w + "px — 막대 단추 글자 한 줄, 막대가 창 안", bar.tall.length === 0 && bar.h <= 40 && bar.inside, bar);
}
await pop.locator("#bar").screenshot({ path: path.join(OUT, "comment_image_bar.png") });
await pop.screenshot({ path: path.join(OUT, "comment_image_viewer.png") });
await pop.close();