Defuse handled dashboard warnings and add a snooze action
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:
adminandClaude Sonnet 5 committed 2026-09-26 00:48:39 +02:00
1 parent 3270b48850
commit 54ad7f7419
15 files changed
+421 -18

No files matched your search

+9
View File
@@ -341,6 +341,15 @@ public class FakeVorgangRepository : IVorgangRepository
public void Delete(Guid id) { var v = _all.FirstOrDefault(x => x.Id == id); if (v is not null) v.IsDeleted = true; }
}
public class FakeDashboardWarningSnoozeRepository : IDashboardWarningSnoozeRepository
{
private readonly List<DashboardWarningSnooze> _all = [];
public DashboardWarningSnooze? Get(Guid studentId, string warningTag) =>
_all.FirstOrDefault(s => s.StudentId == studentId && s.WarningTag == warningTag);
public List<DashboardWarningSnooze> GetAll() => _all.ToList();
public void Save(DashboardWarningSnooze snooze) { _all.RemoveAll(s => s.Id == snooze.Id); _all.Add(snooze); }
}
public class FakeAttachmentStorage : IAttachmentStorage
{
private readonly Dictionary<string, byte[]> _blobs = [];