mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 20:43:36 +00:00
Merge main into feat/extend-models-support
Resolved conflicts: - feature_list.json: Merged all features from both branches - feature-loader.js: Included both model/thinkingLevel and error fields - board-view.tsx: Merged model/thinkingLevel and error fields, kept currentProject check - settings-view.tsx: Merged CLI status checks with navigation/scroll code - app-store.ts: Included both model/thinkingLevel and error fields in Feature interface Fixed linting errors in settings-view.tsx
This commit is contained in:
@@ -76,6 +76,7 @@ export interface ElectronAPI {
|
||||
exists: (filePath: string) => Promise<boolean>;
|
||||
stat: (filePath: string) => Promise<StatResult>;
|
||||
deleteFile: (filePath: string) => Promise<WriteResult>;
|
||||
trashItem?: (filePath: string) => Promise<WriteResult>;
|
||||
getPath: (name: string) => Promise<string>;
|
||||
saveImageToTemp?: (data: string, filename: string, mimeType: string) => Promise<SaveImageResult>;
|
||||
autoMode?: AutoModeAPI;
|
||||
@@ -150,6 +151,7 @@ const mockFeatures = [
|
||||
const STORAGE_KEYS = {
|
||||
PROJECTS: "automaker_projects",
|
||||
CURRENT_PROJECT: "automaker_current_project",
|
||||
TRASHED_PROJECTS: "automaker_trashed_projects",
|
||||
} as const;
|
||||
|
||||
// Mock file system using localStorage
|
||||
@@ -370,6 +372,10 @@ export const getElectronAPI = (): ElectronAPI => {
|
||||
return { success: true };
|
||||
},
|
||||
|
||||
trashItem: async () => {
|
||||
return { success: true };
|
||||
},
|
||||
|
||||
getPath: async (name: string) => {
|
||||
if (name === "userData") {
|
||||
return "/mock/userData";
|
||||
@@ -828,6 +834,11 @@ export interface Project {
|
||||
lastOpened?: string;
|
||||
}
|
||||
|
||||
export interface TrashedProject extends Project {
|
||||
trashedAt: string;
|
||||
deletedFromDisk?: boolean;
|
||||
}
|
||||
|
||||
export const getStoredProjects = (): Project[] => {
|
||||
if (typeof window === "undefined") return [];
|
||||
const stored = localStorage.getItem(STORAGE_KEYS.PROJECTS);
|
||||
@@ -869,3 +880,14 @@ export const removeProject = (projectId: string): void => {
|
||||
const projects = getStoredProjects().filter((p) => p.id !== projectId);
|
||||
saveProjects(projects);
|
||||
};
|
||||
|
||||
export const getStoredTrashedProjects = (): TrashedProject[] => {
|
||||
if (typeof window === "undefined") return [];
|
||||
const stored = localStorage.getItem(STORAGE_KEYS.TRASHED_PROJECTS);
|
||||
return stored ? JSON.parse(stored) : [];
|
||||
};
|
||||
|
||||
export const saveTrashedProjects = (projects: TrashedProject[]): void => {
|
||||
if (typeof window === "undefined") return;
|
||||
localStorage.setItem(STORAGE_KEYS.TRASHED_PROJECTS, JSON.stringify(projects));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user