refactor(uniformbuilder): sort weapon qual plates by catalog awardPriority - #243
Merged
Merged
Conversation
…ority Weapon quals were the one ordered award type that did not read its order from the catalog. WeaponQual kept a hand list of tags in S1 SOP order and sortQuals used indexOf into it, so adding a weapon took three edits that had to agree by hand: the catalog entries, the slot, and the plate file. The plate had a test. The slot did not, and no canvas test can see a missing slot for the last weapon in the SOP, because last is where the SOP puts it. #229 was one instance of that class. Every weapon qual catalog entry now carries awardPriority, its rank in the SOP. Ribbons, medals and tabs already sort by that field. WeaponQual records the rank as each qual is filed and sorts by it. The hand list is gone. Ranks 9 and 10 are left for Carbine and Auto Rifle, which the SOP lists and MILPAC does not award yet. Tests. The reverse-SOP canvas test now holds all ten weapons and is the one place a person types out the SOP order, so a swapped or tied priority fails there. A guard beside it checks that list names every weapon qual in the catalog, so the next weapon cannot land without a place in it. A catalog row per tag checks the three entries carry one number, so a missing priority fails on the day the entry lands, last weapon included. The "stacks above the last weapon" family is gone. The catalog row covers what it covered with no blind spot, and its anchor would have gone red for the wrong reason on the next weapon the SOP appends. Stacked on #241. What a member sees on the uniform does not change. Closes #242 > *This was generated by AI*
SyniRon
enabled auto-merge (squash)
September 14, 2026 23:35
Vercin-G
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #242
Built on #241, which merged while this was in progress. Rebased onto
main, so the diff is this change alone.What changed
AWARD_CATALOGcarriesawardPriority, its rank in the S1 Uniforms SOP weapon order. All three entries for a weapon carry the same number. Ranks 9 and 10 are left open for Carbine and Auto Rifle, which the SOP lists and MILPAC does not award yet. The section comment says so.WeaponQualrecords the rank as each qual is filed andsortQualssorts by it. The hand listweaponOrderand itsindexOfsort are gone. The level arrays are still arrays of tags, because the canvas names the plate file after the tag.Why
Adding a weapon took three edits that had to agree by hand: the catalog entries, the slot in
weaponOrder, and the plate file. The plate had a test. The slot did not, and no canvas test could see a missing slot for the last SOP weapon, because last is where the SOP puts it. #229 was one instance of that class. Ribbons, medals, unit citations and tabs already sort byawardPriorityfrom the catalog. Weapon quals were the one ordered type that did not.What a member sees on the uniform does not change.
For the reviewer
pistolfails with[null,7]. An eleventh weapon added with Mk-82's number and no row in the held list: the guard fails namingCarbine Expert.weaponQualPlates.jscomment named the deleted list, so it is reworded. No code change there.npm testexit 0 (215 sprite assertions, 46 catalog, 29 canvas, 13 numerals, server).npm run format:checkclean.