18 Commits

Author SHA1 Message Date
natreex
7f34421212 Add error handling, enhance syncing, and refactor deletion logic
- Introduce new error messages for syncing and book deletion in `en.json`.
- Update `DeleteBook` to support local-only deletion and synced book management.
- Refine offline/online behavior with `deleteLocalToo` checkbox and update related state handling.
- Extend repository and IPC methods to handle optional IDs for updates.
- Add `SyncQueueContext` for queueing offline changes and improving synchronization workflows.
- Enhance refined text generation logic in `DraftCompanion` and `GhostWriter` components.
- Replace PUT with PATCH for world updates to align with API expectations.
- Streamline `AlertBox` by integrating dynamic translation keys for deletion prompts.
2026-01-10 15:50:03 -05:00
natreex
060693f152 Add OAuth login support and streamline authentication flows
- Introduced `oauthLogin` method in `electron/preload.ts` and backend IPC handlers for OAuth via `BrowserWindow`.
- Replaced web-based OAuth redirection with Electron-specific implementation for Google, Facebook, and Apple.
- Refactored `SocialForm.tsx` to handle OAuth login success and token management via Electron.
- Updated `User`, `QuillSense`, and context methods to include `quill-trial` subscriptions and extended login logic.
- Cleaned up code, removed unused imports, and improved error handling for authentication scenarios.
2026-01-08 11:03:19 -05:00
natreex
55cd5d8ed0 Replace i18next with next-intl for translations and dynamic imports. Refactor System API calls to use os.platform() for accurate platform detection. Simplify and clean up dependencies in package.json. 2025-12-24 15:57:18 -05:00
natreex
0366a2d444 - Add multi-language support for registration and user menu components
- Refactor `TextEditor` to include book-closing functionality with updated toolbar buttons
- Replace `generateHTML` with a lightweight custom TipTap-to-HTML renderer
- Update and lock `esbuild` and related dependencies to latest versions
2025-12-23 23:24:17 -05:00
natreex
515d469ba7 Add multi-language support and new repository methods for book synchronization
- Extend repository methods to handle API requests for fetching books, chapters, characters, and other entities with multilingual support (`lang: 'fr' | 'en'`).
- Add `uploadBookForSync` logic to consolidate and decrypt book data for synchronization.
- Refactor schema migration logic to remove console logs and streamline table recreation.
- Enhance error handling across database repositories and IPC methods.
2025-12-22 16:44:12 -05:00
natreex
43c7ef375c Refactor ScribeChapterComponent and offline handlers for seamless local and server operations
- Add stricter typings (`RefObject`) and improve type safety.
- Introduce conditional logic for `localBook` to
2025-12-19 10:39:59 -05:00
natreex
f5e66f8983 Integrate offline logic for book creation and enhance synchronization
- Add offline handling to `AddNewBookForm` by updating `BooksSyncContext` with server-only and local-only book management.
- Refactor `guideTourDone` to check offline completion states via `localStorage`.
- Update and lock dependencies, including `@esbuild` and `@next`, to latest versions.
- Clean up unused session state updates in book creation logic.
2025-12-15 23:03:32 -05:00
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
9e51cc93a8 Remove SyncService and introduce context-based offline mode and state management
- Delete `SyncService` and its associated bidirectional synchronization logic.
- Add multiple context providers (`OfflineProvider`, `AlertProvider`, `LangContext`, `UserContext`, `SessionContext`, `WorldContext`, `SettingBookContext`) for contextual state management.
- Implement `SecureStorage` for OS-level secure data encryption and replace dependency on `SyncService` synchronization.
- Update localization files (`en.json`, `fr.json`) with offline mode and error-related strings.
2025-11-19 22:01:24 -05:00
natreex
f85c2d2269 Add offline mode support with PIN configuration and management
- Introduce `OfflinePinSetup` component for users to configure secure offline access.
- Add new `AIUsageContext` and extend `OfflineProvider` for offline-related state management.
- Implement offline login functionality in `electron/main.ts` with PIN verification and fallback support.
- Enhance IPC handlers to manage offline mode data, PIN setup, and synchronization.
- Update localization files (`en.json`, `fr.json`) with offline mode and PIN-related strings.
- Add `bcrypt` and `@types/bcrypt` dependencies for secure PIN hashing and validation.
- Refactor login and session management to handle offline mode scenarios with improved error handling and flow.
2025-11-19 19:58:55 -05:00
natreex
dde4683c38 Migrate from electron-store to OS-level secure storage (getSecureStorage)
- Replace `electron-store` with OS-level encrypted storage for secure token, userId, and language management in `LocalSystem` and `keyManager`.
- Add `init-user` IPC handler to initialize user data and manage encryption keys.
- Update login process to handle encrypted storage saving with fallback for macOS issues.
- Add offline warning component to `login/page.tsx` to handle first-time sync requirements.
- Remove `electron-store` and associated dependencies from `package.json` and `package-lock.json`.
2025-11-19 19:10:12 -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
3bc30d42ad Remove Story model handling verbal styles and linguistic properties
- Delete `Story` model implementation including `getVerbesStyle` method and related properties.
- Cleanup unused interfaces and redundant logic from the codebase.
2025-11-17 21:32:42 -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
09768aafcf Implement synchronization, offline data handling, and intelligent request routing
- Add services for offline data management, including `offline-data.service.ts`, ensuring data is saved to a local database and synced with the server when online.
- Introduce bidirectional `SyncService` for managing data synchronization with conflict resolution and retry mechanisms.
- Create `data.service.ts` to handle smart routing between local database and server API based on connectivity status.
- Update models and logic to support comprehensive synchronization for books, chapters, characters, and conversations.
- Implement event listeners for online/offline detection and automatic sync scheduling.
2025-11-17 07:47:15 -05:00
natreex
b4eafca3bc Add comprehensive models and script for handling inline scripts and structured data
- Implement `remove-inline-scripts.js` to externalize Next.js inline scripts, enhancing CSP compliance.
- Add models for `Book`, `Character`, `Story`, `Editor`, `System`, and `BookSerie` with relevant properties and utilities.
- Include macOS entitlements plist for app development with advanced permissions.
- Add utility functions to handle script hashing, cookie management, and content formatting.
2025-11-16 19:56:14 -05:00