Commit Graph

1698 Commits

Author SHA1 Message Date
troyeguo
8535da00ad Refactor components to improve logging and remove console statements
- Removed unnecessary console logs from ImportLocal, TextToSpeech, Header, and Viewer components to clean up the code and enhance performance.
- Streamlined the components for better readability and maintainability by eliminating debug statements that are no longer needed.
2026-06-03 15:44:10 +08:00
troyeguo
6e172670d1 Update styles and components for pin keypad functionality
- Added new styles for pin keypad elements in dark.css and default.css, enhancing visual consistency.
- Refactored component rendering in ProtectionOverlay and MoreSetting to streamline pin key display logic.
- Removed unnecessary background color definitions in protection.css for cleaner styling.
- Updated theme utility to include new selectors for biometric and pin key elements, improving theme management.
2026-06-03 08:32:24 +08:00
troyeguo
cc9ccefb70 Add directory handle verification to LocalFileManager
- Introduced a new method to verify the usability of the directory handle in LocalFileManager, ensuring it is not stale or invalid.
- Updated permission handling logic to clear stored access if the directory handle is found to be unusable.
- Enhanced overall robustness of file access management by checking handle validity before proceeding with operations.
2026-06-02 18:49:41 +08:00
troyeguo
70a6eec5e8 Refactor header component to improve logging and status checks
- Added console logs to display permission status, local usage configuration, and support status in the Header component for better debugging.
- Enhanced the clarity of the code by providing insights into the current state of local file management and configuration settings.
2026-06-02 18:39:18 +08:00
troyeguo
baa6b0b85c Refactor ImportLocal component to streamline supported formats check
- Simplified the filtering logic for supported formats in the ImportLocal component by removing unnecessary file types from the check.
- Improved code readability by consolidating the filter conditions into a single line.
- Ensured that only relevant formats are considered for import, enhancing user experience.
2026-06-02 17:32:48 +08:00
troyeguo
15bc656749 Refactor synchronization conditions in ImportLocal and Manager components
- Updated the cloud synchronization logic in ImportLocal and Manager components to check for the 'isDisableAutoSync' setting before executing the sync function.
- Improved code readability by consolidating the conditional statements for synchronization.
- Ensured consistent behavior across components when handling book imports and synchronization.
2026-06-02 15:07:35 +08:00
troyeguo
3e96ea294c Refactor cloud synchronization logic in ImportLocal and Manager components
- Updated the cloud synchronization calls in ImportLocal and Manager components to conditionally execute based on the default sync option setting.
- Improved code readability by consolidating the cloud sync function calls into a single conditional statement.
- Ensured consistent handling of synchronization after importing books across both components.
2026-06-02 10:25:44 +08:00
troyeguo
4cab7cb6bd Implement fullscreen functionality in OperationPanel component
- Added state management for fullscreen mode in OperationPanel, allowing users to toggle fullscreen and persist the setting.
- Introduced event listeners for fullscreen changes to update the component state accordingly.
- Updated UI elements to reflect the current fullscreen status with appropriate icons and text.
- Enhanced fullscreen handling in common utility functions to support both web and Electron environments.
2026-06-02 10:18:51 +08:00
troyeguo
e43d987be1 Refactor components for improved functionality and UI consistency
- Updated color codes in emptyCover component for better visual consistency.
- Added HTML entity decoding in ImportLocal component to handle special characters in titles.
- Adjusted width of popupNote component for responsive design.
- Enhanced page number handling in PageWidget and ProgressPanel components to prevent errors when page info is unavailable.
- Removed deprecated warning message in accountSetting component for cleaner UI.
- Slightly adjusted sidebar width for better layout.
2026-06-02 10:11:21 +08:00
troyeguo
42752f0d41 Enhance ImportLocal component with URL import functionality
- Added IPC listener for "import-url-from-link" to handle external URL imports.
- Updated handleURLImport method to accept an external URL parameter, improving flexibility.
- Ensured proper cleanup of IPC listener in component lifecycle to prevent memory leaks.
- Refactored URL handling logic for better readability and maintainability.
2026-06-01 11:44:27 +08:00
troyeguo
e0660be64e Add @mozilla/readability dependency and enhance HTML import functionality in ImportLocal component
- Introduced the @mozilla/readability library to improve HTML content extraction from URLs.
- Enhanced the importHtmlFromURL method to fetch, parse, and sanitize HTML content, ensuring relative URLs are converted to absolute.
- Added utility functions for escaping HTML and making URLs absolute within the imported content.
- Updated type definitions to include Readability class for TypeScript support.
2026-06-01 11:16:08 +08:00
troyeguo
4126067539 Implement throttling for resize event handlers across multiple components
- Introduced a `throttle` utility function to optimize resize event handling in the Background, ImportLocal, Header, BookList, Viewer, and main application logic.
- Replaced existing resize event listeners with throttled versions to improve performance and reduce unnecessary re-renders.
- Ensured proper cleanup of event listeners in component lifecycle methods to prevent memory leaks.
2026-05-31 18:06:43 +08:00
troyeguo
38b5cc977c Refactor components to remove console.log statements for cleaner code
- Removed unnecessary console.log statements from BookCardItem, MetadataDialog, SelectBook, TextToSpeech, common utility functions, CoverUtil, and DatabaseService components.
- Improved code readability and maintainability by eliminating debug logs that are no longer needed.
2026-05-31 17:52:59 +08:00
troyeguo
5a00ae3094 Enhance ImportLocal and Manager components with cloud synchronization functionality
- Integrated `cloudSyncFunc` into the ImportLocal component to trigger synchronization after importing books.
- Updated the Manager component to call `cloudSyncFunc` after importing a book.
- Added `cloudSyncFunc` to the props in both ImportLocal and Manager interfaces and their respective state mappings.
2026-05-31 17:27:15 +08:00
troyeguo
0453cd0f72 Refactor book item components to use original file names when configured
- Updated BookCardItem, BookCoverItem, and BookListItem components to conditionally display the original file name without extension based on user settings.
- Introduced getFileNameWithoutExtension utility function to handle file name extraction.
- Removed redundant code in ImportLocal component related to name assignment.
- Adjusted DictSetting component to utilize the new utility for dictionary file name handling.
2026-05-31 15:52:31 +08:00
troyeguo
48ad5a8d8a Implement scroll reset on setting mode change in SettingDialog component 2026-05-31 15:38:05 +08:00
troyeguo
f5b77ef1bc Update localization files to enhance font installation instructions across multiple languages, clarifying that installed fonts will automatically appear in the dropdown list after restarting the application. 2026-05-31 15:34:00 +08:00
troyeguo
79efe9a42a chore: remove IMA sync option due to potential legal issues 2026-05-31 14:39:19 +08:00
troyeguo
9405eb6a7f update es translation 2026-05-30 15:07:01 +08:00
troyeguo
e0ab19e8ce fix bug 2026-05-30 15:06:06 +08:00
troyeguo
f9692ef33c Merge pull request #1611 from FahadBinHussain/fix-windows-dark-titlebar
Make native title bar follow app skin
2026-05-29 17:29:16 +08:00
troyeguo
86908f1c38 refactor: streamline backup and restore processes, improve cover handling 2026-05-29 17:15:15 +08:00
troyeguo
e03ffc90e4 Add URL import functionality and corresponding translations
- Implemented a new option to import books from a URL in the ImportLocal component.
- Added user prompts for entering a book download URL and validation for http/https links.
- Included loading feedback during the download process and error handling for failed imports.
- Updated English and Chinese translations for new URL import features.
2026-05-29 16:26:30 +08:00
Fahad Bin Hussain
29c5830ecc Address native theme review comments 2026-05-29 10:44:13 +06:00
troyeguo
8b30da1a6a Refactor KOReader integration: Move KOReaderUtil to kookit-extra-browser, update sync logic to use getBookPartialMd5 2026-05-28 19:33:30 +08:00
troyeguo
1eecf72051 refactor: consolidate KOReader sync logic into KOReaderUtil class and update related components 2026-05-28 19:23:44 +08:00
troyeguo
1d809d907e refactor: move getBookPartialMd5 function to common.ts and update koReaderSync.ts to use it 2026-05-28 18:53:38 +08:00
troyeguo
ea9d271074 refactor: replace SparkMD5 with CryptoJS for MD5 hashing and remove unused dependencies 2026-05-28 16:46:45 +08:00
troyeguo
ec690aeea9 fix: update localization for SiYuan sync and comment out IMA sync settings 2026-05-28 15:10:43 +08:00
troyeguo
43cb476c1a feat: add SiYuan sync functionality and update localization strings
- Introduced auto sync feature for notes and highlights to SiYuan, including necessary settings for server URL and API token.
- Updated localization files for multiple languages to reflect the removal of "Siyuan" from the description of markdown sync compatibility.
- Ensured consistency across various language files for the updated descriptions.
2026-05-28 11:28:03 +08:00
troyeguo
d884c93108 feat: add IMA sync functionality with API key and client ID support
- Added localization strings for IMA sync in Chinese (zh-CN).
- Introduced new settings for auto-syncing notes and highlights to IMA, including API key and client ID fields.
- Updated the data setting component to manage the new IMA sync state.
- Extended the SettingInfoState interface to include the IMA sync state.
2026-05-28 10:44:01 +08:00
troyeguo
a7e2670809 fix: change jump-return-button-container position to fixed and adjust z-index 2026-05-28 08:32:21 +08:00
troyeguo
23ef459757 feat: implement jump position functionality in reader
- Added handleJumpPosition action to manage jump positions in the Redux store.
- Integrated jump position handling in ContentList and NavList components.
- Updated PageWidget to utilize jump position for navigation and added a return button.
- Removed unused background.css and replaced it with pageWidget.css for styling.
- Enhanced state management in the reader reducer to accommodate jump positions.
2026-05-28 08:28:01 +08:00
Fahad Bin Hussain
1f21f27654 Make native title bar follow app skin 2026-05-27 22:39:29 +06:00
troyeguo
0cbedfbfdf Adjust header report container position for trial expiration notification 2026-05-27 19:02:36 +08:00
troyeguo
7c77f5c913 feat: implement PDF export functionality using iframe for improved rendering 2026-05-26 17:33:30 +08:00
troyeguo
7649ebe141 refactor: rename getRecordsByBookKeys to getRecordsByKeys for consistency 2026-05-26 17:26:13 +08:00
troyeguo
62a88687c4 feat: enhance export functionality for notes and highlights
- Added `toBlob` utility function to convert content strings to Blob objects with appropriate MIME types.
- Implemented `groupByBook` function to group notes and highlights by book name.
- Introduced `sanitizeFileName` function to replace illegal characters in file names with underscores.
- Created `convertNotesData` and `convertHighlightsData` functions to convert notes and highlights to various text formats.
- Updated `exportNotes` and `exportHighlights` functions to support exporting multiple books as ZIP files, including individual files for each book.
- Refactored PDF generation logic to handle multiple books and fallback to HTML if necessary.
- Improved overall code organization and readability.
2026-05-26 17:07:43 +08:00
troyeguo
3cf50a7dad Add recommended layout option and corresponding CSS styles
- Updated zh-CN.json to include a new translation for "Recommended layout".
- Modified dropdownList.tsx to add "Recommended layout" option for book layout selection.
- Introduced kookit.min.css with comprehensive styling rules for various HTML elements, enhancing the visual presentation of content.
2026-05-26 12:56:51 +08:00
troyeguo
db7679a24e Add Tufte CSS, Typebase CSS, and Typo CSS stylesheets
- Introduced Tufte CSS for enhanced typography and layout.
- Added Typebase CSS for foundational typography styles.
- Included Typo CSS for comprehensive typographic control and responsive design.
2026-05-26 12:08:18 +08:00
troyeguo
5930b8358f fix: improve sync configuration checks in Header component 2026-05-26 10:07:43 +08:00
troyeguo
8e0cd83a7c Refactor text-to-speech component to use checkReachPageEnd utility function
- Moved logic for determining if the end of the page is reached into a new utility function `checkReachPageEnd`.
- Added `findLastMatchIndex` helper function to assist with matching visible text against node text.
- Updated the text-to-speech component to utilize the new utility functions for improved readability and maintainability.
- Added console logs for debugging purposes to track visible text lists and last match indices.
2026-05-25 18:17:02 +08:00
troyeguo
1410c236b2 fix: prevent duplicate startup auth checks in ProtectionOverlay 2026-05-24 15:49:26 +08:00
troyeguo
1b180c5916 feat: add toast notification for word not found in dictionary 2026-05-24 15:38:52 +08:00
troyeguo
e650a2d7a5 fix: add error message for metadata fetch failure and improve render timing
- Added a new error message for failed metadata fetching in the Chinese localization file (zh-CN.json).
- Introduced a delay before calling the renderBookFunc in both NavigationPanel and SettingPanel components to improve UI responsiveness.
2026-05-24 11:14:24 +08:00
troyeguo
88f8364d33 feat: add 'About' sidebar item in SettingDialog and update dict service prefix 2026-05-23 18:08:49 +08:00
troyeguo
5ca4a53f1b Fix: Prevent browser support warning in BackupDialog when running in Electron 2026-05-23 17:56:46 +08:00
troyeguo
59b724b65f Refactor metadata dialog to streamline fetching and handling book metadata
- Removed unused imports and code related to Apple and Open Library book items.
- Simplified the metadata fetching logic to use a single API call.
- Updated state management for loading and error handling.
- Cleaned up the metadata application logic to focus on cloud book items.
- Removed the "Get more results" button and related functionality.
2026-05-23 17:26:03 +08:00
troyeguo
38517c421c feat(SettingDialog): update plugin filter to exclude only 'ai' type 2026-05-20 11:16:20 +08:00
troyeguo
058a53f93d chore: remove console.log statements from BookCardItem and useBookItem components 2026-05-20 09:54:47 +08:00