Commit Graph

10 Commits

Author SHA1 Message Date
natreex
64c7cb6243 Update database schema and synchronization logic
- Add `useEffect` in `ScribeLeftBar` for handling book state changes.
- Extend `BooksSyncContext` with new properties and stricter typings.
- Refine `Repositories` to include `lastUpdate` handling for synchronization processes.
- Add comprehensive `fetchComplete*` repository methods for retrieving entity-specific sync data.
- Enhance offline logic for chapters, characters, locations, and world synchronization.
- Improve error handling across IPC handlers and repositories.
2025-12-15 20:55:24 -05:00
natreex
bb331b5c22 Add BooksSyncContext, refine database schema, and enhance synchronization support
- Introduce `BooksSyncContext` for managing book synchronization states (server-only, local-only, to-sync, etc.).
- Remove `UserContext` and related dependencies.
- Refine localization strings (`en.json`) with sync-related updates (e.g., "toSyncFromServer", "toSyncToServer").
- Extend database schema with additional tables and fields for syncing books, chapters, and related entities.
- Add `last_update` fields and update corresponding repository methods to support synchronization logic.
- Enhance IPC handlers with stricter typing, data validation, and sync-aware operations.
2025-12-07 14:36:03 -05:00
natreex
db2c88a42d Add offline mode logic for main chapters and refine IPC handlers
- Integrate `OfflineContext` into `MainChapter` and related components to handle offline scenarios for chapter operations.
- Add conditional logic to toggle between server API requests and offline IPC handlers (`db:chapter:add`, `db:chapter:remove`).
- Extend `GET /book/story` endpoint to include `mainChapter` data.
- Refactor IPC handlers for chapters to accept structured data arguments with stricter typings.
- Update frontend key assignments for `BookList` component for improved rendering stability.
2025-11-26 23:17:25 -05:00
natreex
23f1592c22 Add offline mode logic for book, story, and world operations
- Integrate `OfflineContext` into book, story settings, and related components.
- Add conditional logic to toggle between server API requests and offline IPC handlers (`db:book:delete`, `db:book:story:get`, `db:location:all`, etc.).
- Refactor and update IPC handlers to accept structured data arguments for improved consistency (`data: object`).
- Ensure stricter typings in IPC handlers and frontend functions.
- Improve error handling and user feedback in both online and offline modes.
2025-11-26 22:52:34 -05:00
natreex
ac95e00127 Integrate offline support and improve error handling across app
- Add `OfflineContext` to manage offline state and interactions within components.
- Refactor session logic in `ScribeControllerBar` and `page.tsx` to handle offline scenarios (e.g., check connectivity before enabling GPT features).
- Enhance offline PIN setup and verification with better flow and error messaging.
- Optimize database IPC handlers to initialize and sync data in offline mode.
- Refactor code to clean up redundant logs and ensure stricter typings.
- Improve consistency and structure in handling online and offline operations for smoother user experience.
2025-11-26 15:25:53 -05:00
natreex
71d13e2b12 Refactor IPC handlers to enforce consistent return types and enhance type definitions
- Update return types for IPC handlers in `character.ipc.ts`, `chapter.ipc.ts`, and `location.ipc.ts` for stricter type safety.
- Introduce new type definitions for better structure and clarity.
- Remove redundant console logs and unnecessary comments for cleaner code.
2025-11-18 23:01:52 -05:00
natreex
75e5d71c74 Add ipc/chapter.ipc.ts to handle chapter-related database interactions
- Introduce IPC handlers in `ipc/chapter.ipc.ts` for chapter CRUD, content management, and related operations.
- Register chapter IPC module in `main.ts` for application-wide access.
- Enhance type definitions for chapter functionalities, improving code consistency.
- Refactor `ipc/book.ipc.ts` to include new `UpdateStoryData` interface and additional story update handler.
2025-11-18 22:42:18 -05:00
natreex
361a1b0b7c Refactor ipc/book.ipc.ts for streamlined IPC handlers and additional type definitions
- Reorganize and reformat IPC handlers for improved readability and structure.
- Add missing type definitions for `StoryData`, `AddWorldElementData`, `SetAIGuideLineData`, and others.
- Simplify handler functions by enforcing consistent parameter usage and return types.
- Remove outdated comments, redundant logic, and placeholder TODOs.
2025-11-18 22:26:59 -05:00
natreex
d018e75be4 Remove DataService and OfflineDataService, refactor book and character operations to use streamlined handlers in LocalSystem
- Delete `data.service.ts` and `offline-data.service.ts`, consolidating functionality into `LocalSystem`.
- Refactor book, character, and conversation operations to adopt unified, multilingual, and session-enabled IPC handlers in `LocalSystem`.
- Simplify redundant legacy methods, enhancing maintainability and consistency.
2025-11-18 21:02:38 -05:00
natreex
d46aecc80d Integrate session management, multilingual IPC handlers, and Book database operations
- Add `LocalSystem` with handlers for session retrieval (`userId`, `lang`) and error handling.
- Extend IPC handlers to support multilingual operations (`fr`, `en`) and session data injection
2025-11-18 19:51:17 -05:00