From 6b6909144327ba2b1a94d88e40373c7cd79e0d33 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Tue, 29 Apr 2025 10:16:42 +0800
Subject: [PATCH 1/6] Support filtering dotnet, python, node.js, executable
plugins
---
Flow.Launcher.Plugin/AllowedLanguage.cs | 49 ++++--
.../SettingsPanePluginStoreViewModel.cs | 95 +++++++++++-
.../Views/SettingsPanePluginStore.xaml | 140 +++++++++++-------
.../Views/SettingsPanePluginStore.xaml.cs | 10 +-
4 files changed, 226 insertions(+), 68 deletions(-)
diff --git a/Flow.Launcher.Plugin/AllowedLanguage.cs b/Flow.Launcher.Plugin/AllowedLanguage.cs
index 619a94deb..0d22756a7 100644
--- a/Flow.Launcher.Plugin/AllowedLanguage.cs
+++ b/Flow.Launcher.Plugin/AllowedLanguage.cs
@@ -65,7 +65,42 @@ namespace Flow.Launcher.Plugin
public static bool IsDotNet(string language)
{
return language.Equals(CSharp, StringComparison.OrdinalIgnoreCase)
- || language.Equals(FSharp, StringComparison.OrdinalIgnoreCase);
+ || language.Equals(FSharp, StringComparison.OrdinalIgnoreCase);
+ }
+
+ ///
+ /// Determines if this language is a Python language
+ ///
+ ///
+ ///
+ public static bool IsPython(string language)
+ {
+ return language.Equals(Python, StringComparison.OrdinalIgnoreCase)
+ || language.Equals(PythonV2, StringComparison.OrdinalIgnoreCase);
+ }
+
+ ///
+ /// Determines if this language is a Node.js language
+ ///
+ ///
+ ///
+ public static bool IsNodeJs(string language)
+ {
+ return language.Equals(TypeScript, StringComparison.OrdinalIgnoreCase)
+ || language.Equals(TypeScriptV2, StringComparison.OrdinalIgnoreCase)
+ || language.Equals(JavaScript, StringComparison.OrdinalIgnoreCase)
+ || language.Equals(JavaScriptV2, StringComparison.OrdinalIgnoreCase);
+ }
+
+ ///
+ /// Determines if this language is a executable language
+ ///
+ ///
+ ///
+ public static bool IsExecutable(string language)
+ {
+ return language.Equals(Executable, StringComparison.OrdinalIgnoreCase)
+ || language.Equals(ExecutableV2, StringComparison.OrdinalIgnoreCase);
}
///
@@ -76,15 +111,9 @@ namespace Flow.Launcher.Plugin
public static bool IsAllowed(string language)
{
return IsDotNet(language)
- || language.Equals(Python, StringComparison.OrdinalIgnoreCase)
- || language.Equals(PythonV2, StringComparison.OrdinalIgnoreCase)
- || language.Equals(Executable, StringComparison.OrdinalIgnoreCase)
- || language.Equals(TypeScript, StringComparison.OrdinalIgnoreCase)
- || language.Equals(JavaScript, StringComparison.OrdinalIgnoreCase)
- || language.Equals(ExecutableV2, StringComparison.OrdinalIgnoreCase)
- || language.Equals(TypeScriptV2, StringComparison.OrdinalIgnoreCase)
- || language.Equals(JavaScriptV2, StringComparison.OrdinalIgnoreCase);
- ;
+ || IsPython(language)
+ || IsNodeJs(language)
+ || IsExecutable(language);
}
}
}
diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs
index 68c69f841..249e4dd42 100644
--- a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs
+++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs
@@ -9,7 +9,75 @@ namespace Flow.Launcher.SettingPages.ViewModels;
public partial class SettingsPanePluginStoreViewModel : BaseModel
{
- public string FilterText { get; set; } = string.Empty;
+ private string filterText = string.Empty;
+ public string FilterText
+ {
+ get => filterText;
+ set
+ {
+ if (filterText != value)
+ {
+ filterText = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ private bool showDotNet = true;
+ public bool ShowDotNet
+ {
+ get => showDotNet;
+ set
+ {
+ if (showDotNet != value)
+ {
+ showDotNet = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ private bool showPython = true;
+ public bool ShowPython
+ {
+ get => showPython;
+ set
+ {
+ if (showPython != value)
+ {
+ showPython = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ private bool showNodeJs = true;
+ public bool ShowNodeJs
+ {
+ get => showNodeJs;
+ set
+ {
+ if (showNodeJs != value)
+ {
+ showNodeJs = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ private bool showExecutable = true;
+ public bool ShowExecutable
+ {
+ get => showExecutable;
+ set
+ {
+ if (showExecutable != value)
+ {
+ showExecutable = value;
+ OnPropertyChanged();
+ }
+ }
+ }
public IList ExternalPlugins =>
App.API.GetPluginManifest()?.Select(p => new PluginStoreItemViewModel(p))
@@ -30,8 +98,29 @@ public partial class SettingsPanePluginStoreViewModel : BaseModel
public bool SatisfiesFilter(PluginStoreItemViewModel plugin)
{
+ // Check plugin language
+ var pluginShown = false;
+ if (AllowedLanguage.IsDotNet(plugin.Language))
+ {
+ pluginShown = ShowDotNet;
+ }
+ else if (AllowedLanguage.IsPython(plugin.Language))
+ {
+ pluginShown = ShowPython;
+ }
+ else if (AllowedLanguage.IsNodeJs(plugin.Language))
+ {
+ pluginShown = ShowNodeJs;
+ }
+ else if (AllowedLanguage.IsExecutable(plugin.Language))
+ {
+ pluginShown = ShowExecutable;
+ }
+ if (!pluginShown) return false;
+
+ // Check plugin name & description
return string.IsNullOrEmpty(FilterText) ||
- App.API.FuzzySearch(FilterText, plugin.Name).IsSearchPrecisionScoreMet() ||
- App.API.FuzzySearch(FilterText, plugin.Description).IsSearchPrecisionScoreMet();
+ App.API.FuzzySearch(FilterText, plugin.Name).IsSearchPrecisionScoreMet() ||
+ App.API.FuzzySearch(FilterText, plugin.Description).IsSearchPrecisionScoreMet();
}
}
diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml b/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
index 5f9e57faa..7867fa980 100644
--- a/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
+++ b/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
@@ -27,8 +27,8 @@
-
-
+
+
@@ -51,60 +51,94 @@
Grid.Column="1"
Margin="5 24 0 0">
-
-
-
-
-
-
+ Orientation="Horizontal">
+
+
+
+
+
+
+
+
+
+
+
+
Date: Tue, 29 Apr 2025 10:46:16 +0800
Subject: [PATCH 2/6] Remove unused image
---
Flow.Launcher/Images/EXE.png | Bin 2173 -> 0 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 Flow.Launcher/Images/EXE.png
diff --git a/Flow.Launcher/Images/EXE.png b/Flow.Launcher/Images/EXE.png
deleted file mode 100644
index ecc91bdb3ab7b81b7a01f5a46cc127a883e6a6ed..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 2173
zcmbVOc~BEq99|F)u$FkWlv-Eqc0&R>mf~Q=
zO6%yL1xE*vPN`aHwH_6Z`bVLTil|f++o@9=!D0)wYQ4a|g^*E;$GEebeQ)3QzTffv
z-fvQpmYOssBs>IypfUPnT{?K9{4;6<_{|Kw`!RS0JComK!FntI1jJ9-?1iA=^|UdI
z%QB?kBx4s7CMJgxd+knuhM-xoUME53QXHH^S!jnw*j;~A2-7BwFjH
zR7OFnku1n1)h1!=Y|Or;|;=DhBR2q
zxF}dD#zZ8FqOejeCR9o(mZP2lOHc`hplWc7P!yLcaj6RST|!{aWisRGx2}%rjhje>vQc)*!La~~`LRwb!!fLt
zc?z|E`7r|^w+4gX#*n_)?S2z1myid-@FiqOG;7RvQb;<*GHw@1CFB7&qxoo@xYk7x
z9OE)FjBQYEJrvH(iWDS)iPUnLLPRL!5|LV|$|2P<(yWx4
z2lwk3(#PT
zdH4gzmjs?nvp}qT--*bemik6E8t$(GoFMt?)(A;nR>~yweWr)Vz>7sNK;EsmmvP;fR?#Bk;hV~U
zD9Dp~^{+kBfCk~9tMNmBKLrziN2VNr+6DS;@hPhWf>U7XSS(Vv?P^Tx-8HGX*7
zR-aW>Sqe{Be87uFMZ{DFSA^AVUAy>LPq_?hV3r)Z6O2Zz9&vNd>Y{`iq-bJWQNTfI
zM4PdqHs!)zZF?WGdCLRo>3=Te=b0n0hUQc0yT*^&5%$C0gAp)67NlL-ip^4>;fl-m
zPW+t7hBi7bdhLp^9TS^ZCC!fs{bs|ClzFp{pGw4Dzp$yfxHfRj*gRL+wXeSXzIFb|
zjw_LZ=$3`kl-mkBRfTY=MJL!Y5C`@Lb$f-bhY
z9qRb&)yUxay$3Y*(NT)VTfKp)6{|X;4cm{_b|EZQnCsRQE{N@!Tz(@orK)YVs%7Nj
z+;#e@#Is9YDOfuG-tw4VS02x7yT0BKZOLeCifRe@yfnLL|8VZenx@v~yWuUvPF@uk
z+?GxX>MZLHVs5OitNi6=UFM<{dsx9c#m?!?6<3Q(W=WzPq>XkBgbGKCL#lL;K^W
zSEbiSR@U@>H?z!^DCjwy_b?7>%er+aY3ewLkz9H|{(iu*_sGIS@?zhj~*!+bdW%sp6eRO$ycYGC8^IKB(
z?3EYWX3EYFTjoAgGQ)+Jc-(@0|Dwg=>-F*nW!gT$aqaSQwhqXd1GTORcyIa$=ht9j
z3pn!N+>8}<@;5iURfuXWQRjoqwzUiQpV_eU;nhghw*c8SxvTSb({^ik4gUv0pOC8C
I6~CnDKgG8Q3jhEB
From 7e50eb542676f711c6e5ed272ff0bb4fac6bf4bc Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Tue, 29 Apr 2025 10:47:13 +0800
Subject: [PATCH 3/6] Code quality
---
Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml | 2 --
1 file changed, 2 deletions(-)
diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml b/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
index 7867fa980..66c1cb1bf 100644
--- a/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
+++ b/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
@@ -377,9 +377,7 @@
Text="{Binding Description, Mode=OneWay}"
TextTrimming="WordEllipsis"
TextWrapping="Wrap" />
-
-
From 9b666d31363796bef10e8f031fe99b7d7e13ee73 Mon Sep 17 00:00:00 2001
From: DB p
Date: Tue, 29 Apr 2025 20:06:46 +0900
Subject: [PATCH 4/6] Add Flyout UI for Filter
---
.../Views/SettingsPanePluginStore.xaml | 55 +++++++++----------
1 file changed, 27 insertions(+), 28 deletions(-)
diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml b/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
index 66c1cb1bf..fde022da7 100644
--- a/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
+++ b/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
@@ -65,34 +65,33 @@
Command="{Binding RefreshExternalPluginsCommand}"
Content="{DynamicResource refresh}"
FontSize="13" />
-
-
-
-
+
Date: Tue, 29 Apr 2025 19:31:37 +0800
Subject: [PATCH 5/6] Adjust margin & Improve ui
---
.../SettingPages/Views/SettingsPanePluginStore.xaml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml b/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
index fde022da7..df9cc3556 100644
--- a/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
+++ b/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
@@ -58,14 +58,14 @@
Orientation="Horizontal">
-