Skip to content

Expand data-driven character pages for full crew - #4

Merged
RobGruhl merged 1 commit into
mainfrom
codex/implement-standardized-character-page-generation
Oct 14, 2025
Merged

Expand data-driven character pages for full crew#4
RobGruhl merged 1 commit into
mainfrom
codex/implement-standardized-character-page-generation

Conversation

@RobGruhl

Copy link
Copy Markdown
Owner

Summary

  • add per-character class boards and missing skill definitions to the shared Core Space data file
  • enhance the character page renderer to use character-specific class boards when present
  • regenerate Wade, Hopper, and Balcor tracker pages from the template so all four characters use the standardized layout

Testing

  • python -m compileall generate_character_pages.py

https://chatgpt.com/codex/tasks/task_e_68ebeaa9b508832797ad304877d3db0e

@claude

claude Bot commented Oct 14, 2025

Copy link
Copy Markdown

Pull Request Review: Expand data-driven character pages

Summary

This PR successfully implements a data-driven architecture for character progression tracking, moving from hardcoded HTML to a template-based system with centralized JSON. Well-structured with good separation of concerns.

✅ Strengths

Architecture: Excellent separation - Data (JSON), presentation (template), logic (JS), styling (CSS). Eliminates ~2000 lines of duplicated HTML. Adding new characters now requires only JSON changes.

Python Code: Clean and readable with proper error handling, modern features, good validation, clear docstrings.

JavaScript: Well-organized IIFE pattern, good state management, comprehensive error handling, proper async/await, CSS.escape() for safety.

Data Model: Character-specific class boards, inherent skills properly separated, flexible skill levels.

🔴 Critical Issues

1. XSS Risk in generate_character_pages.py:23-26
Template.substitute() without HTML escaping. Should use html.escape() on all substituted values to prevent XSS if character data contains HTML.

🟡 Medium Priority

2. No JSON Schema Validation - 1,015-line JSON has no validation. Typos won't be caught until runtime.

3. JavaScript Error Handling - response.json() at line 87 can throw if invalid JSON. Needs try-catch.

4. LocalStorage Failures - Only logged to console. Users won't know if progress isn't saving. Add visual warning.

5. Missing Type Hints - render_character() needs -> str, write_character_page() needs -> Path

🟢 Minor Issues

6. Documentation - Missing module docstring, no comments on classBoards merge logic

7. Accessibility - Missing for attribute on labels, color contrast untested, needs ARIA labels

8. Testing - No automated tests for Python or JavaScript, no manual test plan

📊 Scores

  • Code Quality: ⭐⭐⭐⭐☆ (4/5)
  • Architecture: ⭐⭐⭐⭐⭐ (5/5)
  • Security: ⭐⭐⭐☆☆ (3/5) - needs HTML escaping
  • Test Coverage: ⭐⭐☆☆☆ (2/5)
  • Documentation: ⭐⭐⭐⭐☆ (4/5)

🎯 Recommendation: Approve with minor fixes

Must fix before merge: Add HTML escaping in template substitution
Should fix: Add JSON validation
Can fix later: Automated tests, error messaging improvements

🚀 Follow-ups

  1. JSON Schema validation
  2. Automated testing suite
  3. Visual localStorage failure feedback
  4. Share Build feature
  5. Accessibility audit

Great work! The data-driven approach is a huge improvement. Once HTML escaping is added, this will be production-ready.

@RobGruhl
RobGruhl merged commit a9e6529 into main Oct 14, 2025
1 check passed
@RobGruhl
RobGruhl deleted the codex/implement-standardized-character-page-generation branch October 14, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant