Skip to content

filter orphan keys from generated browser choices json#752

Merged
ajslater merged 1 commit into
developfrom
claude/practical-tharp-76af7d
May 9, 2026
Merged

filter orphan keys from generated browser choices json#752
ajslater merged 1 commit into
developfrom
claude/practical-tharp-76af7d

Conversation

@ajslater
Copy link
Copy Markdown
Owner

@ajslater ajslater commented May 9, 2026

Summary

  • BROWSER_CHOICES is dumped to both browser-choices.json (Vuetify list) and browser-map.json (raw map), but the frontend consumes only one format per key. Add per-file include-key frozensets in codex/choices/browser.py and have choices_to_json.py look them up to skip orphan keys at generation time.
  • Adding a new key to BROWSER_CHOICES now requires also listing it in at least one of the two include-sets, otherwise it'll be emitted nowhere — surfaces future orphans early.

Orphans excluded from JSON output

browser-choices.json drops:

  • IDENTIFIER_SOURCES — frontend imports the raw-map form from browser-map.json only
  • VIEW_MODE — frontend toggle uses string literals, never reads the choices map
  • TABLE_COVER_SIZE — single-value placeholder, no frontend UI consumes the choices map

browser-map.json drops:

  • BOOKMARK_FILTER, VUETIFY_NULL_CODE, SETTINGS_GROUP — frontend uses the Vuetify-list form from browser-choices.json
  • COVER_ORDER_BY_KEYS, EXTRA_SORT_UNSUPPORTED_KEYS — frontend reads them via BROWSER_CHOICES.X from browser-choices.json
  • VIEW_MODE, TABLE_COVER_SIZE — same as above

The Python source consts (BROWSER_VIEW_MODE_CHOICES, BROWSER_TABLE_COVER_SIZE_CHOICES) are still used by the backend (models, serializers) so they stay in browser.py — only their JSON exposure is removed.

Coverage notes

All other generated files (admin-flag-choices, admin-status-titles, admin-jobs, browser-defaults, browser-table-*, reader-*, search-map, websocket-messages) had every top-level key consumed — either statically or as a dynamic lookup table — so no other files needed filtering. Every public Python const in codex/choices/*.py is consumed by either the JSON generator or other backend modules.

Test plan

  • ./bin/build-choices.sh regenerates with the expected key sets
  • make fix — no changes
  • make test — 218 Python + 55 frontend tests pass

🤖 Generated with Claude Code

@ajslater ajslater changed the base branch from main to develop May 9, 2026 18:30
BROWSER_CHOICES is dumped to both browser-choices.json (Vuetify list)
and browser-map.json (raw map), but each format is consumed
selectively by the frontend. Add per-file include-key frozensets in
codex/choices/browser.py and look them up from choices_to_json.py so
the generator skips keys the frontend never reads.

Removed orphans:
- browser-choices.json: IDENTIFIER_SOURCES (frontend uses map form)
- browser-map.json: BOOKMARK_FILTER, VUETIFY_NULL_CODE, SETTINGS_GROUP
  (frontend uses Vuetify form)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ajslater ajslater force-pushed the claude/practical-tharp-76af7d branch from 240e381 to cf703e3 Compare May 9, 2026 18:38
@ajslater ajslater merged commit bbb9f3d into develop May 9, 2026
5 of 6 checks passed
@ajslater ajslater deleted the claude/practical-tharp-76af7d branch May 11, 2026 00:10
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