Skip to content

Add resistance-aware Trader searches - #10171

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

Add resistance-aware Trader searches#10171
mcagnion wants to merge 7 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 mods 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 keeps only results that reach the current Elemental and Chaos Resistance caps. Resistance above those caps no longer affects sorting.
  • Holding Ctrl shows the original listing beside the estimated swapped item and marks changed lines with [Swap].
  • Import and whisper still use the original listing.

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 Resistance caps option and tooltip

Verification

  • Full automated test suite.
  • Manual checks of both query options, result ordering, tooltip text, and the Ctrl comparison.

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
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.
@mcagnion
mcagnion force-pushed the feature/trade-element-swap-search branch from 3206e11 to 2399075 Compare August 12, 2026 22:01
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