RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
fix(web): harden rename flows and dialog UX (#22068)
chanx447979593942
diff --git a/web/src/components/compilation-template-group/components/template-preview-header.tsx b/web/src/components/compilation-template-group/components/template-preview-header.tsxindex b138dd1415..d9b2d9cc0c 100644--- a/web/src/components/compilation-template-group/components/template-preview-header.tsx+++ b/web/src/components/compilation-template-group/components/template-preview-header.tsx@@ -36,11 +36,17 @@ export function TemplatePreviewHeader({const { t } = useTranslation();return (- <section className="shrink-0 flex justify-between items-center px-5 py-4 border-b border-border-button">- <span className="text-lg font-medium text-text-primary">+ <section className="shrink-0 flex justify-between items-center gap-4 px-5 py-4 border-b border-border-button">+ {/* The preview title mirrors the template name as the user types it;+ keep a very long name inside the header instead of letting it+ overlap the actions on the right. */}+ <span+ className="min-w-0 flex-1 truncate text-lg font-medium text-text-primary"+ title={templateName || undefined}+ >{templateName || t('common.name')}</span>- <div className="flex items-center gap-2">+ <div className="flex shrink-0 items-center gap-2"><JsonPreviewSheetopen={jsonSheetOpen}onOpenChange={onJsonSheetOpenChange}diff --git a/web/src/components/create-compilation-template-group-dialog.tsx b/web/src/components/create-compilation-template-group-dialog.tsxindex 9ebde07ef5..62eae8917b 100644--- a/web/src/components/create-compilation-template-group-dialog.tsx+++ b/web/src/components/create-compilation-template-group-dialog.tsx@@ -61,9 +61,18 @@ export function CreateCompilationTemplateGroupDialog({onOpenChange(false);}, [onOpenChange]);+ // Clicking the overlay must not dismiss the dialog: the editor holds a+ // partially filled template and a stray click outside would discard it.+ const handlePointerDownOutside = useCallback((event: Event) => {+ event.preventDefault();+ }, []);+return (<Dialog open={open} onOpenChange={onOpenChange}>- <DialogContent className="max-w-5xl h-[85vh] flex flex-col gap-0 p-0">+ <DialogContent+ className="max-w-5xl h-[85vh] flex flex-col gap-0 p-0"+ onPointerDownOutside={handlePointerDownOutside}+ ><DialogHeader className="mx-0 mt-0 shrink-0 px-5 py-4"><DialogTitle>{t('knowledgeCompilation.addTemplateGroup')}diff --git a/web/src/components/rename-dialog/index.tsx b/web/src/components/rename-dialog/index.tsxindex edb97cd3b8..b8074df104 100644--- a/web/src/components/rename-dialog/index.tsx+++ b/web/src/components/rename-dialog/index.tsx@@ -45,8 +45,12 @@ export function RenameDialog({return (<Dialog open onOpenChange={hideModal}><DialogContent className="sm:max-w-[425px]" data-testid="rename-modal">- <DialogHeader>- <DialogTitle>{title || t('common.rename')}</DialogTitle>+ <DialogHeader className="min-w-0">+ {/* The title may be an existing entity name; keep a very long+ name on one line so it cannot push the dialog wider. */}+ <DialogTitle className="truncate">+ {title || t('common.rename')}+ </DialogTitle></DialogHeader><RenameForminitialName={initialName}diff --git a/web/src/pages/memories/hooks.ts b/web/src/pages/memories/hooks.tsindex a88e0abe52..741c1de889 100644--- a/web/src/pages/memories/hooks.ts+++ b/web/src/pages/memories/hooks.ts@@ -49,6 +49,7 @@ export const useCreateMemory = () => {if (response.code !== 0) {throw new Error(response.message || 'Failed to create memory');}+ queryClient.invalidateQueries({ queryKey: MemoryKeys.list() });queryClient.invalidateQueries({ queryKey: MemoryKeys.filters() });return response.data;},@@ -232,9 +233,6 @@ export const useDeleteMemory = () => {onSuccess: () => {message.success(t('message.deleted'));},- onError: (error) => {- message.error(t('message.error', { error: error.message }));- },});const deleteMemory = useCallback(@@ -274,6 +272,7 @@ export const useUpdateMemory = () => {queryClient.invalidateQueries({queryKey: [MemoryApiAction.FetchMemoryDetail],});+ queryClient.invalidateQueries({ queryKey: MemoryKeys.list() });queryClient.invalidateQueries({ queryKey: MemoryKeys.filters() });},});@@ -323,24 +322,22 @@ export const useRenameMemory = () => {const onMemoryRenameOk = useCallback(async (data: ICreateMemoryProps, callBack?: () => void) => {- let res;- if (memory?.id) {- try {+ let saved = false;+ try {+ if (memory?.id) {await updateMemory({- // ...memoryDataTemp,name: data.name,- id: memory?.id,+ id: memory.id,} as unknown as IMemoryAppDetailProps);- } catch (e) {- console.error('error', e);+ } else {+ await createMemory(data);}- } else {- res = await createMemory(data);+ saved = true;+ } catch {+ // Request failures are already reported by the request layer; keep+ // the dialog open so the user can retry.}- // if (res && !memory?.id) {- // navigateToMemory(res?.id)();- // }- if (res) {+ if (saved) {callBack?.();handleHideModal();}diff --git a/web/src/pages/next-searches/hooks.ts b/web/src/pages/next-searches/hooks.tsindex 72b9251789..004d54e43c 100644--- a/web/src/pages/next-searches/hooks.ts+++ b/web/src/pages/next-searches/hooks.ts@@ -35,14 +35,11 @@ interface CreateSearchProps {}interface CreateSearchResponse {- id: string;- name: string;- description: string;+ search_id: string;}export const useCreateSearch = () => {const { t } = useTranslation();-const {data,isError,@@ -59,9 +56,6 @@ export const useCreateSearch = () => {onSuccess: () => {message.success(t('message.created'));},- onError: (error) => {- message.error(t('message.error', { error: error.message }));- },});const createSearch = useCallback(@@ -286,9 +280,6 @@ export const useDeleteSearch = () => {onSuccess: () => {message.success(t('message.deleted'));},- onError: (error) => {- message.error(t('message.error', { error: error.message }));- },});const deleteSearch = useCallback(@@ -369,33 +360,38 @@ export const useRenameSearch = () => {const onSearchRenameOk = useCallback(async (name: string, callBack?: () => void) => {- let res;setLoading(true);- if (search?.id) {- try {+ let saved = false;+ try {+ if (search?.id) {const response = await searchService.getSearchDetail({- search_id: search?.id,+ search_id: search.id,});const detail = response.data?.data;// oxlint-disable-next-line typescript/no-unused-varsconst { id, created_by, update_time, ...searchDataTemp } = detail;- res = await updateSearch({+ await updateSearch({...searchDataTemp,- name: name,- search_id: search?.id,+ name,+ search_id: search.id,} as unknown as IUpdateSearchProps);- } catch (e) {- console.error('error', e);+ saved = true;+ } else {+ const created = await createSearch({ name });+ if (created && !search?.id) {+ navigateToSearch(created.search_id)();+ saved = true;+ }}- } else {- res = await createSearch({ name: name });- }- if (res && !search?.id) {- navigateToSearch(res?.search_id)();+ } catch {+ // Request failures are already reported by the request layer; keep+ // the dialog open so the user can retry.+ } finally {+ // Always release the loading state, even when the request throws.+ setLoading(false);}- setLoading(false);- if (res) {+ if (saved) {callBack?.();handleHideModal();}