Remove inclusion status tracking and toggle functionality for files and URLs

This commit is contained in:
2026-05-07 23:28:26 +02:00
parent 6e7daafb83
commit 8e6d868954

View File

@@ -14,7 +14,6 @@ type FileEntry = {
name: string;
type: string;
size: string;
include: boolean;
};
type UrlEntry = {
@@ -23,7 +22,6 @@ type UrlEntry = {
name: string;
type: "url";
size: string;
include: boolean;
};
type RowEntry = FileEntry | UrlEntry;
@@ -187,13 +185,6 @@ export default function App() {
};
}, [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) => {
if (!paths.length) return;
setStatus("Indexing files...");
@@ -212,7 +203,6 @@ export default function App() {
name: item.name,
type: item.type,
size: item.size,
include: true,
});
}
});
@@ -258,7 +248,6 @@ export default function App() {
name,
type: "url",
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 () => {
if (!ollamaModel || ollamaModel === "Select model...") {
window.alert("Please select a model first.");