Enhance timetable functionality and UI integration
ci / server (push) Failing after 3m31s
ci / client (push) Successful in 13s

- Updated protocol documentation to include new `classId` and `roomLabel` fields in the timetable API responses.
- Added classes and rooms to the timetable response structure, improving data accessibility for client applications.
- Enhanced the UI components to display timetable information, including class and room details, in the management and people panels.
- Implemented functionality to fetch and display personal timetables for individuals, ensuring a comprehensive view of schedules.
- Revised localization strings to support new timetable features and improve user experience.
- Added tests to validate the new timetable functionalities and ensure robustness in handling timetable data.
This commit is contained in:
Leonid Pershin
2026-08-19 10:45:09 +03:00
parent cad3068bac
commit d61240d5c1
20 changed files with 813 additions and 35 deletions
+6
View File
@@ -46,6 +46,7 @@ internal sealed class SchoolWorker
private ApplicantPool? _applicantSnapshot;
private DefCatalog? _catalogSnapshot;
private Timetable? _timetableSnapshot;
private MapLayout? _mapSnapshot;
private OccupancyKey _occupancyKey;
private School? _school;
private Task? _run;
@@ -109,6 +110,9 @@ internal sealed class SchoolWorker
/// <summary>Last built timetable. Published like the roster — HTTP never reads the live school.</summary>
public Timetable? TimetableSnapshot => Volatile.Read(ref _timetableSnapshot);
/// <summary>Frozen map instance. Safe to read from HTTP with the catalog; it does not mutate.</summary>
public MapLayout? MapSnapshot => Volatile.Read(ref _mapSnapshot);
public void Start()
{
_run = Task.Factory.StartNew(
@@ -205,6 +209,7 @@ internal sealed class SchoolWorker
var catalog = _mods.LoadCatalog(packIds, _logger);
Volatile.Write(ref _catalogSnapshot, catalog);
var map = _mods.LoadMap(packIds, _savedMap);
Volatile.Write(ref _mapSnapshot, map);
try
{
MapValidator.Validate(map, catalog);
@@ -565,6 +570,7 @@ internal sealed class SchoolWorker
Volatile.Write(ref _rosterSnapshot, school.Roster);
Volatile.Write(ref _applicantSnapshot, school.Applicants);
Volatile.Write(ref _timetableSnapshot, school.Timetable);
Volatile.Write(ref _mapSnapshot, school.Map);
}
/// <summary>