Fix main-panel icons, idle bones, language, and weapon skills - #18
Fix main-panel icons, idle bones, language, and weapon skills#18MolochDaGod wants to merge 7 commits into
Conversation
Bone rematch used the track node name before it was declared, so idle never bound and the paperdoll stayed in bind pose. Icon URLs that pointed at info.grudge-studio.com returned HTML instead of PNGs; they now resolve on the assets CDN. Locale packs cover Stats, Bag, and equipment slots, and the Toon RTS race GLB is the play kit link instead of the old Unity WK pack.
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideFixes main-panel runtime issues by making icon paths CDN-safe, preventing idle bone-remap failures and weapon-mesh animation conflicts, switching model references to the Toon RTS kit, adding reactive localization for panel and equipment labels, and aligning tier labels with the master item definitions. Sequence diagram for localized main-panel refreshsequenceDiagram
participant User
participant MainPanel2D
participant MainPanelI18n
participant MainPanel
User->>MainPanel2D: change locale
MainPanel2D->>MainPanelI18n: setLocale(locale)
MainPanel2D->>MainPanelI18n: applyDom()
MainPanel2D->>MainPanel: rebuildTabStrip()
MainPanel2D->>MainPanel: refreshAll()
MainPanel->>MainPanelI18n: t(slots.slot)
MainPanel-->>User: localized tabs and equipment slots
Sequence diagram for CDN-safe item and skill iconssequenceDiagram
participant MainPanel
participant API
participant CDN
participant Browser
MainPanel->>API: load item and skill data
API-->>MainPanel: iconUrl or skill.iconUrl
MainPanel->>MainPanel: fixIconUrl(iconUrl)
MainPanel->>CDN: request normalized icon URL
CDN-->>Browser: icon image
MainPanel-->>Browser: render equipment and hotbar icons
Flow diagram for safe idle animation and model renderingflowchart LR
A[Mount hero viewport] --> B[Select idle clip]
B --> C[rematchClipBones]
C --> D{Bone remap succeeds?}
D -->|Yes| E[Play idle clip]
D -->|No| F[Log bone remap warning]
F --> E
E --> G[Use Toon RTS kit model]
G --> H[Skip weapon and shield mesh tracks]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="js/main-panel-2d.js" line_range="87" />
<code_context>
try {
if (typeof global.rebuildTabStrip === "function") global.rebuildTabStrip();
else global.MainPanelI18n.applyDom();
+ if (typeof global.refreshAll === "function") global.refreshAll();
} catch (_) {}
});
</code_context>
<issue_to_address>
**issue (bug_risk):** Changing the locale refreshes the panels, but `renderLeftCol()` rebuilds the stats and profession markup with hard-coded English strings such as Combat Stats, Health, Mana, Damage, and Professions; those generated labels have no `data-i18n` keys, so the advertised language refresh leaves the main stats panel in English.
**Triggers:** When the user changes the language while the main panel is open.
**Suggested fix:** Translate the generated labels with `MainPanelI18n.t(...)` or add stable `data-i18n` attributes after rendering and reapply the locale.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: js/main-panel-2d.js:87
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| try { | ||
| if (typeof global.rebuildTabStrip === "function") global.rebuildTabStrip(); | ||
| else global.MainPanelI18n.applyDom(); | ||
| if (typeof global.refreshAll === "function") global.refreshAll(); |
There was a problem hiding this comment.
issue (bug_risk): Changing the locale refreshes the panels, but renderLeftCol() rebuilds the stats and profession markup with hard-coded English strings such as Combat Stats, Health, Mana, Damage, and Professions; those generated labels have no data-i18n keys, so the advertised language refresh leaves the main stats panel in English.
Triggers: When the user changes the language while the main panel is open.
Suggested fix: Translate the generated labels with MainPanelI18n.t(...) or add stable data-i18n attributes after rendering and reapply the locale.
There was a problem hiding this comment.
🟡 Changes recommended
The new bagScope localization hook is currently overridden by a hard-coded runtime assignment, so the label won’t remain localized (especially after locale-triggered refreshes).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the main panel UI to reliably load icon assets from the assets CDN (avoiding HTML-on-miss responses), improve hero viewport resilience when idle clip bone remapping fails, and expand localization coverage for key labels (stats/bag/slots) while aligning tier labels with master item data.
Changes:
- Route icon URL resolution through CDN-aware helpers (including weapon skill hotbar icons) and normalize legacy icon paths.
- Make hero viewport mounting tolerant of bone-remap failures and fix a TDZ in clip track processing.
- Add/extend i18n keys for main panel labels and equipment slot names; refresh UI on locale changes.
File summaries
| File | Description |
|---|---|
| main-panel.html | Adds i18n hooks for labels, rewrites icon URL handling to CDN, updates tier labels, hotbar icon fallback, and kit links. |
| js/weapon-skill-tree.js | Aligns icon URL normalization with CDN rules to avoid loading missing /icons from info/objectstore. |
| js/main-panel-hero-viewport.js | Fixes TDZ in bone rematch and prevents remap failures from breaking viewport mounting. |
| js/main-panel-2d.js | Refreshes tabs/slots rendering after locale changes via refreshAll(). |
| api/v1/main-panel-locales.json | Adds translations for new labels and equipment slot names across supported locales. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| <div> | ||
| <h3 data-i18n="app.inventory">Inventory</h3> | ||
| <div class="bag-scope" id="bagScope">Account bag · UUID stacks</div> | ||
| <div class="bag-scope" id="bagScope" data-i18n="app.bagScope">Account bag · UUID stacks</div> |
🤖 Augment PR SummarySummary: This PR improves the main-panel's visual asset resolution, localization, and hero preview behavior. Changes:
Technical Notes:
🤖 Was this summary useful? React with 👍 or 👎 |
| try { | ||
| if (typeof global.rebuildTabStrip === "function") global.rebuildTabStrip(); | ||
| else global.MainPanelI18n.applyDom(); | ||
| if (typeof global.refreshAll === "function") global.refreshAll(); |
There was a problem hiding this comment.
In js/main-panel-2d.js:87, this new refreshAll() call invokes renderInventory(), which immediately overwrites #bagScope with the English Account bag · UUID stacks · max ... string at main-panel.html:1831 after setLocale() has translated it. Consequently, changing to any non-English locale leaves the new bag-scope copy untranslated.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| try { | ||
| if (typeof global.rebuildTabStrip === "function") global.rebuildTabStrip(); | ||
| else global.MainPanelI18n.applyDom(); | ||
| if (typeof global.refreshAll === "function") global.refreshAll(); |
There was a problem hiding this comment.
Suggestion: Calling refreshAll() on every locale change can start a second asynchronous Equipment viewport mount while the previous mountHeroViewport() is still awaiting kit or idle-clip loading. The older mount can resume after the newer mount has disposed its renderer, then write its root/equipment into the shared viewport state and continue its animation loop, leaving a stale preview and leaked WebGL resources. Coordinate mounts with a generation token or abort/cancel the previous mount before refreshing. [race condition]
Severity Level: Major ⚠️
- ⚠️ Equipment locale changes start overlapping hero viewport loads.
- ⚠️ Repeated language changes can grow discarded WebGL resources.
- ✅ Existing disposed guard prevents stale preview restoration.Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** js/main-panel-2d.js
**Line:** 87:87
**Comment:**
*Race Condition: Calling `refreshAll()` on every locale change can start a second asynchronous Equipment viewport mount while the previous `mountHeroViewport()` is still awaiting kit or idle-clip loading. The older mount can resume after the newer mount has disposed its renderer, then write its root/equipment into the shared viewport state and continue its animation loop, leaving a stale preview and leaked WebGL resources. Coordinate mounts with a generation token or abort/cancel the previous mount before refreshing.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix| <div> | ||
| <h3 data-i18n="app.inventory">Inventory</h3> | ||
| <div class="bag-scope" id="bagScope">Account bag · UUID stacks</div> | ||
| <div class="bag-scope" id="bagScope" data-i18n="app.bagScope">Account bag · UUID stacks</div> |
There was a problem hiding this comment.
Suggestion: This newly added localized bagScope element is overwritten on every renderInventory() call by the existing assignment of the hard-coded English Account bag · UUID stacks · max ... text. Since locale changes call refreshAll(), the bag scope reverts to English immediately after switching to another language; obtain the text through MainPanelI18n.t('app.bagScope') and append the dynamic maximum separately. [incomplete implementation]
Severity Level: Major ⚠️
- ⚠️ Bag scope reverts to English after locale changes.
- ⚠️ Inventory localization becomes inconsistent across supported languages.Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** main-panel.html
**Line:** 861:861
**Comment:**
*Incomplete Implementation: This newly added localized `bagScope` element is overwritten on every `renderInventory()` call by the existing assignment of the hard-coded English `Account bag · UUID stacks · max ...` text. Since locale changes call `refreshAll()`, the bag scope reverts to English immediately after switching to another language; obtain the text through `MainPanelI18n.t('app.bagScope')` and append the dynamic maximum separately.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fixIdle mixer writes quaternions on the kit root. Every frame we then set root.rotation to (0, yaw, 0), which destroys FBX/Bip001 Y-up and folds the character in half. Plant scale and feet only; facing lives on an un-animated wrapper. Do not call fitRootUniformSi after mixer sample.
…aint. Bind stands because Bip001 carries authored -90. CDN idle is Mixamo-local Y-up. Playing both is two orientation systems: looks fine, then folds and stays folded. Identity kit quaternion once before mixer, sample idle, plant, then tick. No Euler after mixer. CDN idle only.
…ane. Paperdoll stance uses L/R foot midpoint, not mesh bbox. After mixer: placeRootBetweenFeet then applyFootIk. No Euler on Bip001. Sampler is y=0 in the viewport (play kits pass terrain).
Post-mixer clamped yaw/pitch on Bip001 Neck and Head only. Cursor while the pointer is over the canvas; camera (the user) otherwise. No kit-root Euler.
|
|
||
| if (neck) { | ||
| _e.set(0, yaw * 0.38, 0); | ||
| _q.setFromEuler(_e); |
User description
Fixes live info.grudge-studio.com/main-panel.html: bone rematch TDZ (idle/bind pose), icon URLs off info HTML-on-miss onto assets CDN, i18n for Stats/Bag/slots, weapon hotbar iconUrl, Toon RTS kit link, tierLabel SSOT.
Summary by Sourcery
Fix main-panel asset loading and character previews while expanding localization and equipment metadata consistency.
New Features:
Bug Fixes:
Enhancements:
CodeAnt-AI Description
Fix main panel assets and hero animation while expanding localization
What Changed
Impact
✅ Fewer broken equipment and skill icons✅ Character previews remain visible when idle animation data is incompatible✅ Consistent multilingual equipment labels💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.