Repository navigation
Conversation
Order lessons consistently by split-group position and week type across timetable views, and share whole-class group filtering between card labels and group codes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make split-group lessons occupy the same horizontal position on every day and period. The timetable grid rendered lessons in raw API return order (
getForCohorthas noORDER BY, andbuildViewModelsorted nothing), so a group could appear in the left sub-column on Monday and the right sub-column on Tuesday. Every timetable view now orders the lessons of a(day × time)cell deterministically by group identifier before rendering, so group 1 is always the first sub-column, group 2 the second, and 3+ groups scale the same way.No backend change was needed: lessons reference their groups through an array column (
lesson.groupsIds), so the position cannot be expressed as a SQLORDER BY, and the ordering is a presentation concern shared by three frontend views.Closes #
Changes
Frontend
components/timetable/helpers.ts): addedisWholeClassGroupandgetSplitGroups, so the lesson card label, the card group code and the slot ordering can no longer disagree about which group a lesson belongs to. Replaces two near-duplicate filters inlesson-card.tsxandsecondary/helpers.ts.components/timetable/helpers.ts): addedcompareLessonsInSlot— trailing group ordinal first (mat1beforemat2, 3+ groups included), then naturallocaleCompare(..., { numeric: true })for names without a number, then week type (A before B), then subject, then id as the final tiebreak. Grouped lessons sort before ungrouped ones, so a whole-class lesson never takes group 1's column. Subject is deliberately not part of the group key, so a group keeps its column when a different subject is taught to each group.components/timetable/helpers.ts):buildViewModelnow sorts each cell's lessons withcompareLessonsInSlot. The PDF renders the same model, so it inherits the fix.components/timetable/secondary/helpers.ts): removed the local week-then-idcomparator and reusedcompareLessonsInSlot, so the card view and the grid agree.Verification
bun run lintbun run typecheckbun run build— if bundler config, routers, or server entrypoints changedNotes
mat1/mat2,11.A angol1/angol2, mixed subjects (DiKu/Mat), three concurrent groups, a whole-class lesson sharing a cell, and A/B-week lessons of the same group.Kezdő/Haladó,Fiú/Lány) have no ordinal, so they fall back to natural alphabetical order.pdf/document.tsx), so a lonemat2still lands left.