Skip to content

Add attribute requirement filters to trade queries#9824

Open
mcagnion wants to merge 2 commits intoPathOfBuildingCommunity:devfrom
mcagnion:feature/attributes-requirements-for-trade-query
Open

Add attribute requirement filters to trade queries#9824
mcagnion wants to merge 2 commits intoPathOfBuildingCommunity:devfrom
mcagnion:feature/attributes-requirements-for-trade-query

Conversation

@mcagnion
Copy link
Copy Markdown
Contributor

@mcagnion mcagnion commented Apr 28, 2026

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 requirements in 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 requirements in 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:

  • Added automated coverage for the generated attribute filters and Trader result filtering.
  • Manually tested the new Trader pane controls and result filtering.

Screenshots:

Trade Query Options

after-query-options-attribute-requirements

Trader

after-trader-results-filtered-attributes

mcagnion and others added 2 commits April 28, 2026 23:06
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>
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.

1 participant