From 6410853e34d5b9cd9167226629056d91b5b83153 Mon Sep 17 00:00:00 2001 From: cibere <71997063+cibere@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:38:28 -0800 Subject: [PATCH 1/7] add `CopyText` to recyclebin, log folder, flow tips, and userdata folder results in sys plugin --- Plugins/Flow.Launcher.Plugin.Sys/Main.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs index 1ec07915d..a11a169de 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs @@ -133,6 +133,8 @@ namespace Flow.Launcher.Plugin.Sys private List Commands() { var results = new List(); + var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version); + var userDataPath = DataLocation.DataDirectory() results.AddRange(new[] { new Result @@ -294,6 +296,7 @@ namespace Flow.Launcher.Plugin.Sys SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_openrecyclebin"), IcoPath = "Images\\openrecyclebin.png", Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe74d"), + CopyText = "shell:RecycleBinFolder", Action = c => { { @@ -386,9 +389,9 @@ namespace Flow.Launcher.Plugin.Sys Title = "Open Log Location", SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_log_location"), IcoPath = "Images\\app.png", + CopyText = logPath, Action = c => { - var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version); context.API.OpenDirectory(logPath); return true; } @@ -398,6 +401,7 @@ namespace Flow.Launcher.Plugin.Sys Title = "Flow Launcher Tips", SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_docs_tips"), IcoPath = "Images\\app.png", + CopyText = Constant.Documentation, Action = c => { context.API.OpenUrl(Constant.Documentation); @@ -409,9 +413,10 @@ namespace Flow.Launcher.Plugin.Sys Title = "Flow Launcher UserData Folder", SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_userdata_location"), IcoPath = "Images\\app.png", + CopyText = userDataPath, Action = c => { - context.API.OpenDirectory(DataLocation.DataDirectory()); + context.API.OpenDirectory(userDataPath); return true; } }, From 29c9fd69ad857d4bc79ccd0765fdf9ea3df502dc Mon Sep 17 00:00:00 2001 From: cibere <71997063+cibere@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:45:32 -0800 Subject: [PATCH 2/7] add `AutoCompleteText` key to some results in the sys plugin --- Plugins/Flow.Launcher.Plugin.Sys/Main.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs index a11a169de..7d240e89a 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs @@ -134,7 +134,8 @@ namespace Flow.Launcher.Plugin.Sys { var results = new List(); var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version); - var userDataPath = DataLocation.DataDirectory() + var userDataPath = DataLocation.DataDirectory(); + var recycleBinFolder = "shell:RecycleBinFolder"; results.AddRange(new[] { new Result @@ -296,11 +297,12 @@ namespace Flow.Launcher.Plugin.Sys SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_openrecyclebin"), IcoPath = "Images\\openrecyclebin.png", Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe74d"), - CopyText = "shell:RecycleBinFolder", + CopyText = recycleBinFolder, + AutoCompleteText = recycleBinFolder, Action = c => { { - System.Diagnostics.Process.Start("explorer", "shell:RecycleBinFolder"); + System.Diagnostics.Process.Start("explorer", recycleBinFolder); } return true; @@ -390,6 +392,7 @@ namespace Flow.Launcher.Plugin.Sys SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_log_location"), IcoPath = "Images\\app.png", CopyText = logPath, + AutoCompleteText = logPath, Action = c => { context.API.OpenDirectory(logPath); @@ -402,6 +405,7 @@ namespace Flow.Launcher.Plugin.Sys SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_docs_tips"), IcoPath = "Images\\app.png", CopyText = Constant.Documentation, + AutoCompleteText = Constant.Documentation, Action = c => { context.API.OpenUrl(Constant.Documentation); @@ -414,6 +418,7 @@ namespace Flow.Launcher.Plugin.Sys SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_userdata_location"), IcoPath = "Images\\app.png", CopyText = userDataPath, + AutoCompleteText = userDataPath, Action = c => { context.API.OpenDirectory(userDataPath); From 5b344fb53cad6fee62612680aebff55907fb3aed Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 9 Dec 2024 13:23:28 +0800 Subject: [PATCH 3/7] Improve windows index search with special character --- .../Search/WindowsIndex/QueryConstructor.cs | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs index a35bad274..9e3707fbe 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs @@ -1,10 +1,14 @@ using System; +using System.Text.RegularExpressions; using Microsoft.Search.Interop; namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex { public class QueryConstructor { + private static Regex _specialCharacterMatcher = new(@"[\@\@\#\#\&\&*_;,\%\|\!\(\)\{\}\[\]\^\~\?\\""\/\:\=\-]+", RegexOptions.Compiled); + private static Regex _multiWhiteSpacesMatcher = new(@"\s+", RegexOptions.Compiled); + private Settings settings { get; } private const string SystemIndex = "SystemIndex"; @@ -76,8 +80,39 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex if (userSearchString.IsWhiteSpace()) userSearchString = "*"; + // Remove any special characters that might cause issues with the query + var replacedSearchString = ReplaceSpecialCharacterWithTwoSideWhiteSpace(userSearchString); + // Generate SQL from constructed parameters, converting the userSearchString from AQS->WHERE clause - return $"{CreateBaseQuery().GenerateSQLFromUserQuery(userSearchString.ToString())} AND {RestrictionsForAllFilesAndFoldersSearch} ORDER BY {FileName}"; + return $"{CreateBaseQuery().GenerateSQLFromUserQuery(replacedSearchString)} AND {RestrictionsForAllFilesAndFoldersSearch} ORDER BY {FileName}"; + } + + /// + /// If one special character have white space on one side, replace it with one white space. + /// So command will not have "[special character]+*" which will cause OLEDB exception. + /// + private static string ReplaceSpecialCharacterWithTwoSideWhiteSpace(ReadOnlySpan input) + { + const string whiteSpace = " "; + + var inputString = input.ToString(); + + // Use regex to match special characters with whitespace on one side + // and replace them with a single space + var result = _specialCharacterMatcher.Replace(inputString, match => + { + // Check if the match has whitespace on one side + bool hasLeadingWhitespace = match.Index > 0 && char.IsWhiteSpace(inputString[match.Index - 1]); + bool hasTrailingWhitespace = match.Index + match.Length < inputString.Length && char.IsWhiteSpace(inputString[match.Index + match.Length]); + if (hasLeadingWhitespace || hasTrailingWhitespace) + { + return whiteSpace; + } + return match.Value; + }); + + // Remove any extra spaces that might have been introduced + return _multiWhiteSpacesMatcher.Replace(result, whiteSpace).Trim(); } /// From fe4fcf6cc0a75d94fe274d6c055fdf70ce336aeb Mon Sep 17 00:00:00 2001 From: cibere <71997063+cibere@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:53:25 -0800 Subject: [PATCH 4/7] remove `AutoCompleteText` from the Open Recycle Bin result in sys plugin --- Plugins/Flow.Launcher.Plugin.Sys/Main.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs index 7d240e89a..2d5847cde 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs @@ -298,7 +298,6 @@ namespace Flow.Launcher.Plugin.Sys IcoPath = "Images\\openrecyclebin.png", Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe74d"), CopyText = recycleBinFolder, - AutoCompleteText = recycleBinFolder, Action = c => { { From 26b33b9e13ef714c82f43e2faf0fbe1ca4333ed8 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sat, 14 Dec 2024 10:22:09 -0600 Subject: [PATCH 5/7] add Hebrew in available languages --- Flow.Launcher.Core/Resource/AvailableLanguages.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Resource/AvailableLanguages.cs b/Flow.Launcher.Core/Resource/AvailableLanguages.cs index 46c1ecb54..c385cd8e8 100644 --- a/Flow.Launcher.Core/Resource/AvailableLanguages.cs +++ b/Flow.Launcher.Core/Resource/AvailableLanguages.cs @@ -28,6 +28,7 @@ namespace Flow.Launcher.Core.Resource public static Language Czech = new Language("cs", "čeština"); public static Language Arabic = new Language("ar", "اللغة العربية"); public static Language Vietnamese = new Language("vi-vn", "Tiếng Việt"); + public static Language Hebrew = new Language("he", "עברית"); public static List GetAvailableLanguages() @@ -57,7 +58,8 @@ namespace Flow.Launcher.Core.Resource Turkish, Czech, Arabic, - Vietnamese + Vietnamese, + Hebrew }; return languages; } From e8bbbda75b243cc3025d55a031ad8e2071f3b6e6 Mon Sep 17 00:00:00 2001 From: Yusyuriv Date: Sun, 15 Dec 2024 00:27:25 +0600 Subject: [PATCH 6/7] Add European date formats in settings --- .../SettingPages/ViewModels/SettingsPaneThemeViewModel.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs index 8a835ba7c..8d8ccb780 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs @@ -132,7 +132,9 @@ public partial class SettingsPaneThemeViewModel : BaseModel "ddd dd'/'MM", "dddd dd'/'MM", "dddd dd', 'MMMM", - "dd', 'MMMM" + "dd', 'MMMM", + "dd.MM.yy", + "dd.MM.yyyy" }; public string TimeFormat From 243ebb8df23dfc2119683a8c1d7b9bfff48c6017 Mon Sep 17 00:00:00 2001 From: NoPlagiarism <37241775+NoPlagiarism@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:35:29 +0500 Subject: [PATCH 7/7] ci: fix permissions + migrate to fresher action (Pr Assign) (#3117) * ci: fix permissions + migrate to fresher action * ci: remove unnecessary comment --- .github/workflows/pr_assignee.yml | 10 +++++----- .github/workflows/pr_milestone.yml | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_assignee.yml b/.github/workflows/pr_assignee.yml index af6daff02..44b808885 100644 --- a/.github/workflows/pr_assignee.yml +++ b/.github/workflows/pr_assignee.yml @@ -1,19 +1,19 @@ name: Assign PR to creator -# Due to GitHub token limitation, only able to assign org members not authors from forks. -# https://github.com/thomaseizinger/assign-pr-creator-action/issues/3 - on: - pull_request: + pull_request_target: types: [opened] branches-ignore: - l10n_dev +permissions: + pull-requests: write + jobs: automation: runs-on: ubuntu-latest steps: - name: Assign PR to creator - uses: thomaseizinger/assign-pr-creator-action@v1.0.0 + uses: toshimaru/auto-author-assign@v2.1.1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr_milestone.yml b/.github/workflows/pr_milestone.yml index b343a39cc..b17912be0 100644 --- a/.github/workflows/pr_milestone.yml +++ b/.github/workflows/pr_milestone.yml @@ -6,6 +6,9 @@ on: pull_request: types: [opened] +permissions: + pull-requests: write + jobs: automation: runs-on: ubuntu-latest