SortOrder.RA exists in the object list and, once #622 lands, sort() actually
implements it. The user still cannot select it — there is no marking-menu entry
that reaches it, so the sort is dead code.
Why it is unreachable
UIObjectList.__init__ builds the Sort submenu with only two live slots:
callback=MarkingMenu(
up=MarkingMenuOption(),
left=MarkingMenuOption(label=_("Nearest"), callback=self.mm_change_sort),
down=MarkingMenuOption(), # <- bare, label="", callback=None
right=MarkingMenuOption(label=_("Standard"), callback=self.mm_change_sort),
),
Two pieces of code already assume the down slot is RA and are therefore both
dead:
__init__: if self.current_sort == SortOrder.RA: self.marking_menu.left.callback.down.selected = True
mm_change_sort: if menu_item.label == _("RA"): ...
MarkingMenuOption() defaults to label="" and callback=None, so the slot
renders empty and dispatches nothing.
Fix
Give the down slot its label and callback:
down=MarkingMenuOption(label=_("RA"), callback=self.mm_change_sort),
That is the whole wiring — mm_change_sort and the selected bookkeeping are
already written for it, and #622 supplies the sort() branch and the
_sort_order_label entry.
i18n
None needed. msgid "RA" is already present and translated in all four
catalogues (de, es, fr, zh) — it has been used by the "Sorting by
{sort_order}" toast for some time.
Depends on
#622, which adds the SortOrder.RA branch to sort(). Wiring the menu without
it would give the user a menu entry that changes the label and nothing else.
Acceptance
- The Sort marking menu shows a third option, and choosing it orders the list by
right ascension.
- The header and the in-list "Sort: …" label both read "RA" — both already route
through _sort_order_label.
- Re-opening the list with RA active pre-selects the right marking-menu slot.
- Covered in
tests/test_ui_modules.py the way the other sorts are.
Worth deciding while implementing
RA sorting is a plain sorted(..., key=lambda x: x.ra), so it cuts the sky at
RA 0 rather than at the meridian. That is the conventional catalog behaviour and
almost certainly what is wanted, but it is the sort of thing better settled
deliberately than by default.
SortOrder.RAexists in the object list and, once #622 lands,sort()actuallyimplements it. The user still cannot select it — there is no marking-menu entry
that reaches it, so the sort is dead code.
Why it is unreachable
UIObjectList.__init__builds the Sort submenu with only two live slots:Two pieces of code already assume the
downslot is RA and are therefore bothdead:
__init__:if self.current_sort == SortOrder.RA: self.marking_menu.left.callback.down.selected = Truemm_change_sort:if menu_item.label == _("RA"): ...MarkingMenuOption()defaults tolabel=""andcallback=None, so the slotrenders empty and dispatches nothing.
Fix
Give the
downslot its label and callback:That is the whole wiring —
mm_change_sortand theselectedbookkeeping arealready written for it, and #622 supplies the
sort()branch and the_sort_order_labelentry.i18n
None needed.
msgid "RA"is already present and translated in all fourcatalogues (
de,es,fr,zh) — it has been used by the "Sorting by{sort_order}" toast for some time.
Depends on
#622, which adds the
SortOrder.RAbranch tosort(). Wiring the menu withoutit would give the user a menu entry that changes the label and nothing else.
Acceptance
right ascension.
through
_sort_order_label.tests/test_ui_modules.pythe way the other sorts are.Worth deciding while implementing
RA sorting is a plain
sorted(..., key=lambda x: x.ra), so it cuts the sky atRA 0 rather than at the meridian. That is the conventional catalog behaviour and
almost certainly what is wanted, but it is the sort of thing better settled
deliberately than by default.