feat(ui): complete Avalonia UI port with 7 main pages, tool settings & top MenuBar

This commit is contained in:
Richard
2026-08-10 10:48:34 +02:00
parent a0e18d2a57
commit b5bf97ae74
187 changed files with 20054 additions and 882 deletions
@@ -0,0 +1,65 @@
using System.Globalization;
using Avalonia.Data.Converters;
using Avalonia.Layout;
using Avalonia.Media;
namespace ClawdDotNet.Desktop.Converters;
/// <summary>
/// Färbt den Hintergrund einer Chat-Sprechblase für Benutzer-Nachrichten.
/// </summary>
public sealed class ChatBubbleBrushConverter : IValueConverter
{
public static readonly ChatBubbleBrushConverter Instance = new();
private static readonly IBrush UserBubble = new SolidColorBrush(Color.FromArgb(0x28, 0x00, 0x78, 0xD4));
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is bool isUser && isUser)
return UserBubble;
return null;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
=> throw new NotSupportedException("Nur zur Anzeige.");
}
/// <summary>
/// Richtet Chat-Sprechblasen aus: Rechts für den Benutzer, links für den Agenten.
/// </summary>
public sealed class ChatAlignmentConverter : IValueConverter
{
public static readonly ChatAlignmentConverter Instance = new();
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is bool isUser && isUser)
return HorizontalAlignment.Right;
return HorizontalAlignment.Left;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
=> throw new NotSupportedException("Nur zur Anzeige.");
}
/// <summary>
/// Prüft, ob ein Tool-Name mit dem ConverterParameter übereinstimmt.
/// </summary>
public sealed class ToolMatchConverter : IValueConverter
{
public static readonly ToolMatchConverter Instance = new();
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is string toolName && parameter is string targetTool)
return toolName.Equals(targetTool, StringComparison.OrdinalIgnoreCase);
return false;
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
=> throw new NotSupportedException("Nur zur Anzeige.");
}
@@ -0,0 +1,33 @@
using System.Globalization;
using Avalonia.Data.Converters;
using Avalonia.Media;
namespace ClawdDotNet.Desktop.Converters;
/// <summary>
/// Färbt eine Logzeile nach ihrer Stufe.
///
/// Bewusst nur Warnung und Fehler hervorgehoben — alles einzufärben macht die Ansicht
/// unruhig und lenkt von genau den Zeilen ab, die auffallen sollen. Der Rest behält die
/// Vordergrundfarbe des Themas und funktioniert damit hell wie dunkel.
/// </summary>
public sealed class LogLevelBrushConverter : IValueConverter
{
public static readonly LogLevelBrushConverter Instance = new();
private static readonly IBrush Error = new SolidColorBrush(Color.FromRgb(0xE8, 0x4B, 0x4B));
private static readonly IBrush Warn = new SolidColorBrush(Color.FromRgb(0xD8, 0x9C, 0x2A));
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
=> value as string switch
{
"ERR" or "FTL" => Error,
"WRN" => Warn,
// null heißt: Bindung greift nicht, das Steuerelement behält seine eigene
// Farbe aus dem Thema.
_ => null
};
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
=> throw new NotSupportedException("Nur zur Anzeige.");
}