Delay window show until plugins are initialized

- MainWindowVisibility starts as false (window hidden)
- Window IsVisible bound to MainWindowVisibility
- Set MainWindowVisibility = true in OnPluginsReady() after plugins load
This commit is contained in:
Hongtao Zhang 2026-01-15 23:31:30 -08:00
parent 5d80816f84
commit c68a03e193
2 changed files with 5 additions and 3 deletions

View file

@ -24,7 +24,8 @@
Background="Transparent"
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaChromeHints="NoChrome"
SizeToContent="Height">
SizeToContent="Height"
IsVisible="{Binding MainWindowVisibility, Mode=TwoWay}">
<Window.Resources>
<converters:BoolToIsVisibleConverter x:Key="BoolToVisibilityConverter" />

View file

@ -37,7 +37,7 @@ public partial class MainViewModel : ObservableObject
public event Action? ShowRequested;
[ObservableProperty]
private bool _mainWindowVisibility = true;
private bool _mainWindowVisibility = false;
[ObservableProperty]
private string _queryText = string.Empty;
@ -96,7 +96,8 @@ public partial class MainViewModel : ObservableObject
public void OnPluginsReady()
{
_pluginsReady = true;
Log.Info(ClassName, "Plugins ready");
MainWindowVisibility = true;
Log.Info(ClassName, "Plugins ready - window shown");
if (!string.IsNullOrWhiteSpace(QueryText))
_ = QueryAsync();
}