From b3d91fad939ba6d49d0854ea0d8f7b1746304888 Mon Sep 17 00:00:00 2001 From: kmmiio99o <164557248+kmmiio99o@users.noreply.github.com> Date: Fri, 31 Oct 2025 20:43:11 +0100 Subject: [PATCH] Improve install UX with validation and feedback --- src/core/ui/components/AddonPage.tsx | 89 ++++--- src/core/ui/settings/pages/Plugins/index.tsx | 130 +++++++++- src/core/ui/settings/pages/Themes/index.tsx | 239 +++++++++++++++++-- 3 files changed, 407 insertions(+), 51 deletions(-) diff --git a/src/core/ui/components/AddonPage.tsx b/src/core/ui/components/AddonPage.tsx index 24e2059..e7db7f2 100644 --- a/src/core/ui/components/AddonPage.tsx +++ b/src/core/ui/components/AddonPage.tsx @@ -69,8 +69,16 @@ function InputAlert(props: { const [value, setValue] = React.useState(""); const [error, setError] = React.useState(""); const [isFetching, setIsFetching] = React.useState(false); + const [validUrl, setValidUrl] = React.useState(false); + + // Check URL validity whenever value changes + React.useEffect(() => { + setValidUrl(isValidHttpUrl(value)); + }, [value]); function onConfirmWrapper() { + if (!value || !isValidHttpUrl(value)) return; + setIsFetching(true); props @@ -87,24 +95,37 @@ function InputAlert(props: { title={props.label} content="Type in the source URL you want to install from:" extraContent={ - - { - setValue(v); - if (error) setError(""); + + + { + setValue(v); + if (error) setError(""); + }} + returnKeyType="done" + onSubmitEditing={onConfirmWrapper} + state={error ? "error" : undefined} + errorMessage={error || undefined} + style={{ fontSize: 16 }} + /> + + + -