worldcubeassociation.org icon indicating copy to clipboard operation
worldcubeassociation.org copied to clipboard

Automatically order venues

Open kr-matthews opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

Venues in the wcif are currently returned in the order that they were created, which may be a bad order in some cases. There is no way to change this order.

Describe the solution you'd like

The wcif should automatically come with the venues pre-sorted in a logical order.

Cases to consider:

  • Competition with different venues on day 1/day 2 (example). Day 1 venue should be first.
  • FM competition with all venues in a single country and time zone (example). The 'best' order might depend on the region's shape (sometimes latitude, sometimes longitude, something something else).
  • FM competition spanning multiple time zones, in 1 country/region (example). Probably makes sense for competitions to be ordered by time zone.
  • FM competition spanning multiple countries, in 1 time zone (example). Sorting by country and/or longitude might be best.
  • FM competition spanning multiple countries and time zones (example). Sorting by continent/country might be best? Or maybe by time zone?

Describe alternatives you've considered

Allowing admins to reorder venues. This is both incompatible with the existing back-end set up, and possibly not an ideal long term solution (debatable), especially if there is a 'natural' way to sort venues.

Additional context

The vast majority of competitions have only a single venue.

kr-matthews avatar Jan 24 '24 05:01 kr-matthews

I think the following order (ie sort by the first item, then break ties with the second option, etc) would be good in most cases and reasonable in the rest:

  • Continent
  • Country
  • Time zone
  • Start time of earliest activity (ensures first example works)
  • Longitude (? or Latitude)

kr-matthews avatar Jan 24 '24 05:01 kr-matthews

Parroting what Gregor said to me when I suggested changing WCIF format (although your points only relate to order which may be different):

WCIF should only be concerned with providing data in a usage-agnostic format, and allow the consumer of the data to reorder it as they desire.

Based on this, my suggestion would be that the ordering happens on the consumer-side, and if any more information needs to be exposed for the client to sort the data, that either be done by adding to the WCIF, or creating a venues API endpoint where that data can be queried (eg, /competitions/{comp-id}/venues)

@gregorbg feel free to weigh in if I've mis-applied my understanding of the reasoning you gave in our discussion

dunkOnIT avatar Jan 24 '24 05:01 dunkOnIT

The basic idea of adding a feature to (re)order venues has been discussed publicly on GitHub, and we all agreed that it might be reasonable.

The only way to make this happen is by adding an "order" property to the rooms/venues. Since the newer React UIs all rely on WCIF internally (which is a good thing!) the only way to enable this feature is to allow them to PATCH order information through WCIF

gregorbg avatar Jan 24 '24 06:01 gregorbg