From cde6d956bb0ddcfbf4facd76df89a8e991264814 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Thu, 21 Aug 2025 23:26:24 +0300 Subject: [PATCH 1/4] fix bug in textarea cli options auto triggering complete on enter even if nothing is written --- ui/app/components/TextareaAutocomplete.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/app/components/TextareaAutocomplete.vue b/ui/app/components/TextareaAutocomplete.vue index d833d3a8..93e68c03 100644 --- a/ui/app/components/TextareaAutocomplete.vue +++ b/ui/app/components/TextareaAutocomplete.vue @@ -77,8 +77,9 @@ const appendFlag = (flag: string) => { } const onInput = () => { - showList.value = true - highlightedIndex.value = filteredOptions.value.length ? 0 : -1 + const lastWord = localValue.value.split(/\s+/).pop() || '' + showList.value = lastWord.length > 0 + highlightedIndex.value = (showList.value && filteredOptions.value.length && lastWord.length > 0) ? 0 : -1 } const hideList = () => setTimeout(() => { showList.value = false; highlightedIndex.value = -1 }, 100) @@ -119,9 +120,11 @@ const onKeydown = (e: KeyboardEvent) => { if (el) el.scrollIntoView({ block: 'nearest' }) }) } else if (e.key === 'Enter' || e.key === 'Tab') { + const lastWord = localValue.value.split(/\s+/).pop() || '' const selected = highlightedIndex.value >= 0 && highlightedIndex.value < filteredOptions.value.length ? filteredOptions.value[highlightedIndex.value] : undefined - if (selected) { + // Only autocomplete if there's a partial word being typed + if (selected && lastWord.trim().length > 0) { e.preventDefault() appendFlag(selected.value) } From 2adc529a5bcfae61d15265606f8e1b64c3cf6edf Mon Sep 17 00:00:00 2001 From: arabcoders Date: Fri, 22 Aug 2025 17:21:39 +0300 Subject: [PATCH 2/4] reset dropdown position when writing --- ui/app/components/InputAutocomplete.vue | 11 ++++++++++- ui/app/components/TextareaAutocomplete.vue | 11 +++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ui/app/components/InputAutocomplete.vue b/ui/app/components/InputAutocomplete.vue index 5d020777..2588cb50 100644 --- a/ui/app/components/InputAutocomplete.vue +++ b/ui/app/components/InputAutocomplete.vue @@ -88,7 +88,16 @@ const setDropdownItemRef = (el: Element | ComponentPublicInstance | null, idx: n dropdownItemRefs.value[idx] = el instanceof HTMLElement ? el : null } -watch(filteredOptions, () => dropdownItemRefs.value = Array(filteredOptions.value.length).fill(null)) +watch(filteredOptions, () => { + highlightedIndex.value = filteredOptions.value.length ? 0 : -1 + dropdownItemRefs.value = Array(filteredOptions.value.length).fill(null) + nextTick(() => { + const dropdown = document.querySelector('.dropdown-content') + if (dropdown) { + dropdown.scrollTop = 0 + } + }) +}) const handleKeydown = (e: KeyboardEvent) => { if (!filteredOptions.value.length) { diff --git a/ui/app/components/TextareaAutocomplete.vue b/ui/app/components/TextareaAutocomplete.vue index 93e68c03..ca0d7535 100644 --- a/ui/app/components/TextareaAutocomplete.vue +++ b/ui/app/components/TextareaAutocomplete.vue @@ -82,6 +82,17 @@ const onInput = () => { highlightedIndex.value = (showList.value && filteredOptions.value.length && lastWord.length > 0) ? 0 : -1 } +// Reset scroll position when filtered options change +watch(filteredOptions, () => { + highlightedIndex.value = filteredOptions.value.length > 0 && showList.value ? 0 : -1 + nextTick(() => { + const dropdown = document.querySelector('.dropdown-content') + if (dropdown) { + dropdown.scrollTop = 0 + } + }) +}) + const hideList = () => setTimeout(() => { showList.value = false; highlightedIndex.value = -1 }, 100) const onKeydown = (e: KeyboardEvent) => { From f21fee96a33d8dea3a5deb137651ec70cb752023 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Fri, 22 Aug 2025 17:47:59 +0300 Subject: [PATCH 3/4] refactor: update basic mode watch logic to check config loading state --- ui/app/components/History.vue | 2 +- ui/app/components/NewDownload.vue | 3 ++- ui/app/layouts/default.vue | 10 +++++++++- ui/app/pages/browser/[...slug].vue | 8 ++++++++ ui/app/pages/conditions.vue | 6 +++--- ui/app/pages/console.vue | 4 ++-- ui/app/pages/logs.vue | 4 ++-- ui/app/pages/notifications.vue | 6 +++--- ui/app/pages/presets.vue | 15 ++++++--------- ui/app/pages/tasks.vue | 6 +++--- 10 files changed, 39 insertions(+), 25 deletions(-) diff --git a/ui/app/components/History.vue b/ui/app/components/History.vue index 73e056fb..02601d8f 100644 --- a/ui/app/components/History.vue +++ b/ui/app/components/History.vue @@ -351,7 +351,7 @@ -
+