From 3398dac906ed243d133a8ac32b8097c6e4a8c0e6 Mon Sep 17 00:00:00 2001 From: chanx <1243304602@qq.com> Date: Mon, 1 Sep 2025 11:45:49 +0800 Subject: [PATCH] Fix: Optimize styling and add a search settings loading state #3221 (#9830) ### What problem does this PR solve? Fix: Optimize styling and add a search settings loading state #3221 - Updated the calendar component's background color to use a variable - Modified the Spin component's styling to use the primary text color instead of black - Added a form submission loading state to the search settings component - Optimized the search settings form, unifying the styles of the model selection and input fields ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Kevin Hu --- .../components/originui/calendar/index.less | 6 +++--- web/src/components/ui/spin.tsx | 4 ++-- web/src/pages/next-search/search-setting.tsx | 20 ++++++++++++++++--- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/web/src/components/originui/calendar/index.less b/web/src/components/originui/calendar/index.less index 266d1ef3a..07767a7f5 100644 --- a/web/src/components/originui/calendar/index.less +++ b/web/src/components/originui/calendar/index.less @@ -1,8 +1,8 @@ .rdp-selected { - background-color: #f5f5f529; + background-color: var(--background-highlight); } .range-start { - background-color: #f5f5f5; + background-color: var(--text-secondary); border-top-left-radius: 10px; border-bottom-left-radius: 10px; button { @@ -10,7 +10,7 @@ } } .range-end { - background-color: #f5f5f5; + background-color: var(--text-secondary); border-top-right-radius: 10px; border-bottom-right-radius: 10px; button { diff --git a/web/src/components/ui/spin.tsx b/web/src/components/ui/spin.tsx index 945ae857e..ad024748b 100644 --- a/web/src/components/ui/spin.tsx +++ b/web/src/components/ui/spin.tsx @@ -25,14 +25,14 @@ export const Spin: React.FC = ({ className={cn( 'relative', { - 'after:content-[""] after:absolute after:inset-0 after:z-10 after:bg-black/40 after:transition-all after:duration-300': + 'after:content-[""] after:absolute after:inset-0 after:z-10 after:bg-text-primary/40 after:transition-all after:duration-300 h-full w-full': spinning, }, className, )} > {spinning && ( -
+
= ({ }); const { updateSearch } = useUpdateSearch(); + const [formSubmitLoading, setFormSubmitLoading] = useState(false); const { data: systemSetting } = useFetchTenantInfo(); const onSubmit = async ( formData: IUpdateSearchProps & { tenant_id: string }, ) => { try { + setFormSubmitLoading(true); const { search_config, ...other_formdata } = formData; const { llm_setting, @@ -262,6 +265,8 @@ const SearchSetting: React.FC = ({ setOpen(false); } catch (error) { console.error('Failed to update search:', error); + } finally { + setFormSubmitLoading(false); } }; return ( @@ -486,7 +491,8 @@ const SearchSetting: React.FC = ({ render={({ field }) => ( - *Model + * + {t('chat.model')} = ({ options={rerankModelOptions} triggerClassName={'bg-bg-input'} // disabled={disabled} - placeholder={'model'} + placeholder={t('chat.model')} /> @@ -523,6 +529,7 @@ const SearchSetting: React.FC = ({ = ({ > {t('search.cancelText')} - +