Fix class dropdown + add cache-busting for all non-machine characters - #7
Conversation
Issue: Balcor had the 'machine' class which is intended for robots/AI characters, but Balcor is an organic Nerind'ar engineer. Changes: - Replaced 'machine' class with 'tech' class in Balcor's classBoards - Removed redundant 'impervious' skill specification (already provided by support class) - Balcor now has access to engineering-appropriate skills: engineering, regulate, hackAndGrab, assist, camouflage, hardToHit, and distraction This makes thematic sense for Balcor's character description as a "Skilled Nerind'ar engineer with modified prosthetic arm."
Issue: Characters like Balcor and Wade could only see 3-4 class options in the dropdown, when they should be able to choose from all available classes. Root Cause: The resolveAvailableClasses() function was limiting characters to only the classes listed in their classBoards array, regardless of whether they were machine-restricted characters or not. Changes: - Added machine-only character detection (checks if all classBoards are machine/machineTech) - Machine characters (Hopper, XL) still get only their restricted classes - Non-machine characters now see ALL global classes (all 14 classes) - Character-specific skill customizations from classBoards are merged into global classes - Characters without classBoards continue to get all classes (unchanged) Result: - Balcor now sees all 14 classes instead of just 3 - Wade now sees all 14 classes instead of just 4 - Balcor's custom Marine/Support/Tech skill lists are preserved - Wade's custom skill lists for his classes are preserved - Machine characters (Hopper, XL) remain restricted to machine classes only
Issue: Balcor and other characters could only see 3-4 class options in dropdown instead of all 14 available classes. Root Cause: 1. JavaScript logic limited characters to only classes in their classBoards 2. No cache-busting meant browsers loaded old JavaScript after updates Changes: 1. JavaScript (docs/js/character-page.js): - Updated resolveAvailableClasses() to detect machine-only characters - Machine characters (Hopper, XL): Restricted to machine/machineTech only - All other characters: See ALL 14 global classes - Character-specific skill customizations preserved via merge 2. Cache-Busting System: - Added build version to template (templates/character-page.html) - Updated generator to inject version into CSS/JS URLs - Version format: YYYY.MM.DD.001 - Forces browser to load latest files after updates 3. Generator (generate_character_pages.py): - Import datetime for build versioning - Pass build_version to template substitution - Auto-generate version on each build 4. Data (docs/data/corespace-data.json): - Reverted Balcor's machine class (kept original structure) - No functional data changes needed 5. Regenerated Pages: - All 11 character pages regenerated with new version - Build version: 2025.11.05.001 Result: - Balcor now sees all 14 classes (was 3) - Wade now sees all 14 classes (was 4) - Other non-machine characters see all classes - Machine characters still restricted - Future updates won't be cached
Pull Request Review: Fix class dropdown + add cache-bustingSummaryThis PR addresses two important issues:
✅ Code Quality & Best PracticesStrengths:
Minor Suggestions:
🐛 Potential Bugs & IssuesNo critical bugs identified, but some edge cases to consider:
⚡ Performance ConsiderationsAll changes are performance-neutral or positive: ✅ Cache-busting is good: Forces browser to reload updated assets One consideration:
🔒 Security ConcernsNo security issues identified. The changes are low-risk: ✅ No user input processing 🧪 Test CoverageCurrent state: No automated tests found in repository Recommendations:
📋 Specific Code Review
|
No description provided.