Add sorting to add-modifier list#9785
Open
mcagnion wants to merge 1 commit intoPathOfBuildingCommunity:devfrom
Open
Add sorting to add-modifier list#9785mcagnion wants to merge 1 commit intoPathOfBuildingCommunity:devfrom
mcagnion wants to merge 1 commit intoPathOfBuildingCommunity:devfrom
Conversation
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.
Description of the problem being solved:
The "Add Modifier to Item" popup in the Items tab lists candidate mods for every source available on the item — prefix / suffix / implicit tiers, bench/master crafts, essences, veiled mods, crafted mods, influenced mods — in source order. When picking between dozens of candidates the user has to eyeball which one most helps the current build, regardless of source.
This PR adds a Sort dropdown to the popup. The metrics are drawn from
data.powerStatList(same source asCompareTab,ItemDBControl,NotableDBControl,SkillsTab,TradeQuery, andRadiusJewelData), so the available sorts stay in sync with every other sort surface in PoB. Selecting a stat recomputes each candidate against the current build viacalcsTab:GetMiscCalculator()and orders them by the resulting output value. "Default" restores the original source order. The sort applies to the current Source filter, so switching Source re-applies automatically with cached values.Steps taken to verify a working solution:
busted --run=quick --lua=luajit --output=gtest ../spec(full spec tree) and got208 successes / 0 failures / 0 errorsin 32 s.data.powerStatListentry.Life,Effective Hit Pool,Life Regen,Armour, etc., promotes the expected mods on a sample build.Defaultrestores the original source order.sortValuestable avoids re-computing when the user switches back to a previously-selected stat.Before — popup without Sort dropdown:
After — sorted by Life:
After — sorted by Effective Hit Pool:
After — Source = Suffix, sorted by Life Regen: