Agent Tests for API, MAUI, and Slop Features

This commit is contained in:
2026-06-03 19:08:35 -04:00
parent 46150d3a69
commit 0feac0f0a0
142 changed files with 4156 additions and 1462 deletions
+63
View File
@@ -0,0 +1,63 @@
namespace Services.Website;
public class GlossaryDialogService : IGlossaryDialogService
{
private readonly List<string> history = new();
private string? termId;
public void Subscribe(Action action)
{
OnChange += action;
}
public void Unsubscribe(Action action)
{
OnChange += action;
}
public void AddDialog(string id)
{
termId = id;
history.Add(id);
NotifyDataChanged();
}
public void CloseDialog()
{
termId = null;
history.Clear();
NotifyDataChanged();
}
public void BackDialog()
{
if (history.Count > 1)
{
history.RemoveAt(history.Count - 1);
termId = history.Count > 0 ? history.Last() : null;
NotifyDataChanged();
}
}
public bool HasDialog()
{
return termId != null;
}
public bool HasHistory()
{
return history.Count > 1;
}
public string? GetTermId()
{
return termId;
}
private event Action OnChange = null!;
private void NotifyDataChanged()
{
OnChange?.Invoke();
}
}