Skip to content

Commit 0e6a805

Browse files
committed
fix bug
1 parent 161761e commit 0e6a805

4 files changed

Lines changed: 3 additions & 30 deletions

File tree

ui/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<html lang="en">
2+
<html lang="en" translate="no">
33
<head>
44
<meta charset="UTF-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

ui/src/contexts/TabContext.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ interface TabContextType {
1515
setActiveTab: (tabId: string) => void;
1616
selectDAG: (fileName: string, title: string) => void;
1717
getActiveFileName: () => string | null;
18-
validateTabs: (existingFileNames: Set<string>) => void;
1918
}
2019

2120
const STORAGE_KEY = 'dagu_dag_tabs';
@@ -114,22 +113,6 @@ export function TabProvider({ children }: { children: React.ReactNode }) {
114113
}
115114
}, [tabs, closeTab]);
116115

117-
// Remove tabs for DAGs that no longer exist
118-
const validateTabs = useCallback((existingFileNames: Set<string>) => {
119-
setTabs(prev => {
120-
const validTabs = prev.filter(t => existingFileNames.has(t.fileName));
121-
if (validTabs.length !== prev.length) {
122-
// Some tabs were removed, update active tab if needed
123-
if (activeTabId && !validTabs.some(t => t.id === activeTabId)) {
124-
const newActiveId = validTabs.length > 0 ? validTabs[0]?.id ?? null : null;
125-
setActiveTabId(newActiveId);
126-
}
127-
return validTabs;
128-
}
129-
return prev;
130-
});
131-
}, [activeTabId]);
132-
133116
const setActiveTab = useCallback((tabId: string) => {
134117
setActiveTabId(tabId);
135118
}, []);
@@ -171,7 +154,6 @@ export function TabProvider({ children }: { children: React.ReactNode }) {
171154
setActiveTab,
172155
selectDAG,
173156
getActiveFileName,
174-
validateTabs,
175157
};
176158

177159
return (

ui/src/features/dags/components/dag-list/DAGTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ function DAGTable({
11001100
<Search className="h-4 w-4" />
11011101
</div>
11021102
<Input
1103-
type="search"
1103+
type="text"
11041104
placeholder="Search..."
11051105
value={searchText}
11061106
onChange={(e) => handleSearchTextChange(e.target.value)}

ui/src/pages/dags/index.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function DAGsContent() {
4848
const searchState = useSearchState();
4949
const remoteKey = appBarContext.selectedRemoteNode || 'local';
5050
const { preferences, updatePreference } = useUserPreferences();
51-
const { tabs, activeTabId, selectDAG, addTab, closeTab, getActiveFileName, validateTabs } = useTabContext();
51+
const { tabs, activeTabId, selectDAG, addTab, closeTab, getActiveFileName } = useTabContext();
5252

5353
const defaultFilters = React.useMemo<DAGDefinitionsFilters>(
5454
() => ({
@@ -236,15 +236,6 @@ function DAGsContent() {
236236
};
237237
}, [data]);
238238

239-
// Validate tabs against existing DAGs - remove tabs for deleted DAGs
240-
// Only validate when not filtering (no search text or tag filter active)
241-
React.useEffect(() => {
242-
const isFiltering = apiSearchText || apiSearchTag;
243-
if (!isFiltering && dagFiles.length > 0) {
244-
const existingFileNames = new Set(dagFiles.map(d => d.fileName));
245-
validateTabs(existingFileNames);
246-
}
247-
}, [dagFiles, validateTabs, apiSearchText, apiSearchTag]);
248239

249240
const pageChange = (page: number) => {
250241
addSearchParam('page', page.toString());

0 commit comments

Comments
 (0)