Skip to content

Commit 32d5222

Browse files
committed
Add a 'Go back' item to the context menu of each result, to avoid accidental actions
1 parent 26b2bd8 commit 32d5222

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,22 @@ private void QueryContextMenu()
10211021
else
10221022
{
10231023
results = PluginManager.GetContextMenusForPlugin(selected);
1024+
1025+
// To prevent accidental actions, make the topmost (and default) element a simple 'Go back'
1026+
results.Insert(0, new()
1027+
{
1028+
Title = "Go back",
1029+
PluginDirectory = Constant.ProgramDirectory,
1030+
Action = _ =>
1031+
{
1032+
App.API.ReQuery();
1033+
return false;
1034+
},
1035+
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\uF743"),
1036+
OriginQuery = selected.OriginQuery
1037+
1038+
});
1039+
10241040
results.Add(ContextMenuTopMost(selected));
10251041
results.Add(ContextMenuPluginInfo(selected));
10261042
}

0 commit comments

Comments
 (0)