feat: make user made changes persistent after reload (#1387)

* feat: save user made changes persistent

* fix: remove artifact from user message on the UI

* fix: message Id generation fix
This commit is contained in:
Anirban Kar
2025-02-27 13:34:57 +05:30
committed by GitHub
parent a33a1268c3
commit b98485d99f
6 changed files with 58 additions and 10 deletions

View File

@@ -75,6 +75,29 @@ export class FilesStore {
getFileModifications() {
return computeFileModifications(this.files.get(), this.#modifiedFiles);
}
getModifiedFiles() {
let modifiedFiles: { [path: string]: File } | undefined = undefined;
for (const [filePath, originalContent] of this.#modifiedFiles) {
const file = this.files.get()[filePath];
if (file?.type !== 'file') {
continue;
}
if (file.content === originalContent) {
continue;
}
if (!modifiedFiles) {
modifiedFiles = {};
}
modifiedFiles[filePath] = file;
}
return modifiedFiles;
}
resetFileModifications() {
this.#modifiedFiles.clear();