fix #7: Feature: Theme Variations - #43
Merged
Merged
Conversation
Add selectable scenario themes (classic default + sci-fi, historical, business, environmental, political) mirroring the difficulty (#5) feature and kept orthogonal to it so grading stays balanced across themes. Backend: - models/simulation.py: ThemeType enum; theme field on SimulationState and SimulationRequest; ThemeChangeRequest. - prompts/scenario_generation_prompt.py: THEME_INSTRUCTIONS (scenario_flavor, visual_style; classic = no override) + get_theme_instructions. - services/llm_service.py: create_idea injects theme setting into the scenario prompt; create_video_prompt injects theme visual style for theme-appropriate media. - services/simulation_service.py: thread theme through create_new_simulation, all context dicts, both video-prompt calls; add change_theme. - api/routes.py: create passes theme; new PUT /simulations/{id}/theme for seamless mid-game switching. Frontend (pages/simulation.jsx): THEME_STYLES + theme state, start-screen theme selector, in-sim indicator, and mid-game change button. Tests/CI: tests/unit/test_theme.py (enum/model/prompt/media coverage + balanced-difficulty invariant + scenario-flavor and visual-style LLM-input tests), tests-e2e/theme.spec.js, and a theme regression step in CI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7