From 6af7c32c88cad52d1f5637c0f9c7c3acd08c5374 Mon Sep 17 00:00:00 2001
From: Alphons Joseph <93847055+Crazypersonalph@users.noreply.github.com>
Date: Sat, 24 Jan 2026 12:14:39 +0800
Subject: [PATCH 1/4] fix [BUG] Seqta Tutor Lessons Color Not In Home Page And
Assesments/Courses showing when not meant to Fixes #343
---
src/seqta/utils/Loaders/LoadHomePage.ts | 101 ++++++------------------
1 file changed, 22 insertions(+), 79 deletions(-)
diff --git a/src/seqta/utils/Loaders/LoadHomePage.ts b/src/seqta/utils/Loaders/LoadHomePage.ts
index d46dec39..31ad8f18 100644
--- a/src/seqta/utils/Loaders/LoadHomePage.ts
+++ b/src/seqta/utils/Loaders/LoadHomePage.ts
@@ -104,17 +104,7 @@ export async function loadHomePage() {
const date = new Date();
const TodayFormatted = formatDate(date);
- const [timetablePromise, assessmentsPromise, classesPromise, prefsPromise] = [
- fetch(`${location.origin}/seqta/student/load/timetable?`, {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({
- from: TodayFormatted,
- until: TodayFormatted,
- student: 69,
- }),
- }).then((res) => res.json()),
-
+ const [assessmentsPromise, classesPromise, prefsPromise] = [
GetUpcomingAssessments(),
GetActiveClasses(),
@@ -126,65 +116,13 @@ export async function loadHomePage() {
}).then((res) => res.json()),
];
- const [timetableData, assessments, classes, prefs] = await Promise.all([
- timetablePromise,
+ const [assessments, classes, prefs] = await Promise.all([
assessmentsPromise,
classesPromise,
prefsPromise,
]);
- const dayContainer = document.getElementById("day-container");
- if (dayContainer && timetableData.payload.items.length > 0) {
- const lessonArray = timetableData.payload.items.sort((a: any, b: any) =>
- a.from.localeCompare(b.from),
- );
- const colours = await GetLessonColours();
-
- dayContainer.innerHTML = "";
- for (let i = 0; i < lessonArray.length; i++) {
- const lesson = lessonArray[i];
- const subjectname = `timetable.subject.colour.${lesson.code}`;
- const subject = colours.find(
- (element: any) => element.name === subjectname,
- );
-
- lesson.colour = subject
- ? `--item-colour: ${subject.value};`
- : "--item-colour: #8e8e8e;";
- lesson.from = lesson.from.substring(0, 5);
- lesson.until = lesson.until.substring(0, 5);
-
- if (settingsState.timeFormat === "12") {
- lesson.from = convertTo12HourFormat(lesson.from);
- lesson.until = convertTo12HourFormat(lesson.until);
- }
-
- lesson.attendanceTitle = CheckUnmarkedAttendance(lesson.attendance);
-
- const div = makeLessonDiv(lesson, i + 1);
- if (GetThresholdOfColor(subject?.value) > 300) {
- const firstChild = div.firstChild as HTMLElement;
- if (firstChild) {
- firstChild.classList.add("day-inverted");
- }
- }
- dayContainer.appendChild(div.firstChild!);
- }
-
- if (currentSelectedDate.getDate() === date.getDate()) {
- for (let i = 0; i < lessonArray.length; i++) {
- CheckCurrentLesson(lessonArray[i], i + 1);
- }
- CheckCurrentLessonAll(lessonArray);
- }
- } else if (dayContainer) {
- dayContainer.innerHTML = `
-
-
})
-
No lessons available.
-
`;
- }
- dayContainer?.classList.remove("loading");
+ callHomeTimetable(TodayFormatted, false)
const activeClass = classes.find((c: any) => c.hasOwnProperty("active"));
const activeSubjects = activeClass?.subjects || [];
@@ -742,7 +680,8 @@ function callHomeTimetable(date: string, change?: any) {
GetLessonColours().then((colours) => {
let subjects = colours;
for (let i = 0; i < lessonArray.length; i++) {
- let subjectname = `timetable.subject.colour.${lessonArray[i].code}`;
+
+ let subjectname = ((lessonArray[i].type == "tutorial") ? `timetable.tutor.${lessonArray[i].tutorID}` : `timetable.subject.colour.${lessonArray[i].code}`);
let subject = subjects.find(
(element: any) => element.name === subjectname,
@@ -917,6 +856,7 @@ async function CheckCurrentLesson(lesson: any, num: number) {
function makeLessonDiv(lesson: any, num: number) {
if (!lesson) throw new Error("No lesson provided.");
+ console.info(lesson);
const {
code,
@@ -930,33 +870,35 @@ function makeLessonDiv(lesson: any, num: number) {
programmeID,
metaID,
assessments,
+ type
} = lesson;
let lessonString = `
-
${description || "Unknown"}
+
${(type == "class") ? description : (type == "tutorial") ? "Tutorial" : "Unknown"}
${staff || "Unknown"}
-
${room || "Unknown"}
+
${(type == "class") ? room : (type == "tutorial") ? "N/A" : "Unknown"}
${from || "Unknown"} - ${until || "Unknown"}
${attendanceTitle || "Unknown"}
`;
- if (programmeID !== 0) {
- lessonString += `
+ if (type == "class") {
+ if (programmeID !== 0) {
+ lessonString += `
${assessmentsicon}
${coursesicon}
`;
- }
+ }
- if (assessments && assessments.length > 0) {
- const assessmentString = assessments
- .map(
- (element: any) =>
- `
${element.title}
`,
- )
- .join("");
+ if (assessments && assessments.length > 0) {
+ const assessmentString = assessments
+ .map(
+ (element: any) =>
+ `
${element.title}
`,
+ )
+ .join("");
- lessonString += `
+ lessonString += `
`;
+ }
}
lessonString += "
";
From 9d3494eb565e8ff2d520083eb8c8b0825ff1d5f7 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 24 Jan 2026 04:23:49 +0000
Subject: [PATCH 2/4] Initial plan
From 14823dcc919b67c1a56b8e07f2fa97e501558971 Mon Sep 17 00:00:00 2001
From: Alphons Joseph <93847055+Crazypersonalph@users.noreply.github.com>
Date: Sat, 24 Jan 2026 12:24:14 +0800
Subject: [PATCH 3/4] Update src/seqta/utils/Loaders/LoadHomePage.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---
src/seqta/utils/Loaders/LoadHomePage.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/seqta/utils/Loaders/LoadHomePage.ts b/src/seqta/utils/Loaders/LoadHomePage.ts
index 31ad8f18..abaa6de8 100644
--- a/src/seqta/utils/Loaders/LoadHomePage.ts
+++ b/src/seqta/utils/Loaders/LoadHomePage.ts
@@ -122,7 +122,7 @@ export async function loadHomePage() {
prefsPromise,
]);
- callHomeTimetable(TodayFormatted, false)
+ callHomeTimetable(TodayFormatted, true);
const activeClass = classes.find((c: any) => c.hasOwnProperty("active"));
const activeSubjects = activeClass?.subjects || [];
From 79c4fb511b14ce5e44bee0ba9989f0b2c8fa3b93 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 24 Jan 2026 04:26:14 +0000
Subject: [PATCH 4/4] Remove console.info(lesson) to prevent logging sensitive
data
Co-authored-by: Crazypersonalph <93847055+Crazypersonalph@users.noreply.github.com>
---
src/seqta/utils/Loaders/LoadHomePage.ts | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/seqta/utils/Loaders/LoadHomePage.ts b/src/seqta/utils/Loaders/LoadHomePage.ts
index 31ad8f18..f9acda78 100644
--- a/src/seqta/utils/Loaders/LoadHomePage.ts
+++ b/src/seqta/utils/Loaders/LoadHomePage.ts
@@ -856,7 +856,6 @@ async function CheckCurrentLesson(lesson: any, num: number) {
function makeLessonDiv(lesson: any, num: number) {
if (!lesson) throw new Error("No lesson provided.");
- console.info(lesson);
const {
code,