Add attribute requirement filters to trade queries#9824
Open
mcagnion wants to merge 2 commits intoPathOfBuildingCommunity:devfrom
Open
Add attribute requirement filters to trade queries#9824mcagnion wants to merge 2 commits intoPathOfBuildingCommunity:devfrom
mcagnion wants to merge 2 commits intoPathOfBuildingCommunity:devfrom
Conversation
Adds an "Include unusable" checkbox (off by default) to the Trader pane that hides search results whose Str/Dex/Int (or Omni) requirements the build cannot meet once equipped. Filtering is applied across all sort modes and cached per result to avoid redundant calcFunc calls. When filtering drops every result, the dropdown and total-price state are cleared and a dedicated notice is shown. Adds a matching "Attributes Requirements" checkbox (on by default) to the TradeQueryGenerator popup. When enabled, the shortfall (build requirement minus build attribute) is inserted as pseudo.pseudo_total_* min filters in the generated query so trade search only returns items that cover the missing attributes. Also hardens UI state transitions around filtered results: the result dropdown selection callback guards against stale indices, the section anchor preserves its base Y when the scrollbar offsets it, and empty sorted results no longer crash UpdateDropdownList / UpdateControlsWithItems. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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:
Trade searches can return items that look like good upgrades but leave the build short of attribute requirements once equipped.
This adds two controls for that case:
Attribute requirementsin Trade Query Options adds Strength, Dexterity, and Intelligence pseudo filters to the generated trade query when the current build is short on attributes.Hide results failing attribute requirementsin the Trader pane hides already fetched results that would still leave unmet attribute requirements after equipping the item.The Trader pane filter is opt-in and remains unchecked by default, so existing result visibility is preserved unless the user enables it.
Steps taken to verify a working solution:
Screenshots:
Trade Query Options
Trader