Commit Graph

3846 Commits

Author SHA1 Message Date
qianlifeng d6a2af6f94
feat(system): add ID field to SysCommand and update command handling
* Introduced an `ID` field to the `SysCommand` struct for better command identification.
* Updated command initialization in `Init` method to include unique IDs for each command.
* Modified context data handling to use `CommandID` instead of `CommandTitle` for command lookup.
* Enhanced error messages to reflect the use of command IDs.
2025-07-31 00:33:15 +08:00
qianlifeng 38929cc506
feat(quick-select): implement quick select functionality for item selection
* Added quick select mode to allow users to select items using number keys.
* Introduced `isQuickSelectMode` and related methods in `WoxLauncherController`.
* Updated `WoxListItem` to include `isShowQuickSelect` and `quickSelectNumber`.
* Enhanced UI components to display quick select numbers.
* Improved keyboard handling in `WoxQueryBoxView` for quick select actions.
2025-07-30 23:47:44 +08:00
qianlifeng 096ee65d18
test(app): update `OnGetDynamicSetting` method signature to use `definition.PluginSettingDefinitionItem`
* Changed the method signature in `emptyAPIImpl` and `mockAPI` to accept a callback that returns `definition.PluginSettingDefinitionItem`.
* This improves type safety and aligns with the updated plugin API requirements.
2025-07-30 21:33:36 +08:00
qianlifeng 62fdd3b7c7
feat(mru): Enhance nodejs/python plugin API with MRU restore functionality and dynamic setting improvements
- Updated API interface to support dynamic settings returning PluginSettingDefinitionItem.
- Implemented MRU restore callback in both Node.js and Python plugin hosts.
- Added MRUData model for handling most recently used data.
- Enhanced setting models to include new types and helper functions for creating settings.
- Updated package dependencies for Node.js and Python plugins to the latest versions.
2025-07-30 21:22:37 +08:00
qianlifeng 4b2018934d
feat(mru): Implement Most Recently Used (MRU) functionality across plugins
- Added MRU support to SysPlugin and UrlPlugin, allowing users to access recently used commands and URLs.
- Introduced new data structures for MRU items and context data.
- Updated the query methods to include MRU results based on user settings.
- Modified the settings management to accommodate the new query mode for MRU.
- Enhanced the UI to reflect the changes in query modes and added relevant translations.
- Created a dedicated MRU manager for handling MRU items in the database.
- Updated Flutter UI to support MRU queries and settings.
2025-07-30 19:54:31 +08:00
qianlifeng 9f9cf84ea8
refactor(resource): improve directory cleanup in `Extract` function
* Added checks to remove existing directories before extracting files for hosts, ui, others, and script_plugin_templates.
* Enhanced logging in `StartUIApp` to include the app path in the error message when the UI app does not exist.
2025-07-30 00:16:54 +08:00
qianlifeng fe23eed7b6 fix(windows): validate extracted icon content in `convertIconToImage`
* Added a check to ensure the extracted icon is not empty or fully transparent.
* This prevents issues with displaying icons that do not have valid visual content.
2025-07-29 13:22:30 +08:00
qianlifeng 250f3607f6 fix(windows): fix #4251 ensure case-insensitive checks for app extensions
* Updated `GetAppExtensions` and `ParseAppInfo` methods to perform case-insensitive checks for `.lnk` and `.exe` file extensions.
* This change improves compatibility with file systems that are case-sensitive.
2025-07-29 13:07:26 +08:00
qianlifeng a387b73ceb
fix(test): fix errors in setting cases
* Adjusted title checks to include "Search Google for" for better clarity.
* Updated expected titles in `TestWebSearchPlugin` to reflect accurate search queries.
* Enhanced test descriptions for improved understanding of test cases.
2025-07-27 22:48:32 +08:00
qianlifeng 38a531735c
fix(test): fix title checks in `TestConverterCrypto` for consistency
* Changed title checks to reflect the updated search term "Search Google for".
* Ensures that expected titles in tests match the new search format.
2025-07-27 22:08:33 +08:00
qianlifeng f6dff901c2
feat(ui): rename ui application to `wox-ui` across platforms
* Updated executable names for Windows, macOS, and Linux to `wox-ui`.
* Adjusted related paths in `CMakeLists.txt` and `Makefile`.
* Modified `AppInfo.xcconfig` to reflect the new product name.
2025-07-27 21:57:49 +08:00
qianlifeng 974010a6da
refactor(setting): remove SynableStore interface and related logic
* Eliminated the `SynableStore` interface from `SettingStore` to simplify the architecture.
* Removed the unused `syncStore` field from `SettingValue` struct and its related logic in the `Set` method.
* This change enhances code clarity and maintainability by reducing complexity.
2025-07-18 22:23:18 +08:00
qianlifeng 5be879167f
feat(database): enhance SQLite configuration for improved concurrency
- Configure SQLite with Write-Ahead Logging (WAL) mode for better concurrency.
- Set connection pool settings to optimize database access.
- Execute additional PRAGMA statements for optimal performance.
- Update logging to reflect new database initialization details.

feat(clipboard): migrate clipboard data handling to new settings storage

- Implement migration of clipboard data from legacy JSON to new database-backed storage.
- Introduce methods for managing favorite clipboard items in settings.
- Update clipboard plugin to utilize new favorite management functions.

refactor(setting): improve error logging for settings retrieval

- Replace direct logger calls with `util.GetLogger()` for consistency across settings management.
2025-07-17 22:53:01 +08:00
qianlifeng 734d0f0830
refactor(setting): unify setting store architecture and introduce type-safe value wrappers
- Split Store into separate WoxSettingStore and PluginSettingStore with unified SettingStore interface
- Introduce SettingValue[T] and WoxSettingValue[T] generic wrappers for type-safe setting access
- Refactor PluginSetting to use PluginSettingValue[T] wrappers instead of direct field access
- Remove redundant plugin_setting_test.go and consolidate setting management logic
- Update plugin API, manager, and UI components to work with new setting architecture
- Simplify setting store operations and improve separation of concerns between core and plugin settings

This refactoring provides better type safety, cleaner separation between different setting types,
and a more maintainable architecture for future setting system enhancements.
2025-07-17 21:06:31 +08:00
qianlifeng 405346cc09
refactor(setting): refactor settings management to use a unified store interface and migrate from JSON to SQLite database
- Introduced a new `Store` struct for managing Wox settings and plugin settings with GORM.
- Implemented migration logic to transfer settings from old JSON files to the new SQLite database.
- Updated the `Value` type to handle lazy loading and persistence of setting values.
- Refactored existing settings access in the UI and other components to utilize the new store.
- Added migration tests to ensure data integrity during the transition.
- Enhanced logging for better traceability during migration and settings updates.
2025-07-17 13:53:14 +08:00
qianlifeng 247c970ed2
feat(setting): Refactor settings to use a database-backed store
Refactors the entire settings management system from JSON files to a more robust and scalable SQLite database using GORM. This architectural change lays the foundation for future features like cloud synchronization.

Key changes:
- Introduces a new `database` package with GORM models for all settings and app data.
- Implements a backward-compatible migration system that automatically moves existing users settings from `wox.setting.json` and `wox.app.data.json` to the new `wox.db` file on the first run.
- Moves the database location to `userDataDirectory` to align with the projects data storage conventions.
- Rewrites the `setting.Manager` to be fully database-driven, replacing all file I/O with GORM operations.
- Sacrifices `FavoriteResults` during migration due to the technical limitation of its one-way hash implementation.

This resolves the issue of having scattered JSON configuration and provides a centralized, transactional data store.
2025-07-15 21:47:52 +08:00
qianlifeng 8bc44b0836
feat(setting): save current window position when switching to last_location
* Added logic to save the current window position immediately when the user switches to `last_location`.
* Implemented error handling to log any failures during the save operation.
2025-07-15 18:58:55 +08:00
qianlifeng 59dc4f8bb3 fix(ui): fix last display position not work after restart app. #4222
* Added `SaveWindowPosition` method to `Manager` for saving last window coordinates.
* Introduced API endpoint `/setting/position` to handle window position save requests.
* Updated `getShowAppParams` to utilize saved window position if available.
* Implemented logic in `WoxLauncherController` to save window position after showing the window.
2025-07-13 23:58:12 +08:00
qianlifeng 816f28e3d3 refactor(ui): adjust DataTable row heights for improved layout
* Reduced `headingRowHeight` to 36 for consistency across tables.
* Set `dataRowMinHeight` and `dataRowMaxHeight` to 36 to enhance visual uniformity.
* Updated tooltip labels to use `tr("ui_operation")` for better localization.
2025-07-13 22:28:41 +08:00
qianlifeng 9d9c173ae9 feat(setting): enhance auto backup tips with folder link and dynamic content #4222
* Updated backup tips to include a link to the backup folder.
* Added a new method `getBackupFolder` to retrieve the backup directory.
* Modified the `formField` to accept custom tips for better flexibility.
2025-07-13 22:21:59 +08:00
qianlifeng 093088771c refactor(ui): improve path display #4222
* Updated path handling in the `manager.go` file to use `filepath` instead of `path`.
* This change ensures better compatibility across different operating systems.
2025-07-13 21:44:56 +08:00
qianlifeng 282745707c refactor(ui): improve ComboBox layout in settings views #4222
* Wrapped `ComboBox` in a `SizedBox` to set a fixed width for better UI consistency.
* Enhanced readability and maintainability of the code structure.
2025-07-13 20:43:31 +08:00
qianlifeng 4a87001625 refactor(app): improve UWP app icon retrieval and error handling on windows
* Enhanced error logging for UWP icon retrieval failures.
* Added validation for cached icon paths to ensure they exist.
* Implemented fallback mechanism to search for alternative icon files if the primary icon path is invalid.
* Improved PowerShell command structure for better error handling and output management.
2025-07-13 19:35:19 +08:00
qianlifeng 8c74c5cb63 feat(autostart): enhance autostart configuration handling on windows. fix #4231
* Improved logging for autostart setting mismatches.
* Added functionality to attempt fixing autostart configuration when mismatches are detected.
* Updated registry access methods for better clarity and error handling.
* Introduced `setStartupApproved` and `removeStartupApproved` functions to manage startup approval status in Windows Settings.
2025-07-13 18:48:52 +08:00
qianlifeng 7793308f27 feat(bookmark): add support for loading Edge bookmarks across platforms #4232
* Implemented loading of Edge bookmarks for macOS, Windows, and Linux.
* Added functionality to remove duplicate bookmarks based on name and URL.
* Enhanced the bookmark loading process with a more robust regex pattern for both Chrome and Edge formats.
* Created unit tests to verify the loading and deduplication of bookmarks.
2025-07-13 00:55:36 +08:00
qianlifeng 2f43afedd4 refactor(windows): improve Unicode handling in `queryVersionString`
* Added a check for zero length in `puLen` to prevent unnecessary slice creation.
* Adjusted the slice length for UTF16 conversion to match the actual length needed.
* Enhanced clarity and safety in handling UTF16 strings.
2025-07-12 23:40:04 +08:00
qianlifeng 871182c029 feat(app): enhance app displays on windows, fix #4236
* Implemented `removeDuplicateApps` function to filter out duplicate applications based on `Name` and `Path`.
* Updated `parseShortcut` and `parseExe` methods to utilize the display name from file version info, improving user experience.
* Added logging for removed duplicates and display name resolution for better debugging.
2025-07-12 23:11:32 +08:00
qianlifeng fe183f5bf6
refactor(app): improve unicode handling for shortcut app path on windows. #4236
* Replaced the previous shortcut resolution method with a PowerShell-based approach for better Unicode support.
* Improved error handling for shortcut resolution.
* Cleaned up unused import statements.
2025-07-12 21:53:35 +08:00
qianlifeng 4750fc92ce
feat(setting): add custom Python and Node.js path configuration, fix #4220
* Introduced settings for custom executable paths for Python and Node.js.
* Implemented validation for the provided paths to ensure they are executable.
* Updated UI to allow users to browse and set custom paths.
* Added corresponding translations for new UI elements in English and Chinese.
2025-07-09 19:54:01 +08:00
qianlifeng ea7fe65a0e
feat(setting): add last query mode options, fix #4234
* Introduced new settings for last query mode in the Wox settings UI.
* Added options to preserve the last query or start with an empty query.
* Updated relevant localization files for English, Portuguese, Russian, and Chinese.
2025-07-04 22:11:53 +08:00
qianlifeng d2da6beea6
refactor(clipboard): reduce memory usage
- Implemented ClipboardPlugin to manage clipboard history including text and image data.
- Added functionality to keep track of clipboard history with options to retain text and image history.
- Introduced a SQLite database (ClipboardDB) to store clipboard records, including metadata such as file path, dimensions, and size for images.
- Implemented migration from legacy clipboard data to the new database structure.
- Added settings for managing clipboard history retention duration and primary action preferences.
- Enhanced query capabilities to retrieve recent and favorite clipboard records.
- Implemented periodic cleanup routine to remove expired records and orphaned cache files.
- Added localization support for new features in Chinese (zh_CN).
2025-07-04 22:01:16 +08:00
qianlifeng f219a2efce
fix(cgo): resolve memory leaks in C string handling
* Fixed memory leaks by ensuring proper deallocation of C-allocated strings in `ime_darwin.go` and `window_darwin.go`.
* Added error handling for nil pointers when retrieving current input methods and active window names.
* Updated language files to include new performance profiling options for memory.
2025-06-28 23:27:47 +08:00
xuxwke 713ed58fb2 fix double key conflict, eg: hold ctrl and repeat press other key 2025-06-28 23:17:43 +08:00
qianlifeng 6f801d734b
chore(updater): update version to 2.0.0-beta.3 and fix update error handling
* Updated version number and download URLs for all platforms.
* Enhanced error handling in `checkWoxVersion` to include specific update errors.
* Added new language strings for auto-update status in multiple languages.
* Refactored UI color handling in the about view for better theme support.
2025-06-23 21:48:57 +08:00
qianlifeng a9ad3b0bd3
chore(version): bump 2.0.0-beta.3
* Increment version number to reflect the latest beta release.
2025-06-23 20:25:05 +08:00
qianlifeng 1657a44f19
feat(chat): Delay MCP servers reload to avoid websocket initialization race condition
* Introduced a delay before reloading MCP servers to ensure the websocket server is ready.
* This change prevents potential race conditions during initialization.
2025-06-09 09:58:24 +08:00
qianlifeng c1c6ced55d
feat(ui): Enhance error handling in postData method
* Added try-catch block to handle exceptions during data posting.
* Improved logging for successful and failed requests.
* Ensured robust error reporting for better debugging.
2025-06-08 22:14:02 +08:00
qianlifeng c1a87df75b
feat(test): Implement robust loading strategies for Wox settings
- Added `loadWoxSettingWithFallback` to handle various corrupted JSON scenarios.
- Introduced multiple strategies for loading settings, including normal decoding, JSON repair, and partial loading.
- Enhanced error handling to log issues and default to safe settings when loading fails.
- Created comprehensive tests for loading settings with various corrupted JSON files.
2025-06-08 21:58:13 +08:00
qianlifeng d423296d73
feat(test): Add comprehensive test suite for Wox plugins and core functionality
- Implemented unit tests for URL, system, and web search plugins in `plugin_test.go`.
- Created basic calculator tests and service initialization checks in `simple_test.go`.
- Established a test base with `TestSuite`, `QueryTest`, and utility functions in `test_base.go`.
- Introduced configuration management for tests in `test_config.go`, including environment variable loading.
- Developed environment setup and cleanup tests in `test_environment_test.go`.
- Created isolated test location management in `test_location.go`.
- Implemented a test logger to direct logs to test-specific directories in `test_logger.go`.
- Managed test execution lifecycle with `TestRunner` in `test_runner.go`.
- Added time-related tests for calculator functionality in `time_test.go`.
- Ensured all tests validate the test environment and configurations.
2025-06-08 00:25:32 +08:00
qianlifeng 64b39ce06d
feat(converter): Enhance conversion capabilities and add math module
- Updated the Converter to prioritize math module for complex expressions.
- Improved conversion logic to allow all modules to attempt conversions, not just the original.
- Added user default currency retrieval based on locale settings.
- Enhanced handling of cryptocurrency conversions, including special cases for USD.
- Introduced a new MathModule to handle percentage calculations and related operations.
- Refactored locale detection to a dedicated utility for better maintainability.
- Updated icon references in the Converter plugin.
2025-06-07 23:22:30 +08:00
qianlifeng 4f67fa1c98
feat(ai): add timeout protection for MCP tool listing
* Implemented a timeout mechanism for the `MCPListTools` function to prevent long-running operations.
* Utilized goroutines and channels to handle tool listing asynchronously.
* Enhanced error handling to manage potential panics during tool listing.
* Updated documentation to reflect the new timeout protection feature.
2025-06-03 21:14:28 +08:00
qianlifeng bc54323d5a
docs(plugin): update plugin development guides to indicate AI generation
* Added "(Generated by AI)" to the titles of the Full-featured and Script Plugin Development Guides for clarity.
* This change helps users understand the origin of the documentation.
2025-05-29 23:23:29 +08:00
qianlifeng 4b97ebedf0
doc(plugin): add guides for Script and Full-featured Plugin development
* Introduced `Script Plugin Development Guide` for lightweight plugin creation.
* Added `Full-featured Plugin Development Guide` detailing comprehensive plugin architecture and features.
* Updated `_sidebar.md` to include links to the new guides.
* Enhanced `plugin_summary.md` with new plugin categories and implementation types.
2025-05-29 23:11:07 +08:00
qianlifeng fda4d4df3a
refactor(ui): Refactor ToolbarInfo handling
- Updated toolbar management to utilize new methods for emptying toolbar sides.
- Replaced direct instantiation of ToolbarInfo with emptyRightSide and emptyLeftSide methods for better clarity and maintainability.
- Introduced copyWith method in ToolbarInfo for easier updates to toolbar properties without full re-instantiation.
2025-05-29 22:52:44 +08:00
qianlifeng 4797037ae8
refactor(python_host): improve python module load
* Updated function signatures to include return types for better clarity and type checking.
* Enhanced maintainability and readability of the logger module.
* Ensured consistency across the codebase by applying type hints to all relevant functions.
2025-05-29 22:51:17 +08:00
qianlifeng 872e2873be
feat(ui): enhance item update logic with active filter handling
* Added logic to reapply filters when updating an item if an active filter exists.
* Ensured items are updated directly when no filter is active.
* Updated `updateItems` method to filter items based on the current filter text after updating the original items.
2025-05-29 09:21:58 +08:00
qianlifeng b0a1405d12
feat(updater): implement platform-specific update mechanisms for Windows, macOS, and Linux
* Added `MacOSUpdater` to handle DMG extraction and application updates on macOS.
* Introduced `LinuxUpdater` for managing application updates on Linux systems.
* Implemented `WindowsUpdater` for executing batch scripts to replace the application on Windows.
* Each updater utilizes a shell script or batch file to manage the update process seamlessly.
2025-05-27 11:04:17 +08:00
qianlifeng 8e5adf7c5c
feat(ui): enhance input method switching on query box focus
* Updated the input method switch logic to trigger when the query box gains focus.
* Improved user experience by providing clearer instructions in the UI language files.
* Added a new API endpoint for handling query box focus events.
* Implemented caching for image rendering to reduce flickering during refreshes.
2025-05-26 09:22:22 +08:00
qianlifeng f53df14bf8
feat(wpm): update plugin group names for better clarity
* Changed group names for plugins in `createCommand` method.
* Added translations for "Regular Plugins" and "Script Plugins" in multiple languages.
2025-05-25 22:35:22 +08:00
qianlifeng 21d8d83a1f
feat(script_plugin): enhance script plugin functionality
- Increased notification display duration from 3 to 8 seconds in API implementation.
- Refactored script execution logic in host_script.go to improve error handling and streamline execution.
- Added checks for existing script plugins in WPM plugin creation process, providing options to open or overwrite.
- Enhanced user feedback with localized messages for plugin creation and actions.
- Updated script templates (JavaScript, Python, Bash) to include environment variable documentation and improved action handling.
- Improved UI responsiveness in Flutter by implementing AnimatedSwitcher for list view updates.
- Added validation for viewport height in WoxListController to prevent scrolling issues during initialization.
2025-05-25 21:48:15 +08:00