From 9ef306e133219a330644e4a92f5ec4982ee6f190 Mon Sep 17 00:00:00 2001 From: gramps Date: Wed, 1 Jul 2026 17:35:12 -0700 Subject: [PATCH] v1.8.6 -> v1.8.7: add image paste guard with toast notification --- config.py | 2 +- templates/index.html | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index b803b10..ba71e8c 100644 --- a/config.py +++ b/config.py @@ -9,7 +9,7 @@ import logging log = logging.getLogger("jarvischat") -VERSION = "v1.8.6" +VERSION = "v1.8.7" OLLAMA_BASE = os.environ.get("OLLAMA_BASE", "http://localhost:11434") LLAMA_SERVER_BASE = os.environ.get("LLAMA_SERVER_BASE", "http://192.168.50.108:8081") SEARXNG_BASE = "http://localhost:8888" diff --git a/templates/index.html b/templates/index.html index d206c2a..63c86cb 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1249,6 +1249,20 @@ function scrollToBottom() { const c = document.getElementById('chatContainer'); const userInput = document.getElementById('userInput'); userInput.addEventListener('input', function() { this.style.height = 'auto'; this.style.height = Math.min(this.scrollHeight, 200) + 'px'; }); userInput.addEventListener('keydown', e => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendMessage(); } }); +const toastStyle = document.createElement('style'); +toastStyle.textContent = '.toast-error { position:fixed; bottom:80px; left:50%; transform:translateX(-50%); background:var(--danger); color:#fff; padding:12px 24px; border-radius:var(--radius); font-family:var(--font-body); font-size:14px; z-index:9999; animation:fadeIn 0.2s; } @keyframes fadeIn { from{opacity:0;transform:translateX(-50%) translateY(10px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }'; +document.head.appendChild(toastStyle); +userInput.addEventListener('paste', e => { + const hasImage = Array.from(e.clipboardData.items).some(i => i.type.startsWith('image/')); + if (hasImage) { + e.preventDefault(); + const toast = document.createElement('div'); + toast.className = 'toast-error'; + toast.textContent = 'Image pasting is not supported — text only.'; + document.body.appendChild(toast); + setTimeout(() => toast.remove(), 3000); + } +});