Commit graph

11246 commits

Author SHA1 Message Date
Jack Ye
a773b51ada
Handle recoverable DWM composition exceptions gracefully (#4113) 2025-11-19 22:16:09 +02:00
Jack251970
05f15d9831 Upgrade iNKORE.UI.WPF.Modern and refactor scroll logic
Upgraded `iNKORE.UI.WPF.Modern` to version `0.10.2.1` and
replaced the custom `CustomScrollViewerEx` implementation with
the built-in `ScrollViewerEx` for simplified scrolling behavior.
Updated `Flow.Launcher.Plugin` to version `5.1.0` for compatibility.
Removed unused namespaces and adjusted styles in `Base.xaml`
to align with the new `ScrollViewerEx` usage.
2025-11-18 22:19:02 +08:00
Jeremy Wu
c6c413202c
Merge pull request #4108 from Flow-Launcher/add_sponsor
Add new sponsor to README
2025-11-14 18:11:59 +09:00
Jeremy Wu
f1b80ab90f
Add new sponsor to README 2025-11-14 17:54:45 +09:00
Jack Ye
558240279f
Merge pull request #4103 from Flow-Launcher/dependabot/nuget/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Microsoft.Data.Sqlite-10.0.0
Bump Microsoft.Data.Sqlite from 9.0.10 to 10.0.0
2025-11-13 10:26:05 +08:00
dependabot[bot]
3492aac2c0
Bump Microsoft.Data.Sqlite from 9.0.10 to 10.0.0
---
updated-dependencies:
- dependency-name: Microsoft.Data.Sqlite
  dependency-version: 10.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-11 22:07:56 +00:00
Jack Ye
fc93d0904e
Merge pull request #4072 from Flow-Launcher/program_plugin_index_issue
Fix Possible OperationCancelException for WaitAsync Operations
2025-11-08 11:28:58 +08: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
05c8dd2fe1 Remove unnecessary debug information 2025-11-06 20:48:41 +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
49f89e33b5 Make locking operations cancelable with tokens
Updated `_semaphore.WaitAsync` in `EverythingAPI.cs` to accept a `CancellationToken` and handle `OperationCanceledException` gracefully, returning `false` instead of propagating the exception.

Refactored locking mechanisms in `Main.cs` to use `CancellationToken` for `_win32sLock` and `_uwpsLock`. Added `try-catch` blocks to handle `OperationCanceledException` and ensure proper lock release. Methods now return `emptyResults` when operations are canceled.
2025-11-06 20:46:29 +08:00
Jack251970
d0a47c84b9 Clarify CancellationToken handling in comments
Updated comments to explain the rationale for not directly passing
CancellationToken to methods and instead checking
IsCancellationRequested within locks. This prevents unexpected
OperationCanceledException. Changes made in EverythingAPI.cs
(IsEverythingRunningAsync) and Main.cs (Win32 and UWP program
preparation). No functional changes to the code.
2025-11-06 15:39:19 +08:00
Jack251970
bfaff5cca5 Improve semaphore usage and logging clarity
Added comments in `EverythingAPI.cs` and `Main.cs` to explain
why `CancellationToken` is not directly passed to semaphore
locks, preventing unexpected `OperationCanceledException`.

Updated debug log messages in `Main.cs` for better clarity,
including changing "Start handling programs" to "Start querying
programs". Removed redundant log messages to improve logging
consistency.
2025-11-06 15:32:08 +08:00
Jack251970
30d7f67d42 Refactor token cancellation check for readability
Simplified the `if` statement that checks for token cancellation
by condensing it into a single line. This improves code readability
and eliminates unnecessary line breaks.
2025-11-06 15:30:32 +08:00
Jack251970
7e332fa615 Refactor caching and indexing logic
Added `ResetCache` calls after clearing `_win32s` and `_uwps` lists to ensure proper cache reset during indexing. Updated logic to return `resultList` after setting cache size and expiration for improved clarity. Removed `await Task.WhenAll` to adjust asynchronous flow in the indexing process.
2025-11-06 15:29:38 +08:00
Jack251970
3d8fd1d352 Improve cancellation, locking, and logging mechanisms
Enhanced cancellation handling by adding `token.IsCancellationRequested` checks to improve responsiveness. Refactored locking mechanisms for `_win32sLock` and `_uwpsLock` using `try-finally` blocks to ensure proper acquisition and release, improving thread safety and preventing deadlocks.

Reorganized Win32 and UWP program querying logic for better modularity and readability. Replaced shared collection access with local variables to improve clarity and maintain thread safety. Simplified empty result handling by directly returning `emptyResults` when canceled.

Removed redundant debug log statements to reduce verbosity and updated remaining logs for clarity. Suppressed unused result warnings by replacing direct calls to `EverythingApiDllImport.Everything_GetMajorVersion()` with null-coalescing assignments.
2025-11-06 15:28:13 +08:00
Jack251970
db0c86d50c Remove CancellationToken from semaphore WaitAsync calls
Removed the `CancellationToken` parameter from `WaitAsync` calls
on semaphores in `EverythingAPI.cs` and `Main.cs`. This change
eliminates cancellation support for semaphore waits, likely due
to a design decision prioritizing simplicity or avoiding issues
with cancellation handling.

In `EverythingAPI.cs`, `WaitAsync(token)` was replaced with
`WaitAsync()` in two methods. Similarly, in `Main.cs`, the
`WaitAsync` calls for `_win32sLock` and `_uwpsLock` were updated
to remove the `token` parameter.

Note: This change may impact the ability to gracefully handle
cancellation during semaphore waits.
2025-11-04 14:25:55 +08:00
Jack251970
6e17d5d756 Improve logging for Win32 program lock acquisition
Added a debug log statement to indicate when the lock for
querying Win32 programs is being acquired. This enhances
granularity in logging, making it easier to distinguish
between the acquisition of locks for Win32 and UWP programs.
Improves traceability and debugging of the program's
execution flow.
2025-11-04 12:27:59 +08:00
Jack Ye
e2ac32139c
Merge pull request #4084 from 90gq29/patch-1
Update en.xaml - Typo fix
2025-11-02 11:39:45 +08:00
90gq29
348a83a1d9
Update en.xaml
In standard title case (used for buttons and such), articles or short function words like "a" or "for" shouldn't be capitalized. 

Doesn't seem to be capitalized for stylistic reasons either as "Check for Updates" is capitalized in standard title case.
2025-11-01 15:29:06 +01:00
Jack251970
4cf942ac3a Add detailed debug logging for query execution process
Enhanced logging to provide better traceability and insights:
- Added debug logs for query reception, cache misses, and lock acquisition.
- Logged query cancellation and completion with result counts.
- Added logs for caching results, including item counts and query details.
- Improved logging for filtering and program selection processes.
- Ensured no functional changes to existing query and filtering logic.
2025-10-26 21:01:07 +08:00
Jack251970
f632a4b773 Add caching to QueryAsync and integrate cache reset logic
Introduced a MemoryCache to improve QueryAsync performance by
caching query results, reducing redundant computations. Added
a ResetCache method to reinitialize the cache when settings
are updated. Integrated cache reset calls into settings
property setters to ensure consistency.

Refactored query logic to leverage MemoryCache.GetOrCreateAsync
for streamlined caching. Removed redundant code and debug
logging for improved readability and maintainability. Ensured
thread safety with proper locking mechanisms. Simplified and
consolidated caching logic for better maintainability.
2025-10-26 20:59:29 +08:00
Jack251970
e2fa122362 Improve program indexing with logging and thread safety
Added detailed debug logging to `IndexWin32ProgramsAsync` and
`IndexUwpProgramsAsync` to track the indexing process, including
preparation, start, retrieval, caching, and completion.

Replaced direct updates to `_settings.LastIndexTime` with a
thread-safe lock to prevent race conditions.

Enhanced `IndexProgramsAsync` with a debug log to indicate the
start of indexing for better traceability.

Updated program retrieval logic to process Win32 and UWP programs
in parallel with cancellation support and applied the
`HideUninstallersFilter` for cleaner results.
2025-10-26 20:56:08 +08:00
Jack251970
6a65f8090f Enhance thread safety and refactor reindexing logic
Introduced `_lastIndexTimeLock` to ensure thread-safe access
and updates to `_settings.LastIndexTime`, preventing race
conditions. Refactored reindexing logic to use a `lock` block
for evaluating and updating the reindexing condition.

Added `emptyResults` as a static readonly placeholder list.
Improved code clarity and maintainability without altering
existing functionality.
2025-10-26 20:51:08 +08:00
Jack251970
637d926f7a Remove caching logic and initialize emptyResults list
The caching-related code, including `cacheOptions` and `cache`, has been removed from `Main.cs`, indicating that the caching mechanism is no longer in use or has been refactored elsewhere. Additionally, the `emptyResults` list is now explicitly initialized as an empty list (`[]`). No changes were made to the `Context` property or the `commonUninstallerNames` array.
2025-10-26 20:41:06 +08:00
Jack251970
7f5efc5ca1 Refactor caching and improve QueryAsync method
Removed the `ResetCache` method and its associated calls to streamline caching management and improve performance. Refactored the `QueryAsync` method for better thread safety, synchronization, and exception handling. Simplified UWP and Win32 program filtering logic and removed redundant code. Eliminated manual cache disposal and reset logic, favoring a more efficient and automated caching mechanism. These changes enhance maintainability, responsiveness, and overall plugin performance.
2025-10-26 20:40:37 +08:00
Jack Ye
1885a48241
Merge pull request #4070 from Flow-Launcher/dependabot/github_actions/actions/upload-artifact-5
Bump actions/upload-artifact from 4 to 5
2025-10-25 14:33:11 +08:00
dependabot[bot]
f0584ac853
Bump actions/upload-artifact from 4 to 5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-24 22:05:42 +00:00
Jeremy
0f269455b1 remove duplicate history item sort call 2025-10-21 22:18:29 +11:00
Jeremy
25aa5bf2af show history result sorted descending by execution time 2025-10-21 21:54:38 +11:00
Jeremy
92551c58a5 show distinct records when history style is last opened 2025-10-21 21:53:32 +11:00
Diego Henrique
1bfd147421
BUG: Explorer plugin navigate path should only show results in current path (#4053) 2025-10-21 12:12:45 +11:00
Jeremy
26ad473592 change getting last history item to get the same result if exists 2025-10-19 21:46:02 +11:00
Jeremy
10d3ba268d update history result icon display logic & remove badge icon logic 2025-10-19 20:22:03 +11:00
Jeremy
7883e7a0a9 add result IcoPath & Glyph + handling show badge switching 2025-10-18 10:35:23 +11:00
Jeremy Wu
da4b961686
Merge pull request #3854 from Flow-Launcher/plugin_initialization
Asynchronous Loading & Initialization Plugin Model to Improve Window Startup Speed
2025-10-16 22:08:42 +11:00
Jack Ye
fb84cb03f3
Improve code comments
Co-authored-by: Jeremy Wu <jeremy24wu@gmail.com>
2025-10-16 18:48:17 +08:00
Jack Ye
c9e3c628e8
Improve code comments
Co-authored-by: Jeremy Wu <jeremy24wu@gmail.com>
2025-10-16 18:48:07 +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
bd880d304e
update wording 2025-10-16 20:46:35 +11:00
Jeremy Wu
386737acac
update method parameter style 2025-10-16 20:20:51 +11:00
Jack Ye
3690042d2c
Fix DialogJump UriFormatException when navigating to root directories (#4052) 2025-10-15 20:12:51 +11:00
Jack251970
c00d804073 Resolve conflicts 2025-10-15 13:07:43 +08:00
Jack Ye
e2abc1b265
Merge branch 'dev' into plugin_initialization 2025-10-15 13:06:14 +08:00
Jack Ye
3d9ef2c63f
Merge pull request #4042 from 01Dri/feature/history_mode
Add "Last opened" history mode & Fix non-result history item save issue
2025-10-15 12:47:45 +08:00
Jack251970
b13c29ab91 Record user selection after successful execution 2025-10-15 12:40:00 +08:00
Jack251970
df4f08b071 Add exception logging to ResultHelper catch block
Updated the `catch` block in the `ResultHelper` class to explicitly catch `System.Exception` and log the error using `App.API.LogException`. The log includes the class name, a failure message for querying results, and the exception details. This improves error visibility and debugging.
2025-10-15 12:35:53 +08:00
Jack Ye
83cab764a1
Fix typos
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-15 12:30:59 +08:00
Jack251970
b784a14aee Update tooltip text for historyStyleTooltip
The tooltip text for the key `historyStyleTooltip` was updated to improve capitalization and consistency. "History" and "Home Page" were capitalized to align with the formatting of other keys in the file.
2025-10-15 12:28:54 +08:00