Agent code and restructuring

This commit is contained in:
2026-06-04 11:05:21 -04:00
parent 0feac0f0a0
commit 7310e4ed71
134 changed files with 3074 additions and 895 deletions
+60
View File
@@ -0,0 +1,60 @@
@implements IDisposable;
@inject ISearchService searchService
@inject IJSRuntime jsRuntime
<SearchDialogComponent></SearchDialogComponent>
@code {
protected override void OnInitialized()
{
searchService.Subscribe(OnUpdate);
}
protected override async Task OnInitializedAsync()
{
try
{
await searchService.Load();
}
catch
{
}
try
{
await jsRuntime.InvokeVoidAsync("SetDotnetReference", DotNetObjectReference.Create(this));
}
catch
{
}
}
public void Dispose()
{
searchService.Unsubscribe(OnUpdate);
}
void OnUpdate()
{
StateHasChanged();
}
[JSInvokable("OnKeyPress")]
public async Task OnKeyPress(string code, bool ctrlKey, bool shiftKey, bool altKey, bool metaKey)
{
if (code.ToLower().Equals("/"))
{
if (searchService.IsVisible)
{
searchService.Hide();
}
else
{
searchService.Show();
}
}
}
}