Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@samwoodall
Copy link
Contributor

@samwoodall samwoodall commented Dec 1, 2025

Include training_center_uk in the sortedBuildings used to populate the building in [raceId].tsx So that it appears in https://coh3stats.com/explorer/races/british

resolves #856

Before
brit-buildings

After
brit-buildings-post

After Upgrades
Screenshot 2025-12-01 at 17-32-34 British Forces - COH3 Explorer COH3 Stats

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted the ordering of multiplayer production buildings for improved organization.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

The filterMultiplayerBuildings function in src/unitStats/faction.ts is modified to prepend buildings with unitTypes including "training_center_uk" to the sorting sequence, prioritizing their display in the multiplayer buildings list. No other logic or filters are altered.

Changes

Cohort / File(s) Summary
Building Display Sort Adjustment
src/unitStats/faction.ts
Modified filterMultiplayerBuildings function to prepend Training Center (UK) buildings to the front of the sorted buildings list, ensuring they display in the British Forces buildings section.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Review the sorting logic prepend operation to confirm it correctly identifies and prioritizes training_center_uk buildings
  • Verify the change doesn't inadvertently affect other building types or filter categories

Poem

🐰 A center for training was lost from the view,
But now with a sort, it shines bright and true,
Prepended with pride to the British brigade,
The Training Center stands in the grand parade!

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding the Training Center to the British buildings display.
Linked Issues check ✅ Passed The PR directly addresses issue #856 by adding 'training_center_uk' to the sortedBuildings array to display the Training Center in the British buildings section.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to adding a building identifier to the sort sequence, which is directly required by issue #856 with no extraneous modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ddca47e and cb39350.

📒 Files selected for processing (1)
  • src/unitStats/faction.ts (1 hunks)
🔇 Additional comments (1)
src/unitStats/faction.ts (1)

132-132: Verify that training_center_uk exists in the data and placement matches in-game order.

The addition follows the existing pattern correctly. However, please confirm that:

  1. The training_center_uk value actually exists in the unitTypes array of British buildings in the ebps data
  2. The placement at the top of the sort order matches the in-game building menu order (as mentioned in the comment on line 130)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@petrvecera
Copy link
Member

Awesome ❤️

@petrvecera petrvecera merged commit 41b5a02 into cohstats:master Dec 1, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Training Center Missing from British Forces Buildings Section

2 participants