Skip to content

Commit bce5195

Browse files
committed
Fix(viewer): Support win rate analysis in static viewer
1 parent fcad0ad commit bce5195

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

.cursor/rules/viewer.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ two AI agent in a round-based game against each other.
1818
* **NEVER use inline JavaScript in HTML templates** - all JavaScript must be in separate .js files in the static/js directory
1919
* Organize JavaScript into logical modules: clipboard.js, experiment.js, readme.js, json-editors.js, etc.
2020
* The application consists of two main pages: the viewer and the game picker
21+
* **Static/Frozen Version Compatibility** - The viewer supports both dynamic (Flask server) and static (frozen) versions. The frozen version is generated using `freeze_viewer.py` and uses different routes (`/game/<path>` instead of `/?folder=`). **Every feature must work in both versions**. When making changes, ensure both the `index()` route and `game_view()` route receive the same data and functionality.
2122

2223
### Design System & Styling
2324

codeclash/viewer/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,7 @@ def game_view(folder_path):
872872

873873
# Get analysis data
874874
analysis_data = parser.analyze_line_counts()
875+
sim_wins_data = parser.analyze_sim_wins_per_round()
875876

876877
# Get matrix analysis data
877878
matrix_data = parser.load_matrix_analysis()
@@ -886,6 +887,7 @@ def game_view(folder_path):
886887
metadata=metadata,
887888
trajectories_by_round=trajectories_by_round,
888889
analysis_data=analysis_data,
890+
sim_wins_data=sim_wins_data,
889891
matrix_data=matrix_data,
890892
is_static=STATIC_MODE,
891893
)

0 commit comments

Comments
 (0)