Skip to content

Add resistance-aware Trader searches - #10171

Draft
mcagnion wants to merge 8 commits into
PathOfBuildingCommunity:devfrom
mcagnion:feature/trade-element-swap-search
Draft

Add resistance-aware Trader searches#10171
mcagnion wants to merge 8 commits into
PathOfBuildingCommunity:devfrom
mcagnion:feature/trade-element-swap-search

Conversation

@mcagnion

@mcagnion mcagnion commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Related: #9217

Description of the problem being solved

Trader currently gives resistance its full weight even after a build reaches its caps. It also treats Fire, Cold, and Lightning Resistance as fixed stats, although eligible modifiers can be changed with Harvest.

Changes

  • Resistance swaps searches elemental resistance as a total, then reevaluates the results using the best eligible swap.
  • Resistance caps uses the current Elemental and Chaos Resistance caps when choosing the estimated variant for each listing. Items that still miss a cap remain visible, resistance above caps does not improve that variant, and the selected result sort remains unchanged between listings.
  • Result evaluation yields between build calculations and reports progress so the interface remains responsive.
  • Holding Ctrl shows the original listing beside the estimated swapped item and marks changed lines with [Swap].

Swap values are estimates because the resistance roll may change. Results with incomplete or ambiguous Trade metadata are left unchanged.

Estimated swap comparison

Original trade item beside the estimated resistance swap

Query options

Resistance swaps option and tooltip

Verification

  • Added focused coverage for cooperative evaluation, resistance-state dependencies, missing-target pruning, partial repairs, cap preference, and stable result sorting.
  • Manually checked both query options, retained partial results, result ordering, tooltip text, the Ctrl comparison, and interface responsiveness.

No specific build is required; the options use the current build's resistance requirements.

@mcagnion
mcagnion marked this pull request as draft August 8, 2026 16:04
@mcagnion
mcagnion force-pushed the feature/trade-element-swap-search branch from 3206e11 to 2399075 Compare August 12, 2026 22:01
Separate resistance swaps from cap requirements so searches can broaden elemental candidates without overvaluing excess resistance. Validate fetched permutations against the build's actual elemental and Chaos caps while preserving the listed item for import.
Keep the listed trade item unchanged while Ctrl shows the exact variant used for ranking. Highlight swapped mod lines and clarify that Harvest rolls may change.
Evaluate fetched variants cooperatively, reuse unchanged cached results, and
skip permutations only when cap state and resistance dependencies prove they
cannot affect the selected result.
Replace the cspell-rejected "reranking" term without changing test behavior.
Remove an unused integration-only argument and align nearby comments with project terminology. Behavior is unchanged on the standalone feature branch.
Track fetch identity independently from UI labels and invalidate stale selections while cooperative evaluation is pending. Clear capped candidate state when pasted URL results replace a generated search.
Construct tooltip instances explicitly after the upstream class-constructor migration, including the Ctrl preview and its focused tests.
Align option, cache, and evaluation names with their actual behavior. Remove duplicated result state and descriptor fields that had no production consumer.
@mcagnion
mcagnion force-pushed the feature/trade-element-swap-search branch from 2399075 to 8fc3682 Compare August 18, 2026 21:03
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