datatracker
datatracker copied to clipboard
Sort rooms by size in the schedule editor
from @flynnliz:
The rooms don’t appear in order of size anymore. Early in the agenda making process it’s really important for the rooms to appear in ascending order of capacity so we can schedule sessions in the correctly sized rooms. It’s confusing that now the rooms appear out of order (currently they are, in order of room capacities: 100, 100, 150, 80, 80, 150, 250, 350). Is there a way to make it so that the rooms always appear in the same relative order even if the columns are not unbroken?
This may be a trickier fix than it should be due to the way the editor grid is structured. The room sorting does take room size into account, but only after other factors. The relevant code is:
https://github.com/ietf-tools/datatracker/blob/5b6695a04c46e1756183272e8da4195f1ebea1a7/ietf/meeting/views.py#L661-L679
The critical step is the one right before room.capacity
- if the rooms with identical timeslot structure are not grouped, the layout code will need substantial reworking.
If the sort is stable, what's the problem with moving the room size sort earlier?
The existing sorting ensures that rooms with the same set of timeslots will be neighbors in the list. Line 673 does this where it sorts the rooms by the list of timeslot times/durations. The significant thing about the sort key ordering is that any rooms equal on line 673 will also be equal on the higher priority sort keys. Moving room capacity earlier will split up rooms with identical timeslot sets.
The template renders headings and related HTML plumbing (swap timeslots buttons, etc) assuming that the rooms are grouped with neighbors having identical timeslot structure. It might work, resulting in a less compact page, but I haven't tried (and was worried when I wrote it, hence the comment). It's worth trying.