Shared theme variable contract for tunacode and nextstep palettes
Summary
Established a single variable schema for both Textual themes so base TCSS can stay theme-agnostic and avoid missing-variable runtime paths.
Changes
- Updated
src/tunacode/constants.py:- Added
THEME_VARIABLE_CONTRACTmapping variable names to palette keys. - Added
_build_theme_variables()with fail-fast validation for missing palette keys. - Added missing shared palette keys to both
UI_COLORSandNEXTSTEP_COLORS:bevel_lightbevel_darkscrollbar_thumbscrollbar_track
- Updated
build_tunacode_theme()andbuild_nextstep_theme()to emitvariablesfrom the same contract. - Removed now-unused
NEXTSTEP_COLORSentries (window_content,title_bar,title_bar_text).
- Added
- Added
tests/unit/ui/test_theme_variable_contract.pyto verify:- both palettes include all required keys,
- both theme builders emit identical variable schemas,
- variable values map correctly from each palette.
Verification
uv run ruff check src/tunacode/constants.py tests/unit/ui/test_theme_variable_contract.pyuv run pytest tests/unit/ui/test_theme_variable_contract.py -q
Result: pass.