From 6f2a6aaac90ffb573d68351b5468fcfc573c42a4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 May 2026 10:34:02 +0000 Subject: [PATCH 1/2] fix: align next class display with effective schedule data Agent-Logs-Url: https://github.com/yusancky/SystemTools/sessions/59f80547-a985-4df0-805a-e257719290d4 Co-authored-by: yusancky <83524927+yusancky@users.noreply.github.com> --- .../NextClassDisplayComponent.axaml.cs | 47 ++++--------------- 1 file changed, 10 insertions(+), 37 deletions(-) diff --git a/Controls/Components/NextClassDisplayComponent.axaml.cs b/Controls/Components/NextClassDisplayComponent.axaml.cs index 498106e..994f404 100644 --- a/Controls/Components/NextClassDisplayComponent.axaml.cs +++ b/Controls/Components/NextClassDisplayComponent.axaml.cs @@ -1,6 +1,5 @@ using System; using System.ComponentModel; -using System.Linq; using ClassIsland.Shared.ComponentModels; using Avalonia.Interactivity; using ClassIsland.Core.Abstractions.Controls; @@ -22,7 +21,6 @@ public partial class NextClassDisplayComponent : ComponentBase x.TimeType == 0) - .ToList(); - - foreach (var candidateTime in validLessonSlots) + if (nextTimeLayoutItem.EndTime < now) { - if (candidateTime.StartTime <= now) - { - continue; - } - - var candidateClassInfo = classPlan.Classes.FirstOrDefault(x => ReferenceEquals(x.CurrentTimeLayoutItem, candidateTime)); - if (candidateClassInfo == null) - { - continue; - } - - if (!candidateClassInfo.IsEnabled) - { - continue; - } - - if (!_profileService.Profile.Subjects.TryGetValue(candidateClassInfo.SubjectId, out var subject)) - { - continue; - } - - HasNextClass = true; - SubjectName = subject.Name; - TimeRangeText = $"{candidateTime.StartTime:hh\\:mm}-{candidateTime.EndTime:hh\\:mm}"; - TeacherName = string.IsNullOrWhiteSpace(subject.TeacherName) ? string.Empty : subject.TeacherName; + ApplyNoMoreClasses(); return; } - ApplyNoMoreClasses(); + HasNextClass = true; + SubjectName = nextSubject.Name; + TimeRangeText = $"{nextTimeLayoutItem.StartTime:hh\\:mm}-{nextTimeLayoutItem.EndTime:hh\\:mm}"; + TeacherName = string.IsNullOrWhiteSpace(nextSubject.TeacherName) ? string.Empty : nextSubject.TeacherName; } private void ApplyNoMoreClasses() From d6b7c70c796c820cb74073fa4e178fe031cf71e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 May 2026 10:38:55 +0000 Subject: [PATCH 2/2] fix: harden next class display null-safe effective data usage Agent-Logs-Url: https://github.com/yusancky/SystemTools/sessions/59f80547-a985-4df0-805a-e257719290d4 Co-authored-by: yusancky <83524927+yusancky@users.noreply.github.com> --- .../Components/NextClassDisplayComponent.axaml.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Controls/Components/NextClassDisplayComponent.axaml.cs b/Controls/Components/NextClassDisplayComponent.axaml.cs index 994f404..6f8388a 100644 --- a/Controls/Components/NextClassDisplayComponent.axaml.cs +++ b/Controls/Components/NextClassDisplayComponent.axaml.cs @@ -21,7 +21,6 @@ public partial class NextClassDisplayComponent : ComponentBase