Commit graph

10849 commits

Author SHA1 Message Date
Jack251970
66fe0b8245 Adjust design-time height in SettingsPaneGeneral.xaml 2025-10-14 23:23:52 +08:00
Jack251970
787ccad384 Refactor history handling with async ResultHelper
Replaced `HistoryHelper` with a new `ResultHelper` class to handle plugin result population asynchronously, improving performance and maintainability. Removed `ExecuteAction` and `QueryAction` properties from `LastOpenedHistoryItem` and updated `QueryHistory` and `MainViewModel` to use `LastOpenedHistoryItems` directly.

Refactored history result generation to support `AsyncAction` in `Result` objects, replacing synchronous plugin queries. Simplified legacy history migration and enhanced support for `HistoryStyle`. Improved error handling, code readability, and UI-related logic for history navigation.
2025-10-14 21:29:22 +08:00
Jack251970
693bae7631 Optimize query result selection handling
Refactored `QueryResultsSelected()` usage by introducing a local
variable `queryResultsSelected` to avoid redundant method calls,
improving efficiency and readability. Added a comment to clarify
the purpose of the variable. Updated conditional logic to use
the new variable instead of directly invoking the method.
2025-10-14 20:47:57 +08:00
Jack251970
f6d5a27e0b Refactor and enhance history management system
Refactored the `History` class to separate query and last opened history into distinct models, introducing `LastOpenedHistoryItem` and deprecating `HistoryItem`. Added a `HistoryStyle` enum and property to allow users to toggle between "Query History" and "Last Opened History." Simplified history display logic and updated the UI with a dropdown for history style selection.

Improved history item display with dynamic action population and relative timestamps. Enhanced performance by optimizing history storage with a maximum limit and streamlined logic for adding/retrieving items. Ensured backward compatibility by migrating legacy history data to the new format.

Updated localization strings, removed deprecated properties, and cleaned up redundant code. Fixed bugs related to inconsistent history actions and edge cases with legacy data.
2025-10-14 20:28:39 +08:00
Jack251970
b84ca9b283 Improve code quality 2025-10-14 19:39:33 +08:00
Jack251970
7fa78f0304 Code cleanup 2025-10-13 15:30:38 +08:00
Jack251970
e3527f47ea Add RecordKey for precise history matching and refactor
Added a `RecordKey` property to `HistoryItem` for unique identification of history records, enabling more accurate matching during queries and executions. Updated `HistoryHelper` methods to utilize `RecordKey` for matching, with fallback to `Title` and `SubTitle`. Enhanced `GetExecuteAction` with error handling, nullable reference types, and improved matching logic. Included `RecordKey` in `History` object creation. Enabled nullable reference types in `HistoryHelper.cs` for better code safety. Refactored code for clarity and maintainability.
2025-10-13 15:27:06 +08:00
Diego Henrique
cc397d45a9
Merge branch 'dev' into feature/history_mode 2025-10-11 15:43:05 -03:00
Jack Ye
01bbb54054
Merge pull request #4038 from AWAS666/dragdropwebsearch
Enable reordering of websearches with drap and drop
2025-10-11 20:49:17 +08:00
01Dri
2b7c2048ef up 2025-10-11 05:26:28 -03:00
Jack Ye
b297f3d3a3
Fix ArgumentOutOfRangeException in WebSearch Plugin (#4041) 2025-10-11 18:34:05 +11:00
01Dri
a3b7c6808b up 2025-10-11 04:29:33 -03:00
01Dri
a1f82e1652 refactor: using count for better performance 2025-10-11 03:47:04 -03:00
01Dri
690d33ece3 up 2025-10-11 03:43:06 -03:00
01Dri
d7579cce9e fix erros 2025-10-11 03:23:14 -03:00
01Dri
e468c48da4 feat: fix erros 2025-10-11 03:15:10 -03:00
01Dri
e6cae1a79b feat: helper 2025-10-11 03:08:23 -03:00
01Dri
95122e91f5 feat: code quality 2025-10-11 02:56:49 -03:00
01Dri
bf2acfec38 feat: code quality 2025-10-11 02:54:29 -03:00
01Dri
9e1b8c1a72 feat: Populate new history system with legacy query history 2025-10-11 02:43:27 -03:00
AWAS666
d7dd89d719 change from remove/insert to move 2025-10-10 11:40:06 +02:00
AWAS666
20a865f012 missing nullchecks and casts 2025-10-10 10:06:54 +02:00
AWAS666
87676d2994 fix: error when dragging downwards 2025-10-10 10:06:42 +02:00
01Dri
8e8e9d35ac code quality 2025-10-10 00:08:27 -03:00
01Dri
545c4208d9 code quality 2025-10-10 00:07:24 -03:00
01Dri
50f5e850dd feat: code quality 2025-10-09 23:47:59 -03:00
AWAS666
b9a43147dc enable reordering with drap and drop on websearches 2025-10-09 12:35:04 +02:00
01Dri
d122276e71 feat: clean imports 2025-10-08 22:09:09 -03:00
01Dri
156cb3055c merge 2025-10-08 22:06:39 -03:00
01Dri
6aa35d592e merge dev 2025-10-08 21:38:10 -03:00
01Dri
b290055e83 feat: up 2025-10-08 21:25:13 -03:00
01Dri
c051c5cd50 feat: new history logic in MainViewModel 2025-10-08 21:15:10 -03:00
01Dri
06711d3b8b feat: Saving actions for history 2025-10-08 21:12:36 -03:00
01Dri
4f2db28196 faet: query action save 2025-10-08 21:12:14 -03:00
01Dri
3681340587 feat: toggle history 2025-10-08 21:11:27 -03:00
01Dri
9e182a2e47 feat: base history model in MainView and refactoring code to replace action between query result or last opened 2025-10-07 00:35:34 -03:00
01Dri
e5736567f6 feat: created a base History model 2025-10-07 00:33:16 -03:00
Jack Ye
5ae159de5b
Move to iNKORE.UI.WPF.Modern UI Framework (#3593) 2025-10-05 13:44:40 +03:00
Jack Ye
8c98aedac2
Merge pull request #4025 from Flow-Launcher/hide_window_before_sleep
Save settings before shutdown/restart to prevent data loss
2025-10-04 19:52:26 +08:00
01Dri
7ba4f8de4a feat: last opened history 2025-10-04 02:19:57 -03:00
Jack Ye
5b0a30774e
Fix code comment typo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-02 19:45:08 +08:00
Jack251970
d08ee30a7a Refactor plugin actions to simplify logic
Removed logoff operation logic and associated return statement.
Eliminated return statement after recycle bin error handling.
Removed async plugin data reload and success message logic.
Simplified theme selector query handling by removing `return false`.
These changes streamline the code and improve maintainability.
2025-10-02 19:43:31 +08:00
Jack251970
167570559f Move settings save to post-confirmation for actions
Previously, `Context.API.SaveAppAllSettings()` was called unconditionally before user confirmation for shutdown, restart, and advanced restart actions. This change ensures settings are only saved if the user confirms the action by clicking "Yes" in the confirmation dialog.

For all three functionalities:
- Moved the settings save call inside the `if (result == MessageBoxResult.Yes)` block.
- Retained the existing logic for executing the respective system commands, with checks for `EnableShutdownPrivilege()` to determine whether to use `PInvoke.ExitWindowsEx` or the `shutdown` command.

This change prevents unnecessary settings saves when the user cancels the action.
2025-10-02 19:42:24 +08:00
Jack251970
e376da4482 Save settings before shutdown/restart to prevent data loss
Added a call to `Context.API.SaveAppAllSettings()` before executing system shutdown, restart, or advanced restart operations. This ensures that any unsaved settings are persisted, reducing the risk of data loss during these actions.
2025-10-02 19:29:46 +08:00
Jack Ye
1b7a475631
Merge pull request #4024 from Flow-Launcher/power_enhancement
Use sleep mode listener to fix modern standby sleep mode issue
2025-10-02 19:19:01 +08:00
01Dri
5fcd01224c feat: text 2025-10-02 00:19:40 -03:00
01Dri
bc1f9d3734 refactor: renaming executed history to last opened history 2025-10-02 00:09:28 -03:00
01Dri
c0369e6e76 feat: radio button with history query option or history executed option 2025-10-02 00:03:48 -03:00
01Dri
3cc4f13f4d feat: New option to show executed results in settings 2025-10-01 23:05:41 -03:00
Jack251970
c27817eaf0 Fix possible null exception 2025-09-30 21:20:00 +08:00