Commit graph

963 commits

Author SHA1 Message Date
Jack251970
2529efeed1 Filter out disabled plugins from valid plugin list
Previously, the code only excluded modified plugins from the valid plugin list. This update adds an additional check to also exclude plugins marked as disabled in their metadata, ensuring that disabled plugins are not considered valid or processed further.
2026-02-26 17:15:29 +08:00
Jack251970
1294d722f2 Improve action keyword management in plugin metadata
Prevent duplicate action keywords by checking for existence before adding. Remove all instances of an old action keyword instead of just the first. Ensures action keyword lists remain unique and consistent.
2026-02-26 17:12:46 +08:00
Jack251970
3b771d155d Add locking for thread safety in GetNonGlobalPlugins
Wrap kvp.Value access in a lock when copying to nonGlobalPlugins
to prevent race conditions and ensure thread safety during
concurrent access.
2026-02-26 17:07:41 +08:00
Jack251970
452e60f3b5 Use GetNonGlobalPlugins() instead of field access
Replaced direct _nonGlobalPlugins field access with the GetNonGlobalPlugins() method to improve encapsulation and ensure up-to-date plugin data is used when retrieving non-global plugins by action keyword. No other logic was changed.
2026-02-26 17:07:09 +08:00
Jack251970
8760fe29ee Return deep copy in GetNonGlobalPlugins to protect state
GetNonGlobalPlugins now returns a new dictionary with copied lists,
preventing external modification of the internal _nonGlobalPlugins
collection. This change improves encapsulation and safeguards
plugin manager state integrity.
2026-02-26 17:05:12 +08:00
Jack251970
b8bc7fa82d Support multiple plugins per action keyword
Refactor non-global plugin storage to allow multiple plugins to share the same action keyword by using ConcurrentDictionary<string, List<PluginPair>>. Update all relevant methods to handle lists of plugins, ensure thread safety, and adjust the QueryBuilder logic accordingly. This change improves extensibility and flexibility in plugin management.
2026-02-26 16:54:03 +08:00
Jack251970
39b2869cae Deprecate ActionKeywordRegistered, update API docs
Mark ActionKeywordRegistered as obsolete and always return false, reflecting support for multiple plugins per action keyword. Update IPublicAPI docs to clarify ActionKeywordAssigned is for legacy compatibility.
2026-02-26 16:33:39 +08:00
Jack Ye
118d6e2a73
Fix incomplete plugin directory deletion on uninstall (#4250)
Some checks failed
Build / build (push) Has been cancelled
2026-02-21 22:34:53 +11:00
Jack Ye
48f67b1886
Improve and fix query result update logic issue & provide access to exact query typed by user (#3502) 2025-11-26 21:15:12 +11:00
Jack251970
2adbc334a2 Improve semaphore lock handling and code robustness
Added `lockAcquired` flags in `PluginsManifest.cs` and `Main.cs`
to ensure semaphore locks are only released if successfully
acquired, preventing potential runtime errors. Updated `finally`
blocks to conditionally release locks based on these flags.

Removed redundant cancellation check in `EverythingAPI.cs` to
simplify code, assuming cancellation is handled elsewhere. These
changes enhance reliability and maintainability of the codebase.
2025-11-07 15:30:07 +08:00
Jack251970
88fd1e56d0 Handle OperationCanceledException gracefully
Added a `catch` block for `OperationCanceledException` in
`PluginsManifest.cs` to ignore canceled operations. Updated
`EverythingAPI.cs` to use cancellation tokens with `_semaphore.WaitAsync`
and handle cancellations by exiting the method cleanly with `yield break`.
2025-11-06 20:47:54 +08:00
Jack251970
fbeaafa8d3 Remove Score = -100 from result objects in PluginManager
Removed the `Score = -100` property from multiple result objects
in `PluginManager.cs` to simplify the code and improve clarity.
Adjusted the formatting and structure to ensure proper syntax
and maintain code consistency. This includes changes to result
objects that handle re-querying and exception handling.
2025-10-16 18:47:15 +08:00
Jack251970
68454a8a6e Change log level for plugin constructor timing message
Updated the log level for the plugin constructor cost message
from `LogInfo` to `LogDebug` to reduce verbosity in production
logs and make this information available primarily during
debugging sessions.
2025-10-16 18:43:19 +08:00
Jeremy Wu
386737acac
update method parameter style 2025-10-16 20:20:51 +11:00
Jack Ye
adfd5425f0
Merge branch 'dev' into plugin_initialization 2025-10-14 21:53:43 +08:00
Jack Ye
592440f2b1
Merge pull request #3982 from Flow-Launcher/squirrel_upgrade
Upgrade Nuget Packages
2025-10-14 19:54:21 +08:00
Jack Ye
a2d12eb225
Merge branch 'dev' into plugin_initialization 2025-10-05 19:25:01 +08:00
Jack Ye
5ae159de5b
Move to iNKORE.UI.WPF.Modern UI Framework (#3593) 2025-10-05 13:44:40 +03:00
Jack251970
6f6292494c Use ContainsKey(id) for O(1) lookup instead of O(n) iteration 2025-10-03 16:13:24 +08:00
Jack251970
54e693d0e2 Add functions in Check Initializing & Init Failed region 2025-10-03 16:03:54 +08:00
Jack251970
8a2edf274a Add AutoCompleteText property for results 2025-10-03 15:36:32 +08:00
Jack251970
171eb2dd8b Data race on _allLoadedPlugins (List) across threads 2025-10-03 15:28:11 +08:00
Jack251970
76cc22d5af Use TryRemove and discard out var to clean up action keywords 2025-10-03 15:21:11 +08:00
Jack251970
2be10eb4ca Add translation for plugin failed to respond & Improve translations for plugin stil initializing 2025-10-02 22:26:28 +08:00
Jack251970
297cb5c3ef Return results to tell users that this plugin is still initializing 2025-10-02 22:23:07 +08:00
Jack251970
9a20b0e0de Expose initialized plugins via PublicAPI 2025-10-02 21:59:05 +08:00
Jack251970
66fb1d7c60 Register plugin action keywords when plugins are loaded 2025-10-02 21:52:31 +08:00
Jack251970
5ed94c8abc Resolve conflicts 2025-10-02 20:25:45 +08:00
Jack Ye
6213193cda
Merge branch 'dev' into plugin_initialization 2025-10-02 20:22:20 +08:00
Jack251970
ca94ef58e8 Fix build issue 2025-09-28 11:46:55 +08:00
Jack Ye
b34851bd12
Merge branch 'dev' into squirrel_upgrade 2025-09-28 11:37:18 +08:00
Jack Ye
2d00ab1d3e
Merge pull request #4011 from Flow-Launcher/flow_launcher_localization1
Use Flow.Launcher.Localization to improve code quality
2025-09-28 00:04:14 +08:00
Jack251970
54622d6759 Fix Flow.Launcher.Localization contentHash issue 2025-09-23 17:53:04 +08:00
Jack251970
0a7ed3b52f Add AbstractPluginEnvironment.API back 2025-09-23 17:52:49 +08:00
Jack251970
0e366a6269 Use PublicApi.Instance instead of private one 2025-09-23 17:40:54 +08:00
Jack251970
7350c1d4d5 Use Flow.Launcher.Localization to improve code quality 2025-09-23 17:14:30 +08:00
Spencer Stream
fbc88bb4cd Add ini-parser package to Infrastructure project 2025-09-22 19:42:49 -05:00
Jack251970
d6bc053950 Revert changes 2025-09-21 16:46:43 +08:00
Jack251970
fbb9e09237 Improve code quality 2025-09-21 16:19:13 +08:00
Jack251970
2f52c1aa1b Improve code quality 2025-09-21 16:17:31 +08:00
Jack251970
89d726de2a Use getter to fix data location issue 2025-09-21 14:03:43 +08:00
Jack Ye
9211fe476d
Merge branch 'dev' into squirrel_upgrade 2025-09-21 13:42:37 +08:00
Jack Ye
3116f3d363
Merge branch 'dev' into plugin_initialization 2025-09-21 13:22:31 +08:00
Jack Ye
89fca85ca8
Merge pull request #3993 from Flow-Launcher/improve_log
Use Debug instead of Info
2025-09-19 13:27:40 +08:00
Jack251970
7a5e55e5f0 Use Debug instead of Info 2025-09-18 21:06:18 +08:00
Jack251970
0f6245a072 Handle exceptions inside ChangeLanguageAsync to avoid unobserved task crashes 2025-09-18 18:18:02 +08:00
Jack251970
86581e6a00 Add disposable for internalization 2025-09-18 18:17:27 +08:00
Jack251970
330e6c09e7 Add language change lock 2025-09-18 18:07:18 +08:00
Jack251970
6c695f09e7 Use clear function 2025-09-18 17:55:06 +08:00
Jack251970
b05c2c1e1a Remove old dictionaries references to fix possible memory leak 2025-09-18 16:25:21 +08:00