Avoid graphics flickering during node operations

This commit is contained in:
yangdx
2025-03-14 23:25:38 +08:00
parent 1ae65c9272
commit 5decd03e2e
7 changed files with 300 additions and 121 deletions

View File

@@ -15,16 +15,22 @@ export const TabVisibilityProvider: React.FC<TabVisibilityProviderProps> = ({ ch
// Get current tab from settings store
const currentTab = useSettingsStore.use.currentTab();
// Initialize visibility state with current tab as visible
// Initialize visibility state with all tabs visible
const [visibleTabs, setVisibleTabs] = useState<Record<string, boolean>>(() => ({
[currentTab]: true
'documents': true,
'knowledge-graph': true,
'retrieval': true,
'api': true
}));
// Update visibility when current tab changes
// Keep all tabs visible when current tab changes
useEffect(() => {
setVisibleTabs((prev) => ({
...prev,
[currentTab]: true
'documents': true,
'knowledge-graph': true,
'retrieval': true,
'api': true
}));
}, [currentTab]);