Commit Graph

13 Commits

Author SHA1 Message Date
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
e1abcd9490 Add offline mode logic for chapter operations and refactor IPC handlers
- Integrate `OfflineContext` into `TextEditor` and `ScribeChapterComponent` to handle offline scenarios for chapter CRUD operations.
- Add conditional logic to switch between server API requests and offline IPC handlers (`db:chapter:add`, `db:chapter:remove`, `db:chapter:content:save`, `db:chapter:update`).
- Refactor and rename IPC handlers (`db:chapter:create` to `db:chapter:add`, `db:chapter:delete` to `db:chapter:remove`) for consistency.
- Update UI to disable certain actions when offline (e.g., GhostWriter button).
2025-11-26 22:03:22 -05:00
natreex
9648d9e9be Upgrade database schema to version 2 and remove unused meta_* columns
- Increment `SCHEMA_VERSION` to 2 in `schema.ts`.
- Remove all `meta_*` columns from database tables.
- Add migration logic to handle schema upgrades and clean up unused columns.
- Modify database models and repository methods to exclude `meta_*` fields for stricter typings and improved structure.
- Refactor and optimize query statements across repositories to align with new schema changes.
2025-11-26 19:17:40 -05:00
natreex
736b9a3609 Add openExternal IPC handler and integrate with UI components
- Introduce `openExternal` IPC handler in `electron/main.ts` for opening external links via the default browser or native app.
- Update typings in `electron.d.ts` and `preload.ts` to include `openExternal`.
- Refactor `ComposerRightBar` and `LeftBar` components to leverage `electron.openExternal` for external link actions (e.g., Facebook, Discord).
- Add offline mode logic to filter navigation options in `ComposerRightBar` and `LeftBar`.
- Enhance footer bar to display book titles when chapters are unavailable.
2025-11-26 17:44:55 -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
004008cc13 Refactor imports, streamline database IPC handlers, and improve offline support
- Replace absolute import paths with relative paths for consistency across files.
- Transition database operations in Electron main process to modular handlers in `ipc/book.ipc.ts` using the `createHandler` pattern.
- Update database sync service to use `window.electron.invoke()` for improved reliability and structure.
- Refactor `AddNewBookForm` to handle both online and offline book creation seamlessly.
2025-11-18 21:28:41 -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
d5eb1691d9 Add database schema, encryption utilities, and local database service
- Implement `schema.ts` for SQLite schema creation, indexing, and sync metadata initialization.
- Develop `encryption.ts` with AES-256-GCM encryption utilities for securing database data.
- Add `database.service.ts` to manage CRUD operations with encryption support, user-specific databases, and schema initialization.
- Integrate book, chapter, and character operations with encrypted content handling and sync preparation.
2025-11-17 09:34:54 -05:00
natreex
71067c6fa8 Integrate local database management and IPC handlers into Electron
- Add comprehensive IPC handlers for database operations like books, chapters, characters, and conversations.
- Implement local database initialization and user data encryption.
- Update preload script paths for consistent environment handling.
- Modify `page.tsx` to initialize local database within Electron environment.
- Add new dependencies including `node-sqlite3-wasm` and `electron-rebuild`.
2025-11-17 07:46:20 -05:00
natreex
1e6ebba56d Add login page and social login integration
- Implement `LoginPage`, `LoginForm`, and `SocialForm` components.
- Add language toggle and dynamic title support.
- Update `tsconfig.electron.json` for stricter settings.
- Add `electron-store` and associated types for token storage.
- Update `package.json` scripts and dependencies for Electron compatibility.
2025-11-16 13:20:20 -05:00
natreex
c9cf99e166 Update imports and Electron compatibility
- Removed unnecessary React imports.
- Adjusted package.json scripts for Electron integration.
- Updated components to replace Next.js-specific imports with Electron-compatible alternatives.
- Minor tsconfig.json changes for better compatibility.
2025-11-16 11:55:52 -05:00
natreex
8167948881 Add components for Act management and integrate Electron setup 2025-11-16 11:00:04 -05:00