Defuse handled dashboard warnings and add a snooze action
CI / build-and-test (push) Canceled after 0s
CI / build-and-test (push) Canceled after 0s
Cross-class warnings (attendance, homework backlog, lateness) stayed red and at the top even after being acted on. A warning now turns gray and sorts to the bottom of its group once a recently-updated open Vorgang with a matching tag exists, or once explicitly snoozed for 1/2/4 weeks. Both are time-limited: once the grace period lapses without the underlying number actually improving, the warning goes active again on the next dashboard load - no background job needed since it's just recomputed on every RebuildAttention. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3270b48850
commit
54ad7f7419
15 files changed
+421
-18
No files matched your search
@@ -37,6 +37,14 @@
|
||||
<Setter Property="Width" Value="5"/>
|
||||
<Setter Property="Background" Value="{DynamicResource AppStatusDangerBrush}"/>
|
||||
</Style>
|
||||
<!-- Entschärft (Nutzer-Feedback): ein offener Vorgang mit passendem Tag wurde kürzlich
|
||||
bearbeitet, oder die Warnung wurde zurückgestellt (siehe AttentionItem.IsDefused) — grau
|
||||
statt rot, damit sie nicht mehr die gleiche Dringlichkeit signalisiert, aber als Erinnerung
|
||||
sichtbar bleibt. Nach ".attendance" deklariert, damit sie bei gleicher Klassenanzahl gewinnt. -->
|
||||
<Style Selector="Border.severitybar.defused">
|
||||
<Setter Property="Width" Value="5"/>
|
||||
<Setter Property="Background" Value="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"/>
|
||||
</Style>
|
||||
<Style Selector="TextBlock.attentionTrailing">
|
||||
<Setter Property="FontSize" Value="10"/>
|
||||
<Setter Property="Opacity" Value="0.6"/>
|
||||
@@ -47,6 +55,11 @@
|
||||
<Setter Property="Opacity" Value="1"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppStatusDangerBrush}"/>
|
||||
</Style>
|
||||
<Style Selector="TextBlock.attentionTrailing.warning.defused">
|
||||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseMediumBrush}"/>
|
||||
<Setter Property="FontWeight" Value="Normal"/>
|
||||
<Setter Property="Opacity" Value="0.7"/>
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
|
||||
<ScrollViewer Padding="24">
|
||||
@@ -498,7 +511,8 @@
|
||||
<Border Grid.Column="0" Classes="severitybar"
|
||||
Classes.high="{Binding IsHighSeverity}"
|
||||
Classes.medium="{Binding IsMediumSeverity}"
|
||||
Classes.attendance="{Binding IsCrossClassWarning}" Margin="0,0,9,0"/>
|
||||
Classes.attendance="{Binding IsCrossClassWarning}"
|
||||
Classes.defused="{Binding IsDefused}" Margin="0,0,9,0"/>
|
||||
<!-- Bewusst immer als Button (statt je nach IsClickable ein anderes Root-Element):
|
||||
ein einheitliches Template für alle sieben Arten. Bei Excuse/MissingTeachingTime
|
||||
ist Navigate null, der Klick auf die Zeile selbst ist dann folgenlos — die
|
||||
@@ -513,6 +527,7 @@
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding TrailingText}"
|
||||
Classes="attentionTrailing" Classes.warning="{Binding IsWarningTrailing}"
|
||||
Classes.defused="{Binding IsDefused}"
|
||||
VerticalAlignment="Center" Margin="8,0,0,0"
|
||||
IsVisible="{Binding HasTrailingText}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding DateDisplay}" FontSize="12"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="LehrerApp.Desktop.Views.Shared.SnoozeDurationDialog"
|
||||
x:CompileBindings="False"
|
||||
Title="Warnung zurückstellen"
|
||||
Width="420" SizeToContent="Height"
|
||||
CanResize="False" WindowStartupLocation="CenterOwner">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto" Margin="24" RowSpacing="14">
|
||||
<TextBlock Grid.Row="0" Text="Warnung zurückstellen" Classes="dialogtitle"/>
|
||||
<TextBlock Grid.Row="1" Text="{Binding Message}" TextWrapping="Wrap" Opacity="0.8"/>
|
||||
<Grid Grid.Row="2" ColumnDefinitions="*,8,*,8,*">
|
||||
<Button Grid.Column="0" Content="1 Woche" HorizontalAlignment="Stretch" Click="OnPick7"/>
|
||||
<Button Grid.Column="2" Content="2 Wochen" HorizontalAlignment="Stretch" Click="OnPick14"/>
|
||||
<Button Grid.Column="4" Content="1 Monat" HorizontalAlignment="Stretch" Click="OnPick30"/>
|
||||
</Grid>
|
||||
<Button Grid.Row="3" Content="Abbrechen" HorizontalAlignment="Stretch" Click="OnCancel"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.Shared;
|
||||
|
||||
public partial class SnoozeDurationDialog : Window
|
||||
{
|
||||
public SnoozeDurationDialog() => InitializeComponent();
|
||||
|
||||
private void OnPick7(object? sender, RoutedEventArgs e) => Close(7);
|
||||
private void OnPick14(object? sender, RoutedEventArgs e) => Close(14);
|
||||
private void OnPick30(object? sender, RoutedEventArgs e) => Close(30);
|
||||
private void OnCancel(object? sender, RoutedEventArgs e) => Close(null);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace LehrerApp.Desktop.Views.Shared;
|
||||
|
||||
/// Generisches DataContext für <see cref="SnoozeDurationDialog"/>.
|
||||
public class SnoozeDurationDialogInfo
|
||||
{
|
||||
public string Message { get; init; } = "";
|
||||
}
|
||||
Reference in new issue
Block a user