From edb56f3fcdea0b0ec6494d432dda80878681b4e6 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 1 Aug 2026 23:06:26 +0200 Subject: [PATCH] fix: accept direct icon URLs Use valid direct HTTP(S) icon URLs without repository search. --- apps/docs/docs/advanced/icons/index.mdx | 2 +- apps/docs/docs/management/apps/index.mdx | 4 ++-- .../src/icon-picker/icon-picker.tsx | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/apps/docs/docs/advanced/icons/index.mdx b/apps/docs/docs/advanced/icons/index.mdx index 2876559ac..b73d49e02 100644 --- a/apps/docs/docs/advanced/icons/index.mdx +++ b/apps/docs/docs/advanced/icons/index.mdx @@ -31,4 +31,4 @@ Icons that are high quality and printable ([SVG](https://wikipedia.org/wiki/Scal ### Using external icons If you don't find the icon you're looking for on Dashboard Icons or wish to use a different source, you can simply enter a URL that points to an icon. -It is important that the URL directly points to the file without any advertisements or elements around it. +Direct HTTP(S) image URLs are used as entered instead of being searched in the built-in repositories. It is important that the URL directly points to the file without any advertisements or elements around it. diff --git a/apps/docs/docs/management/apps/index.mdx b/apps/docs/docs/management/apps/index.mdx index c5c0a2ad7..35c02a4fc 100644 --- a/apps/docs/docs/management/apps/index.mdx +++ b/apps/docs/docs/management/apps/index.mdx @@ -28,7 +28,7 @@ The name must be at least one character long and can be chosen freely. ### Icon URL This is the URL to the icon that will be displayed on the app widget. -It can be a url to an image in the internet, one from the included icon repositories or a local file uploaded through the upload button. +You can paste a direct HTTP(S) URL to an image, search the included icon repositories by name, or upload a local file through the upload button. Direct image URLs are used as entered and are not searched in the icon repositories. ![Icon URL](./img/app-icon-url.png) @@ -50,4 +50,4 @@ It's useful when you want to ping the service internally for example with a cust On the apps management page you find all apps that exist in your Homarr instance. You can edit and delete them. -![Apps list](./img/app-list.png) \ No newline at end of file +![Apps list](./img/app-list.png) diff --git a/packages/forms-collection/src/icon-picker/icon-picker.tsx b/packages/forms-collection/src/icon-picker/icon-picker.tsx index 058e75bd0..4af6f1bd0 100644 --- a/packages/forms-collection/src/icon-picker/icon-picker.tsx +++ b/packages/forms-collection/src/icon-picker/icon-picker.tsx @@ -165,8 +165,18 @@ export const IconPicker = ({ leftSection={leftSection} value={inputValue} onChange={(event) => { - combobox.openDropdown(); - setQuery(event.currentTarget.value); + const nextValue = event.currentTarget.value; + const trimmedValue = nextValue.trim(); + if (/^https?:\/\/[^\s/]+(?:\/\S*)?$/i.test(trimmedValue)) { + startTransition(() => { + setValue(trimmedValue); + setQuery(""); + combobox.closeDropdown(); + }); + } else { + combobox.openDropdown(); + setQuery(nextValue); + } }} onClick={() => combobox.openDropdown()} onFocus={(event) => {