Remove inclusion status tracking and toggle functionality for files and URLs
This commit is contained in:
23
src/App.tsx
23
src/App.tsx
@@ -14,7 +14,6 @@ type FileEntry = {
|
|||||||
name: string;
|
name: string;
|
||||||
type: string;
|
type: string;
|
||||||
size: string;
|
size: string;
|
||||||
include: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type UrlEntry = {
|
type UrlEntry = {
|
||||||
@@ -23,7 +22,6 @@ type UrlEntry = {
|
|||||||
name: string;
|
name: string;
|
||||||
type: "url";
|
type: "url";
|
||||||
size: string;
|
size: string;
|
||||||
include: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type RowEntry = FileEntry | UrlEntry;
|
type RowEntry = FileEntry | UrlEntry;
|
||||||
@@ -187,13 +185,6 @@ export default function App() {
|
|||||||
};
|
};
|
||||||
}, [files]);
|
}, [files]);
|
||||||
|
|
||||||
const includeMap = useMemo(() => {
|
|
||||||
const map: Record<string, boolean> = {};
|
|
||||||
files.forEach((f) => (map[f.path] = f.include));
|
|
||||||
websites.forEach((w) => (map[w.url] = w.include));
|
|
||||||
return map;
|
|
||||||
}, [files, websites]);
|
|
||||||
|
|
||||||
const addFilesByPath = async (paths: string[], expandDirs: boolean) => {
|
const addFilesByPath = async (paths: string[], expandDirs: boolean) => {
|
||||||
if (!paths.length) return;
|
if (!paths.length) return;
|
||||||
setStatus("Indexing files...");
|
setStatus("Indexing files...");
|
||||||
@@ -212,7 +203,6 @@ export default function App() {
|
|||||||
name: item.name,
|
name: item.name,
|
||||||
type: item.type,
|
type: item.type,
|
||||||
size: item.size,
|
size: item.size,
|
||||||
include: true,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -258,7 +248,6 @@ export default function App() {
|
|||||||
name,
|
name,
|
||||||
type: "url",
|
type: "url",
|
||||||
size: "web",
|
size: "web",
|
||||||
include: true,
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
@@ -290,18 +279,6 @@ export default function App() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleInclude = (row: RowEntry) => {
|
|
||||||
if (row.kind === "file") {
|
|
||||||
setFiles((prev) =>
|
|
||||||
prev.map((f) => (f.path === row.path ? { ...f, include: !f.include } : f))
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
setWebsites((prev) =>
|
|
||||||
prev.map((w) => (w.url === row.url ? { ...w, include: !w.include } : w))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const onRephrase = async () => {
|
const onRephrase = async () => {
|
||||||
if (!ollamaModel || ollamaModel === "Select model...") {
|
if (!ollamaModel || ollamaModel === "Select model...") {
|
||||||
window.alert("Please select a model first.");
|
window.alert("Please select a model first.");
|
||||||
|
|||||||
Reference in New Issue
Block a user