Codepflege: CLAUDE.md und UI-Konsolidierung (Kapitel 13.4)

CLAUDE.md mit Projektkonventionen für künftige Claude-Code-Sitzungen.
Wiederkehrende UI-Muster konsolidiert: neue PageHeader-Control für
Titel/Untertitel in den Listen- und Detailansichten, globale Styles für
Dialog-Titel und Leerlisten-Hinweise statt inline wiederholter Werte.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-13 16:14:40 +02:00
co-authored by Claude Sonnet 5
parent 48d07a2b99
commit 629b8d1bf0
28 changed files with 244 additions and 52 deletions
+11
View File
@@ -5,5 +5,16 @@
<Application.Styles>
<FluentTheme />
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>
<!-- Wiederkehrende Textmuster (13.4.3): Dialog-Titel und Leerlisten-Hinweis wurden bisher
in jeder View einzeln mit denselben Werten inline gesetzt. -->
<Style Selector="TextBlock.dialogtitle">
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="SemiBold"/>
</Style>
<Style Selector="TextBlock.emptyhint">
<Setter Property="Opacity" Value="0.4"/>
<Setter Property="FontSize" Value="13"/>
</Style>
</Application.Styles>
</Application>
@@ -18,6 +18,7 @@ public partial class StudentListViewModel : ObservableObject
[ObservableProperty] private StudentListItem? _selectedStudent;
public ObservableCollection<StudentListItem> Students { get; } = [];
public string CountSummary => $"{Students.Count} Schüler gesamt";
public StudentListViewModel(IStudentRepository students)
{
@@ -40,6 +41,7 @@ public partial class StudentListViewModel : ObservableObject
: all.Where(s => s.LastName.Contains(SearchText, StringComparison.OrdinalIgnoreCase)
|| s.FirstName.Contains(SearchText, StringComparison.OrdinalIgnoreCase));
foreach (var s in f) Students.Add(new StudentListItem(s));
OnPropertyChanged(nameof(CountSummary));
}
public Func<Task>? OnAddStudent { get; set; }
@@ -38,7 +38,7 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Keine Stunden heute" Opacity="0.4" FontSize="13"
<TextBlock Text="Keine Stunden heute" Classes="emptyhint"
IsVisible="{Binding !TodaysLessons.Count}"/>
</StackPanel>
</Border>
@@ -62,7 +62,7 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Keine offenen Aufgaben" Opacity="0.4" FontSize="13"
<TextBlock Text="Keine offenen Aufgaben" Classes="emptyhint"
IsVisible="{Binding !OpenTasks.Count}"/>
</StackPanel>
</Border>
@@ -195,7 +195,7 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Keine offenen Entschuldigungen." Opacity="0.4" FontSize="13"
<TextBlock Text="Keine offenen Entschuldigungen." Classes="emptyhint"
IsVisible="{Binding !OpenExcuses.Count}"/>
</StackPanel>
</Border>
@@ -228,7 +228,7 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Noch keine Lerngruppen." Opacity="0.4" FontSize="13"
<TextBlock Text="Noch keine Lerngruppen." Classes="emptyhint"
IsVisible="{Binding !CurrentGroups.Count}"/>
</StackPanel>
</Border>
@@ -9,7 +9,7 @@
<Grid RowDefinitions="*,Auto" Margin="24">
<StackPanel Grid.Row="0" Spacing="14">
<TextBlock Text="{Binding DialogTitle}" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="{Binding DialogTitle}" Classes="dialogtitle"/>
<!-- Typ: Klasse oder Kurs -->
<StackPanel Spacing="4">
@@ -9,7 +9,7 @@
<Grid RowDefinitions="*,Auto" Margin="24">
<StackPanel Grid.Row="0" Spacing="14">
<TextBlock Text="Neuer Bewertungszeitpunkt" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="Neuer Bewertungszeitpunkt" Classes="dialogtitle"/>
<StackPanel Spacing="4">
<TextBlock Text="Datum *" FontSize="12" Opacity="0.7"/>
@@ -11,7 +11,7 @@
<!-- Überschrift + Suche -->
<StackPanel Grid.Row="0" Spacing="12" Margin="0,0,0,12">
<TextBlock Text="Schüler zur Gruppe hinzufügen" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="Schüler zur Gruppe hinzufügen" Classes="dialogtitle"/>
<TextBox Text="{Binding SearchText}"
PlaceholderText="Schüler suchen …"
x:Name="SearchBox"/>
@@ -9,7 +9,7 @@
<Grid RowDefinitions="Auto,Auto,*,Auto" Margin="24">
<TextBlock Grid.Row="0" Text="Sammelnote erfassen" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Grid.Row="0" Text="Sammelnote erfassen" Classes="dialogtitle"/>
<StackPanel Grid.Row="1" Spacing="6" Margin="0,12,0,10">
<Grid ColumnDefinitions="120,*,90" ColumnSpacing="6">
@@ -7,7 +7,7 @@
CanResize="False" WindowStartupLocation="CenterOwner">
<Grid RowDefinitions="*,Auto" Margin="24">
<StackPanel Grid.Row="0" Spacing="12">
<TextBlock Text="Klausur wirklich löschen?" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="Klausur wirklich löschen?" Classes="dialogtitle"/>
<TextBlock Text="{Binding}" FontSize="15" FontWeight="SemiBold" TextWrapping="Wrap"/>
<TextBlock Text="Dabei werden auch alle erfassten Ergebnisse dieser Klausur dauerhaft gelöscht."
TextWrapping="Wrap" Opacity="0.7"/>
@@ -7,7 +7,7 @@
CanResize="False" WindowStartupLocation="CenterOwner">
<Grid RowDefinitions="*,Auto" Margin="24">
<StackPanel Grid.Row="0" Spacing="12">
<TextBlock Text="Lerngruppe wirklich löschen?" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="Lerngruppe wirklich löschen?" Classes="dialogtitle"/>
<TextBlock Text="{Binding}" FontSize="15" FontWeight="SemiBold" TextWrapping="Wrap"/>
<TextBlock Text="Dabei werden auch Einschreibungen, Klausuren, Noten, Unterrichtsplanung und Mitarbeitseinträge dieser Lerngruppe dauerhaft gelöscht. Wenn du die Gruppe nur ausblenden möchtest, nutze stattdessen das Archiv."
TextWrapping="Wrap" Opacity="0.7"/>
@@ -12,7 +12,7 @@
<ScrollViewer Grid.Row="0">
<StackPanel Spacing="14" Margin="0,0,12,0">
<StackPanel Spacing="2">
<TextBlock Text="{Binding DialogTitle}" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="{Binding DialogTitle}" Classes="dialogtitle"/>
<TextBlock Text="{Binding SubjectDisplay}" FontSize="12" Opacity="0.6"/>
</StackPanel>
@@ -13,7 +13,7 @@
<StackPanel Spacing="2">
<StackPanel Orientation="Horizontal" Spacing="8">
<TextBlock Text="{Binding ExamTitle}" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center"/>
<TextBlock Text="{Binding ExamTitle}" Classes="dialogtitle" VerticalAlignment="Center"/>
<Border Background="{DynamicResource SystemControlBackgroundAccentBrush}" CornerRadius="4" Padding="8,2"
IsVisible="{Binding NiveauLabel, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
<TextBlock Text="{Binding NiveauLabel}" FontSize="12" Foreground="White"/>
@@ -70,7 +70,7 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Noch keine bewerteten Ergebnisse." Opacity="0.4" FontSize="13"
<TextBlock Text="Noch keine bewerteten Ergebnisse." Classes="emptyhint"
IsVisible="{Binding !GradedCount}"/>
<Separator/>
@@ -3,6 +3,7 @@
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Groups"
xmlns:views="clr-namespace:LehrerApp.Desktop.Views.Groups"
xmlns:models="clr-namespace:LehrerApp.Core.Models;assembly=LehrerApp.Core"
xmlns:shared="clr-namespace:LehrerApp.Desktop.Views.Shared"
x:Class="LehrerApp.Desktop.Views.Groups.GroupDetailView"
x:DataType="vm:GroupDetailViewModel">
@@ -13,10 +14,7 @@
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="*,Auto">
<StackPanel Grid.Column="0">
<TextBlock Text="{Binding GroupTitle}" FontSize="22" FontWeight="SemiBold"/>
<TextBlock Text="{Binding GroupSubtitle}" FontSize="12" Opacity="0.5"/>
</StackPanel>
<shared:PageHeader Grid.Column="0" Title="{Binding GroupTitle}" Subtitle="{Binding GroupSubtitle}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<TextBlock VerticalAlignment="Center" Opacity="0.6" FontSize="13">
<Run Text="{Binding StudentCount}"/>
@@ -1,6 +1,7 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Groups"
xmlns:shared="clr-namespace:LehrerApp.Desktop.Views.Shared"
x:Class="LehrerApp.Desktop.Views.Groups.GroupListView"
x:DataType="vm:GroupListViewModel">
@@ -11,10 +12,7 @@
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="*,Auto,Auto">
<StackPanel Grid.Column="0">
<TextBlock Text="Lerngruppen" FontSize="22" FontWeight="SemiBold"/>
<TextBlock Text="{Binding ListSummary}" FontSize="12" Opacity="0.5"/>
</StackPanel>
<shared:PageHeader Grid.Column="0" Title="Lerngruppen" Subtitle="{Binding ListSummary}"/>
<ComboBox Grid.Column="1" ItemsSource="{Binding SchoolYears}"
SelectedItem="{Binding SelectedSchoolYear}"
Width="100" Margin="0,0,8,0" VerticalAlignment="Center"/>
@@ -9,7 +9,7 @@
<Grid RowDefinitions="Auto,Auto,Auto,*,Auto" Margin="24">
<TextBlock Grid.Row="0" Text="Mitarbeitsnote berechnen" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Grid.Row="0" Text="Mitarbeitsnote berechnen" Classes="dialogtitle"/>
<Grid Grid.Row="1" ColumnDefinitions="Auto,Auto,*" Margin="0,12,0,10">
<TextBlock Grid.Column="0" Text="Zeitraum:" VerticalAlignment="Center" Margin="0,0,8,0"/>
@@ -13,7 +13,7 @@
<StackPanel Grid.Row="0" Spacing="2">
<TextBlock Text="{Binding GroupLabel}" FontSize="13" Opacity="0.5"/>
<Grid ColumnDefinitions="Auto,*,Auto">
<TextBlock Grid.Column="0" Text="{Binding StudentName}" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Grid.Column="0" Text="{Binding StudentName}" Classes="dialogtitle"/>
<StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="8">
<Button Content="◂ Zurück" Command="{Binding PreviousStudentCommand}"/>
<TextBlock Text="{Binding ProgressText}" VerticalAlignment="Center" Opacity="0.6" FontSize="12"/>
@@ -10,7 +10,7 @@
<Grid RowDefinitions="Auto,Auto,*,Auto" Margin="24">
<StackPanel Grid.Row="0" Spacing="2">
<TextBlock Text="{Binding GroupLabel}" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="{Binding GroupLabel}" Classes="dialogtitle"/>
<TextBlock Text="{Binding SchemeSummary}" FontSize="12" Opacity="0.6"/>
</StackPanel>
@@ -9,7 +9,7 @@
<Grid RowDefinitions="Auto,Auto,*,Auto" Margin="24">
<TextBlock Grid.Row="0" Text="{Binding StudentName}" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Grid.Row="0" Text="{Binding StudentName}" Classes="dialogtitle"/>
<Button Grid.Row="1" Content=" Note hinzufügen" Command="{Binding AddEntryCommand}"
HorizontalAlignment="Left" Margin="0,10,0,10"/>
@@ -52,7 +52,7 @@
</ItemsControl>
</ScrollViewer>
<TextBlock Grid.Row="2" Text="Noch keine Noten erfasst." Opacity="0.4" FontSize="13"
<TextBlock Grid.Row="2" Text="Noch keine Noten erfasst." Classes="emptyhint"
HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,20,0,0"
IsVisible="{Binding !Entries.Count}"/>
@@ -10,7 +10,7 @@
<Grid RowDefinitions="*,Auto" Margin="24">
<StackPanel Grid.Row="0" Spacing="10">
<StackPanel>
<TextBlock Text="{Binding Name}" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="{Binding Name}" Classes="dialogtitle"/>
<TextBlock Text="{Binding GradingSystemLabel}" FontSize="12" Opacity="0.5"/>
</StackPanel>
@@ -1,13 +1,13 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Settings"
xmlns:shared="clr-namespace:LehrerApp.Desktop.Views.Shared"
x:Class="LehrerApp.Desktop.Views.Settings.SettingsView"
x:DataType="vm:SettingsViewModel">
<Grid RowDefinitions="Auto,*">
<TextBlock Grid.Row="0" Text="Einstellungen" FontSize="22" FontWeight="SemiBold"
Margin="32,28,32,0"/>
<shared:PageHeader Grid.Row="0" Title="Einstellungen" Margin="32,28,32,0"/>
<TabbedPage Grid.Row="1" TabPlacement="Top">
@@ -88,7 +88,7 @@
IsVisible="{Binding CatalogValidation, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
<!-- Leerer Zustand -->
<TextBlock Text="Kein Fach ausgewählt." Opacity="0.4" FontSize="13"
<TextBlock Text="Kein Fach ausgewählt." Classes="emptyhint"
IsVisible="{Binding CatalogSubject, Converter={x:Static ObjectConverters.IsNull}}"/>
<!-- Domain-Liste -->
@@ -166,7 +166,7 @@
<ScrollViewer>
<StackPanel Margin="32,20,32,28" Spacing="14" MaxWidth="640">
<TextBlock Text="Noch keine Vorlagen angelegt." Opacity="0.4" FontSize="13"
<TextBlock Text="Noch keine Vorlagen angelegt." Classes="emptyhint"
IsVisible="{Binding !GradingKeyTemplateList.Count}"/>
<ItemsControl ItemsSource="{Binding GradingKeyTemplateList}">
@@ -298,7 +298,7 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Noch keine Backups vorhanden." Opacity="0.35" FontSize="12"
<TextBlock Text="Noch keine Backups vorhanden." Classes="emptyhint"
IsVisible="{Binding !Backups.Count}"/>
</StackPanel>
@@ -7,7 +7,7 @@
CanResize="False" WindowStartupLocation="CenterOwner">
<Grid RowDefinitions="*,Auto" Margin="24">
<StackPanel Grid.Row="0" Spacing="12">
<TextBlock Text="{Binding Title}" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="{Binding Title}" Classes="dialogtitle"/>
<TextBlock Text="{Binding Message}" TextWrapping="Wrap" Opacity="0.8"/>
</StackPanel>
<Grid Grid.Row="1" ColumnDefinitions="*,8,*" Margin="0,20,0,0">
@@ -0,0 +1,13 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="LehrerApp.Desktop.Views.Shared.PageHeader"
x:CompileBindings="False">
<StackPanel>
<TextBlock Text="{Binding Title, RelativeSource={RelativeSource AncestorType=UserControl}}"
FontSize="22" FontWeight="SemiBold"/>
<TextBlock Text="{Binding Subtitle, RelativeSource={RelativeSource AncestorType=UserControl}}"
FontSize="12" Opacity="0.5"
IsVisible="{Binding Subtitle, RelativeSource={RelativeSource AncestorType=UserControl},
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel>
</UserControl>
@@ -0,0 +1,29 @@
using Avalonia;
using Avalonia.Controls;
namespace LehrerApp.Desktop.Views.Shared;
/// Seiten-/Detail-Kopfzeile (Titel + optionaler Untertitel) — bisher in jeder
/// Listen-/Detailansicht einzeln mit denselben Werten nachgebaut (13.4.3).
public partial class PageHeader : UserControl
{
public static readonly StyledProperty<string> TitleProperty =
AvaloniaProperty.Register<PageHeader, string>(nameof(Title), defaultValue: "");
public static readonly StyledProperty<string?> SubtitleProperty =
AvaloniaProperty.Register<PageHeader, string?>(nameof(Subtitle));
public string Title
{
get => GetValue(TitleProperty);
set => SetValue(TitleProperty, value);
}
public string? Subtitle
{
get => GetValue(SubtitleProperty);
set => SetValue(SubtitleProperty, value);
}
public PageHeader() => InitializeComponent();
}
@@ -12,7 +12,7 @@
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto">
<StackPanel Spacing="14">
<TextBlock Text="Neuen Schüler anlegen" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="Neuen Schüler anlegen" Classes="dialogtitle"/>
<!-- Name -->
<Grid ColumnDefinitions="*,10,*">
@@ -94,7 +94,7 @@
</ItemsControl>
<TextBlock Text="Noch keine Kontakte. Über Kontakt hinzufügen."
Opacity="0.35" FontSize="12"
Classes="emptyhint"
IsVisible="{Binding !Contacts.Count}"/>
</StackPanel>
@@ -11,7 +11,7 @@
<Grid RowDefinitions="*,Auto" Margin="24,20">
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto">
<StackPanel Spacing="16">
<TextBlock Text="{Binding DialogTitle}" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="{Binding DialogTitle}" Classes="dialogtitle"/>
<Grid ColumnDefinitions="*,10,*">
<StackPanel Grid.Column="0" Spacing="4">
@@ -1,6 +1,7 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Students"
xmlns:shared="clr-namespace:LehrerApp.Desktop.Views.Shared"
x:Class="LehrerApp.Desktop.Views.Students.StudentDetailView"
x:DataType="vm:StudentDetailViewModel">
<Grid RowDefinitions="Auto,*">
@@ -10,9 +11,7 @@
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="*,Auto">
<StackPanel Grid.Column="0" IsVisible="{Binding !IsEditing}">
<TextBlock Text="{Binding StudentTitle}" FontSize="22" FontWeight="SemiBold"/>
</StackPanel>
<shared:PageHeader Grid.Column="0" IsVisible="{Binding !IsEditing}" Title="{Binding StudentTitle}"/>
<StackPanel Grid.Column="0" Spacing="6" IsVisible="{Binding IsEditing}">
<Grid ColumnDefinitions="*,8,*">
<TextBox Grid.Column="0" Text="{Binding EditFirstName}" PlaceholderText="Vorname"/>
@@ -181,7 +180,7 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Noch keine Noten für diesen Schüler erfasst." Opacity="0.4"
<TextBlock Text="Noch keine Noten für diesen Schüler erfasst." Classes="emptyhint"
IsVisible="{Binding !GradeHistory.Count}"/>
</StackPanel>
</ScrollViewer>
@@ -1,6 +1,7 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Students"
xmlns:shared="clr-namespace:LehrerApp.Desktop.Views.Shared"
x:Class="LehrerApp.Desktop.Views.Students.StudentListView"
x:DataType="vm:StudentListViewModel">
<Grid RowDefinitions="Auto,*">
@@ -8,13 +9,7 @@
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="*,Auto,Auto">
<StackPanel Grid.Column="0">
<TextBlock Text="Schüler" FontSize="22" FontWeight="SemiBold"/>
<TextBlock FontSize="12" Opacity="0.5">
<Run Text="{Binding Students.Count}"/>
<Run Text=" Schüler gesamt"/>
</TextBlock>
</StackPanel>
<shared:PageHeader Grid.Column="0" Title="Schüler" Subtitle="{Binding CountSummary}"/>
<CheckBox Grid.Column="1" Content="Inaktive anzeigen"
IsChecked="{Binding ShowInactive}"
VerticalAlignment="Center" Margin="0,0,12,0"/>