Skip to content

Generate format_presets from a namedtuple spec - #259

Open
rtibblesbot wants to merge 2 commits into
learningequality:mainfrom
rtibblesbot:issue-185-140e1c
Open

rtibblesbot wants to merge 2 commits into
learningequality:mainfrom
rtibblesbot:issue-185-140e1c

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • le_utils/constants/format_presets.py and new js/FormatPresets.js are generated from spec/constants-format_presets.json.
  • le_utils/resources/presetlookup.json is deleted.
  • Generator gains lists (for RENDERABLE_PRESETS_ORDER) and label_constant_suffix (for _READABLE constants) spec options.

References

Closes #185. Spec format: #182.

Reviewer guidance

Suggested review: Full code review, then manual QA once the reviewer sets Needs QA.

  • User-visible files changed: js/FormatPresets.js.
  • Confirm RENDERABLE_PRESETS_ORDER listed explicitly in the spec, guarded only by a test, is the bitmask contract later migrations should copy.
  • Confirm kolibri-constants/FormatPresets should export the 33 English _READABLE labels and omit RENDERABLE_PRESETS_ORDER and choices.

AI usage

Used Claude Code to add the generator options, build the spec from the existing module and JSON, and write the tests. Verified with the full test suite, prek, and a repeated make build leaving no diff.


Written by rtibblesbot, an LLM-based coding agent.

@rtibblesbot

🟡 Waiting for feedback

Last updated: 2026-11-05 04:34 UTC

@rtibblesbot
rtibblesbot marked this pull request as ready for review November 5, 2026 04:32
@rtibblesbot
rtibblesbot requested review from a team and leq-bot November 5, 2026 04:32
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.

Migrate format_presets.py to spec + code generation

1 participant