From 29328e5b45124f8ca2d12b3d913131e429c8b60c Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Mon, 22 Jun 2026 21:14:07 -0700 Subject: [PATCH] =?UTF-8?q?chat/laklok:=20fix=20attach=20=E2=80=94=20use?= =?UTF-8?q?=20painting-=20filename=20so=20the=20slug=20resolves?= =?UTF-8?q?;=20don't=20append=20to=20the=20'...'=20cta=20placeholder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first cut named the upload chat-.png; presigned-url turns the prefix before '-' into the storage folder, so it landed in /chat/ with a non-timestamp slug that get.painting(slug).by(handle) can't resolve (no inline preview). Match uploadPainting's painting-.png convention. Also: inserting the #code appended to the TextInput's '...' call-to-action, producing '... #code' messages — treat '...' as empty. --- system/public/aesthetic.computer/disks/chat.mjs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/system/public/aesthetic.computer/disks/chat.mjs b/system/public/aesthetic.computer/disks/chat.mjs index 9907d4ba86..bc2fa7aa42 100644 --- a/system/public/aesthetic.computer/disks/chat.mjs +++ b/system/public/aesthetic.computer/disks/chat.mjs @@ -411,7 +411,8 @@ function scaleBitmapDown(api, bmp, maxDim) { // the bottom "Enter message" button shows. function insertIntoInput(str, send) { if (!input) return; - const cur = input.text || ""; + let cur = input.text || ""; + if (cur === "...") cur = ""; // ignore the empty call-to-action placeholder const sep = cur.length > 0 && !/\s$/.test(cur) ? " " : ""; input.text = cur + sep + str; draftMessage = input.text; @@ -433,7 +434,11 @@ async function attachImage(bitmap, api, send, handle) { try { api.notice?.("UPLOADING…", ["yellow", 0]); const img = scaleBitmapDown(api, bitmap, 1024); - const filename = `chat-${Date.now()}.png`; + // Must match the painting convention `painting-.png` + // (same as uploadPainting). The "painting-" prefix routes it into the + // /painting/ folder and the dotted timestamp becomes the stored slug, so + // the inline preview loader (get.painting(slug).by(handle)) can resolve it. + const filename = `painting-${api.num.timestamp()}.png`; const data = await api.upload(filename, { pixels: img.pixels, width: img.width || img.w, -- 2.51.2