From 66d442bf50441afea09bbb72a124fb59ca90581e Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Tue, 15 Sep 2026 13:34:43 -0700 Subject: [PATCH] Center painting Comment button and focus mime composer --- system/public/aesthetic.computer/disks/painting.mjs | 8 ++++---- system/public/mime/index.html | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/system/public/aesthetic.computer/disks/painting.mjs b/system/public/aesthetic.computer/disks/painting.mjs index 15ba450bae..86c911c15f 100644 --- a/system/public/aesthetic.computer/disks/painting.mjs +++ b/system/public/aesthetic.computer/disks/painting.mjs @@ -591,8 +591,8 @@ function paint({ printBtn?.paint({ ink }); downloadBtn?.paint({ ink }); if (paintingCode && !isNuked && !showMode) { - if (!discussBtn) discussBtn = new ui.TextButtonSmall("Comment", { right: 6, top: 24, screen }); - discussBtn.reposition({ right: 6, top: 24, screen }); + if (!discussBtn) discussBtn = new ui.TextButtonSmall("Comment", { center: "x", bottom: 6, screen }); + discussBtn.reposition({ center: "x", bottom: 6, screen }); discussBtn.paint({ ink }); } else { discussBtn = null; @@ -737,7 +737,7 @@ function paint({ ); // Prev & Next Buttons - const prevNextMarg = menuBtn || (paintingCode && !isNuked && !showMode) ? 40 : 32; + const prevNextMarg = menuBtn ? 40 : 32; const prevNextWidth = 32; if (!prevBtn) { @@ -817,7 +817,7 @@ function act({ let discussing = false; discussBtn?.act(e, () => { discussing = true; - net.web(`https://aesthetic.computer/mime/#/media/painting/${encodeURIComponent(paintingCode)}`); + net.web(`https://aesthetic.computer/mime/#/media/painting/${encodeURIComponent(paintingCode)}?comment=1`); }); if (discussing || discussBtn?.down) return; function next() { diff --git a/system/public/mime/index.html b/system/public/mime/index.html index ded0045266..14dd50de2a 100644 --- a/system/public/mime/index.html +++ b/system/public/mime/index.html @@ -272,7 +272,7 @@ function renderPost(post, isOp, inThread = false, contextBoard) { if (post.text) div.append(renderText(post.text)); if (!post.parent && !inThread) { const discuss = el("a", "discussion", "comment" + (post.replies ? " (" + post.replies + ")" : "")); - discuss.href = "#/t/" + post.code; + discuss.href = "#/t/" + post.code + "?comment=1"; div.append(discuss); } return div; @@ -474,7 +474,8 @@ async function route() { document.ondragover = document.ondragleave = document.ondrop = document.onpaste = null; document.body.classList.remove("dragging"); const [hash, query] = location.hash.replace(/^#\/?/, "").split("?"); - const page = Math.max(0, parseInt(new URLSearchParams(query).get("page")) || 0); + const params = new URLSearchParams(query); + const page = Math.max(0, parseInt(params.get("page")) || 0); view.replaceChildren(el("p", null, "loading…")); nav.replaceChildren(); try { @@ -486,6 +487,11 @@ async function route() { active = await thread(decodeURIComponent(code || ""), kind); } else active = await board(decodeURIComponent(hash), page); if (hash) await loadNav(active); + if (params.get("comment") === "1" && (hash.startsWith("t/") || hash.startsWith("media/"))) { + const comment = view.querySelector("#post textarea"); + comment?.focus(); + comment?.scrollIntoView({ block: "center" }); + } } catch (error) { view.replaceChildren(el("p", null, error.message || "could not load mime")); } -- 2.51.2