Currency combo boxes should group by classification (major/minor/exotic)

Table of Contents

This page is a capture in the next bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.

What

Every currency combo box in the app (base/quote/settlement pickers on currency_pair, and any future flagged_combo with flag_source: currency) is populated via the shared setup_currency_combo() (projects/ores.qt/api/src/FlagIconHelper.cpp), which does a plain std::sort(codes.begin(), codes.end()) — alphabetical by ISO code, with no grouping. Group items instead by an existing classification concept — currency.market_tier (e.g. "g10", "emerging") for a single-currency picker, or currency_pair.classification (major, minor, exotic, commodity) for a currency-pair picker like currency_pair_convention's new pairCodeCombo — sorted alphabetically within each group, with the groups themselves ordered by real-world liquidity/importance rather than alphabetically (so "g10"/major sorts first, not last).

Why

A trader scanning a currency dropdown thinks in terms of "is this a major, or some exotic/frontier currency" — alphabetical order buries USD among dozens of unfamiliar codes and provides no visual grouping at all. This became visible while adding the currency_pair_convention Pair Code combo (see ores.refdata component), which surfaces the same long, ungrouped, alphabetical list problem as the existing base/quote pickers, just with pair codes instead of single currency codes.

References

  • projects/ores.qt/api/src/FlagIconHelper.cppsetup_currency_combo(), the shared population/sort logic for every currency flagged_combo.
  • projects/ores.refdata/modeling/ores.refdata.currency.orgmarket_tier field (the natural grouping key for single-currency combos).
  • projects/ores.refdata/modeling/ores.refdata.currency_pair.orgclassification field (the natural grouping key for currency-pair combos, e.g. currency_pair_convention's pairCodeCombo).

Qt implementation needs a grouped-combo pattern (e.g. non-selectable section-header items, or a custom delegate) since plain QComboBox has no built-in grouping — check whether any existing combo in the app already does this (e.g. a static_combo with category headers) before inventing a new mechanism.

See also

Emacs 29.3 (Org mode 9.6.15)