mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
feat: implement notifications and event history features
- Added Notification Service to manage project-level notifications, including creation, listing, marking as read, and dismissing notifications. - Introduced Event History Service to store and manage historical events, allowing for listing, retrieval, deletion, and replaying of events. - Integrated notifications into the server and UI, providing real-time updates for feature statuses and operations. - Enhanced sidebar and project switcher components to display unread notifications count. - Created dedicated views for managing notifications and event history, improving user experience and accessibility. These changes enhance the application's ability to inform users about important events and statuses, improving overall usability and responsiveness.
This commit is contained in:
@@ -161,6 +161,18 @@ export function getAppSpecPath(projectPath: string): string {
|
||||
return path.join(getAutomakerDir(projectPath), 'app_spec.txt');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the notifications file path for a project
|
||||
*
|
||||
* Stores project-level notifications for feature status changes and operation completions.
|
||||
*
|
||||
* @param projectPath - Absolute path to project directory
|
||||
* @returns Absolute path to {projectPath}/.automaker/notifications.json
|
||||
*/
|
||||
export function getNotificationsPath(projectPath: string): string {
|
||||
return path.join(getAutomakerDir(projectPath), 'notifications.json');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the branch tracking file path for a project
|
||||
*
|
||||
@@ -335,6 +347,57 @@ export async function ensureIdeationDir(projectPath: string): Promise<string> {
|
||||
return ideationDir;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Event History Paths
|
||||
// ============================================================================
|
||||
|
||||
/**
|
||||
* Get the event history directory for a project
|
||||
*
|
||||
* Contains stored event records for debugging and replay.
|
||||
*
|
||||
* @param projectPath - Absolute path to project directory
|
||||
* @returns Absolute path to {projectPath}/.automaker/events
|
||||
*/
|
||||
export function getEventHistoryDir(projectPath: string): string {
|
||||
return path.join(getAutomakerDir(projectPath), 'events');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event history index file path
|
||||
*
|
||||
* Stores an index of all events for quick listing without scanning directory.
|
||||
*
|
||||
* @param projectPath - Absolute path to project directory
|
||||
* @returns Absolute path to {projectPath}/.automaker/events/index.json
|
||||
*/
|
||||
export function getEventHistoryIndexPath(projectPath: string): string {
|
||||
return path.join(getEventHistoryDir(projectPath), 'index.json');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the file path for a specific event
|
||||
*
|
||||
* @param projectPath - Absolute path to project directory
|
||||
* @param eventId - Event identifier
|
||||
* @returns Absolute path to {projectPath}/.automaker/events/{eventId}.json
|
||||
*/
|
||||
export function getEventPath(projectPath: string, eventId: string): string {
|
||||
return path.join(getEventHistoryDir(projectPath), `${eventId}.json`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the event history directory for a project if it doesn't exist
|
||||
*
|
||||
* @param projectPath - Absolute path to project directory
|
||||
* @returns Promise resolving to the created events directory path
|
||||
*/
|
||||
export async function ensureEventHistoryDir(projectPath: string): Promise<string> {
|
||||
const eventsDir = getEventHistoryDir(projectPath);
|
||||
await secureFs.mkdir(eventsDir, { recursive: true });
|
||||
return eventsDir;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Global Settings Paths (stored in DATA_DIR from app.getPath('userData'))
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user