* feat(SelectionService): enable toolbar visibility on all workspaces
* feat: update selection-hook to v1.0.5
* fix: show toolbar over fullscreen apps
* fix(SelectionService): adjust macOS window type handling for fullscreen apps
* feat: add show/hide toggle for API keys in settings
Introduces an eye icon button to toggle visibility of API keys and tokens in Joplin, Notion, Siyuan, and Yuque settings pages. Refactors input fields to allow users to view or hide sensitive credentials, improving usability and security. Also updates translation keys in AgentsSubscribeUrlSettings for consistency.
* refactor: settings pages to use Input.Password for tokens
Replaced custom password visibility toggles and related styled-components with Ant Design's Input.Password component in Joplin, Notion, Siyuan, and Yuque settings pages. This simplifies the codebase and improves consistency in handling sensitive input fields.
* fix: Improve layout of token input fields in settings
Wrapped token/password input and check button pairs in Joplin, Notion, and Siyuan settings with Ant Design's Space.Compact for better alignment and consistent UI.
* fix: trigger token change handler on blur in settings
Added onBlur event handlers to the Joplin and Siyuan token input fields to ensure token changes are handled when the input loses focus, improving reliability of token updates.
* refactor(ApiKeyList): add a popup for api key list
- ApiKeyList for key management
- ApiKeyListPopup triggerred by a button
- Move formatApiKeys to utils for better reuse
- Simplify apikey related states in ProviderSettings for better
integration with ApiKeyList
- Modify `updateProvider` to accept partial updates
- Update api key placeholder
* fix: strict type
* refactor: support websearch provider
* refactor: remove ApiCheckPopup
* refactor: simplify interfaces for ProviderSetting and WebSearchProviderSetting
* fix: sync input api key between sub-pages, futher simplification
* fix: bold title
* refactor: extract status icon colors
* refactor: add a status indicator to input box on error, update type definitions
* refactor: further simplification, make data flow clearer
* feat: support api key list for preprocess settings
* refactor: better naming, less confusion
* test: add unit tests for asyncInitializer and copy utilities
- Add tests for asyncInitializer class functionality
- Add tests for clipboard copy operations
* refactor(test): improve copy.test.ts structure and maintainability
- Remove complex shared testCopyFunction in favor of individual test cases
- Simplify mock cleanup by removing redundant afterEach
- Split test scenarios into focused, independent test cases
- Improve test readability with clear Chinese comments
- Maintain full test coverage while following TEST_UTILS.md guidelines
- Fix minor formatting in asyncInitializer.test.ts
* test: remove unnecessary test cases
- Remove AsyncInitializer type support test
- Remove maintain separate instances test
- These tests verify language features rather than business logic
* refactor(test): reorganize copy and export test structure
Restructure test organization based on PR review feedback:
- Move export functionality tests from copy.test.ts to export.test.ts
- Remove unnecessary "clipboard API not available" test
- Merge duplicate empty content tests for better coverage
- Add boundary tests for special characters and Markdown formatting
- Fix ESLint formatting issues
Test responsibilities are now clearer:
- copy.test.ts: Focus on clipboard operations (8 tests)
- export.test.ts: Focus on content conversion and edge cases
* fix(test): correct markdown formatting test for list items
Fix the regex pattern to properly handle markdown list items.
Replace with separate patterns to avoid removing
the dash from list items incorrectly.
* fix(test): format prettier style for markdown test
* test: add comprehensive tests for CopyIcon and MinAppIcon components
- Add tests for CopyIcon covering default rendering, className merging, and prop passing
- Add tests for MinAppIcon covering default props, custom size, sidebar mode, styles, and edge cases
- Include snapshot tests for both components
* fix: update test snapshots after component styling changes
Update snapshots for CopyIcon and MinAppIcon components to match current
styled-components implementation (replaces inline styles with generated classes).
* refactor: simplify icon component tests based on PR review feedback
- CopyIcon: replace multiple redundant tests with single snapshot test
- MinAppIcon: remove duplicate test that overlaps with snapshot test
- Keep essential business logic tests for MinAppIcon (sidebar behavior, null return)
- Update test snapshots accordingly
- Changed the default width from 1080 to 960 and height from 670 to 600 for the main window.
- Adjusted minimum width and height settings to match the new defaults, enhancing compatibility with various screen sizes.
* feat(settings): add option to disable hardware acceleration
- Introduced a new setting to allow users to disable hardware acceleration.
- Added corresponding IPC channel and configuration management methods.
- Updated UI components to reflect the new setting and prompt for app restart.
- Localized confirmation messages for hardware acceleration changes in multiple languages.
* fix(settings): add delay before relaunching app after disabling hardware acceleration
- Introduced a 500ms delay before the application relaunches to ensure settings are applied correctly.
- This change improves user experience by allowing time for the setting to take effect before the app restarts.
* fix lint
* fix(settings): handle errors when disabling hardware acceleration
- Wrapped the hardware acceleration disabling function in a try-catch block to manage potential errors.
- Added user feedback through an error message if the operation fails, improving overall robustness.
* feat: enhance citation handling for Perplexity web search results
- Implemented formatting for Perplexity citations in MainTextBlock, including data-citation attributes.
- Updated citation processing in message store and thunk to support new citation structure.
- Added utility functions for link completion based on web search results.
- Enhanced tests to verify correct handling of Perplexity citations and links.
* refactor: streamline chunk processing in OpenAIApiClient
- Replaced single choice handling with a loop to process all choices in the chunk.
- Improved handling of content sources, ensuring fallback mechanisms are in place for delta and message fields.
- Enhanced tool call processing to accommodate missing function names and arguments.
- Maintained existing functionality for web search data and reasoning content processing.
* fix: improve citation handling and web search integration
- Enhanced citation formatting to support legacy data compatibility in messageBlock.ts.
- Updated messageThunk.ts to manage main text block references and citation updates more effectively.
- Removed unnecessary web search flag and streamlined block processing logic.
* fix: improve citation transforms to skip code blocks
- Add withCitationTags for better code structure
- Add tests
- Remove outdated code
- The Citation type in @renderer/types/index.ts is not referenced anywhere, so removed
- Move the actual Citation type from @renderer/pages/home/Messages/CitationsList.tsx to @renderer/types/index.ts
- Allow text selecting in tooltip
* test: update tests
* refactor(messageThunk): streamline citation handling in response processing
- Removed redundant citation block source retrieval during text chunk processing.
- Updated citation references handling to ensure proper inclusion only when available.
- Simplified the logic for managing citation references in both streaming and final text updates.
* refactor: simplify determineCitationSource for backward compatibility
---------
Co-authored-by: one <wangan.cs@gmail.com>
* refactor(messageThunk): streamline loading state management for topics
- Reintroduced the handleChangeLoadingOfTopic function to manage loading states more effectively.
- Updated thunk implementations to ensure loading state is correctly set after message processing.
- Removed commented-out code for clarity and maintainability.
* fix(messageThunk): ensure loading state is managed correctly after message sending
- Added a finally block to guarantee that the loading state is updated after the sendMessage thunk execution.
- Removed commented-out code for improved clarity and maintainability.
* perf(CodePreview: virtual list for shiki code block
- move code highlighting to a hook
- use @tanstack/react-virtual dynamic list for CodePreview
- highlight visible items on demand
* refactor: change absolute position to relative position
* refactor: update shiki styles, set scrollbar color for shiki themes
* feat(provider): add NewAPI provider
* feat(providers): Enhance New API model discovery and configuration
This commit refactors the model fetching mechanism for the "New API" provider to improve user experience and support more detailed model information.
The `NewAPIClient` now fetches models directly from the `/models` endpoint, which provides richer metadata, including a new `supported_endpoint_types` field.
Key changes:
- The "Edit Models" popup now automatically adds a model if its `supported_endpoint_types` are provided by the API, using the first available type.
- The manual "Add Model" popup is now a fallback for models that do not declare their endpoint types.
- A new `NewApiModel` type is introduced to handle the structured API response.
- Added support for the `jina-rerank` endpoint type.
* chore(store): update version to 119 and adjust migration function for state management
* fix: adjust label column flex for New API provider in ModelEditContent and NewApiAddModelPopup
* feat: Implement batch adding for New API provider
* feat: Add useDynamicLabelWidth hook for adaptive label widths in forms and fix localization typos
* fix: update dependencies in various components to include translation function
---------
Co-authored-by: 自由的世界人 <3196812536@qq.com>
- Updated the English and Chinese README files to improve layout and add new language options.
- Removed the Japanese README file as part of the documentation cleanup.
- Enhanced badge visibility and adjusted image sizes for better presentation.
- Added GitHub statistics section to provide insights into project activity.
- Add tests for IndicatorLight component covering size, color conversion, shadow, and animation props
- Add tests for Spinner component with proper motion/react mocking
- Include snapshot tests for both components
- Added margin to the modal close button for improved spacing.
- Removed unnecessary divider in OCR settings for a cleaner layout.
- Set a minimum width for the search max result title to enhance alignment and readability.
- Moved the PH8 provider configuration within the INITIAL_PROVIDERS array for better structure.
- Updated migration logic to ensure the PH8 provider is added and positioned correctly in the state during configuration migration.
- Removed redundant code related to provider initialization in the migration process, streamlining the overall logic.
- Added new localization strings for provider API key management, including confirmation and error messages for existing keys.
- Updated English, Japanese, Russian, Simplified Chinese, and Traditional Chinese localization files to reflect these changes, enhancing user experience and clarity in API key operations.
- Removed the left menu and integrated settings directly into the main panel for a more cohesive user experience.
- Introduced a toggle for advanced settings, allowing users to expand or collapse additional configuration options.
- Updated layout and styling for improved usability, including adjustments to padding and margins.
- Enhanced scroll behavior for the advanced settings section to ensure visibility when expanded.
- Minor adjustments to component imports and state management for better performance and clarity.
- Introduced PH8 provider with configuration and logo.
- Updated SYSTEM_MODELS to include PH8 models.
- Added PH8 to internationalization files for multiple languages.
- Implemented migration logic to integrate PH8 into the existing provider structure.
Co-authored-by: jack.li <jack.li@enflame-tech.com>
* fix(dexieError): initialize database connection before fetching phrases
- Added an `init` method to the `QuickPhraseService` to ensure the Dexie database is opened before retrieving all quick phrases.
- Updated the `getAll` method to call the `init` method, improving reliability in data retrieval.
* fix(QuickPhraseService): ensure database initialization before updating phrases
- Added calls to the `init` method in the `update` and `updateOrder` methods to guarantee the database connection is established before performing updates, enhancing data integrity and reliability.
* fix(QuickPhraseService): prevent multiple database initializations
- Added a static flag to ensure the database initialization occurs only once, preventing redundant calls to the `init` method and improving performance.
* feat(SelectionAssistant): add macOS support and process trust handling
- Updated the selection assistant to support macOS, including new IPC channels for process trust verification.
- Enhanced the SelectionService to check for accessibility permissions on macOS before starting the service.
- Added user interface elements to guide macOS users in granting necessary permissions.
- Updated localization files to reflect macOS support and provide relevant user instructions.
- Refactored selection-related configurations to accommodate both Windows and macOS environments.
* feat(SelectionService): update toolbar window settings for macOS and Windows
- Set the toolbar window to be hidden in Mission Control and accept the first mouse click on macOS.
- Adjusted visibility settings for the toolbar window to ensure it appears correctly on all workspaces, including full-screen mode.
- Refactored the MacProcessTrustHintModal component to improve layout and styling of buttons in the modal footer.
* feat(SelectionToolbar): enhance styling and layout of selection toolbar components
* feat(SelectionService): enhance toolbar window settings and refactor position calculation
* feat(SelectionToolbar): update button padding and add last button padding for improved layout
* chore(dependencies): update selection-hook to version 1.0.2 and refine build file exclusions in electron-builder.yml
* feat(SelectionService): center action window on screen when not following toolbar
* fix(SelectionService): implement workaround to prevent other windows from bringing the app to front on macOS when action window is closed
* fix(SelectionService): refine macOS workaround to prevent other windows from bringing the app to front when action window is closed; update selection-toolbar logo padding in styles
* fix(SelectionService): implement macOS toolbar reload to clear hover status; optimize display retrieval logic
* fix(SelectionService): update macOS toolbar hover status handling by sending mouseMove event instead of reloading the window
* chore: update selection-hook dependency to version 1.0.3 in package.json and yarn.lock
* fix(SelectionService): improve toolbar visibility handling on macOS and ensure focusability of other windows when hiding the toolbar
* chore: update selection-hook dependency to version 1.0.4 in package.json and yarn.lock
---------
Co-authored-by: Teo <cheesen.xu@gmail.com>