From b2bf7349760f736b84aff836360917a35d8d70e7 Mon Sep 17 00:00:00 2001 From: scheinriese Date: Thu, 7 May 2026 14:23:05 +0200 Subject: [PATCH] feat: replace asset-picker action bar with footer hint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The floating URL+Upload buttons are the last UI in the picker still pushing users toward an explicit URL-name dialog; paste and Web Image flows already auto-derive names. Replace them with a thin static footer ("Tip: Drop an image, paste a link, or browse · ⌘V"), delete the url-asset-pane popover entirely, and fix URL-paste naming to use extract-filename-from-url instead of clipboard-{timestamp}. Phones get a parallel hint where each verb is a real control (iOS Safari won't deliver paste events to non-input popover roots). Also: title+caption styling for the Wikipedia tooltip to match the color-picker contrast tooltip, and remove the 56px grid bottom padding that previously cleared the floating bar. Co-Authored-By: Claude Opus 4.7 --- src/main/frontend/components/icon.cljs | 265 ++++--------------------- src/main/frontend/components/icon.css | 115 ++++------- 2 files changed, 84 insertions(+), 296 deletions(-) diff --git a/src/main/frontend/components/icon.cljs b/src/main/frontend/components/icon.cljs index ddb89f141f..75e101edf1 100644 --- a/src/main/frontend/components/icon.cljs +++ b/src/main/frontend/components/icon.cljs @@ -934,14 +934,6 @@ "Maximum allowed size for URL assets (10MB)" (* 10 1024 1024)) -(defn- valid-url? - "Check if string is a valid HTTP/HTTPS URL" - [url] - (and (string? url) - (not (string/blank? url)) - (or (string/starts-with? url "http://") - (string/starts-with? url "https://")))) - (defn- valid-image-content-type? "Check if content-type header indicates an image" [content-type] @@ -1091,37 +1083,6 @@ nil))))) (p/resolved nil))))))))))) -(declare ( (js/fetch url #js {:method "HEAD" - :mode "cors" - :credentials "omit"}) - (.then (fn [^js response] - (if (.-ok response) - (let [content-type (.get (.-headers response) "content-type") - content-length (.get (.-headers response) "content-length") - size (when content-length (js/parseInt content-length 10))] - (resolve {:content-type content-type - :size size - :url url})) - (reject (ex-info "Failed to fetch URL" - {:kind :http :status (.-status response)}))))) - (.catch (fn [err] - (reject (ex-info "Network error" - {:kind :network :error (.-message err)}))))))))) - (defn- ( size max-url-asset-size)) - (reset! *error (str "Image exceeds " (/ max-url-asset-size 1024 1024) "MB size limit")) - - :else - (do - (reset! *validated? true) - ;; Auto-extract filename if empty - (when (string/blank? @*name) - (reset! *name (extract-filename-from-url url))))))) - (p/catch (fn [err] (reset! *error (url-save-error-copy err)))) - (p/finally #(reset! *loading? false))))) - - ;; Save handler - handle-save! - (fn [] - (reset! *loading? true) - (reset! *error nil) - (let [repo (state/get-current-repo)] - (-> ( (