Skip to content

fix(ui): add WDS Doubles to the catalog filter, test both menus match - #711

Open
brickbots wants to merge 1 commit into
mainfrom
fix/wds-catalog-filter
Open

brickbots wants to merge 1 commit into
mainfrom
fix/wds-catalog-filter

Conversation

@brickbots

Copy link
Copy Markdown
Owner

Summary

You can open the WDS double star catalog from Objects > By Catalog > Stars..., but you cannot select it in Set Filters > Catalogs > Stars.... This PR adds WDS Doubles to the filter menu. It also adds a test that fails when the two menus do not list the same catalogs.

Cause

#248 added WDS to the By Catalog menu. It did not add WDS to the filter menu. Both menus are lists in python/PiFinder/ui/menu_structure.py that we update by hand, so it is easy to change one and forget the other.

WDS is the only catalog that is missing. All other catalog codes are in both menus.

Changes

  • menu_structure.py: add WDS Doubles to Set Filters > Catalogs > Stars..., after RASC Doubles and before TLK 90 Variables. This is the same position as in By Catalog.
  • test_menu_struct.py: add the smoke test test_catalog_filter_matches_by_catalog_menu. The test makes a list of each catalog in each menu, with its group (for example "Stars..."), its name and its catalog code. The two lists must be the same, in the same order. The test finds the filter menu by its filter.selected_catalogs config option, not by its name.

Not changed

  • default_config.json does not select WDS by default. Users who want WDS in the filtered lists select it in the filter menu.
  • The "WDS Doubles" name is already translated in de, es, fr and zh, because the By Catalog menu uses the same name. This PR adds no new translation strings.

Tests

  • Without the menu change, the new test fails: At index 24 diff: (('Stars...',), 'TLK 90 Variables', 'TLK') != (('Stars...',), 'WDS Doubles', 'WDS').
  • With the menu change: 2422 smoke and unit tests pass.
  • ruff check, ruff format --check and nox -s type_hints pass.

🤖 Generated with Claude Code

#248 added the WDS catalog to Objects > By Catalog > Stars..., but not to
Set Filters > Catalogs > Stars.... Users could browse WDS but could not
select it in the catalog filter.

Add the entry in the same position as in By Catalog. Add a smoke test that
flattens both menus to (group, name, catalog code) and asserts they are
equal, so a catalog added to one menu and not the other fails CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant