Skip to content

Refactor buy similar to match by stat descriptors - #2314

Merged
LocalIdentity merged 1 commit into
PathOfBuildingCommunity:devfrom
vaisest:refactor-buy-similar-matching-again
Jun 30, 2026
Merged

Refactor buy similar to match by stat descriptors #2314
LocalIdentity merged 1 commit into
PathOfBuildingCommunity:devfrom
vaisest:refactor-buy-similar-matching-again

Conversation

@vaisest

@vaisest vaisest commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Description of the problem being solved:

I don't think my previous approach of looking up mods that would fit the item was really correct. This doesn't have many advantages right now, but I think this is much more maintainable (e.g. new mod categories don't need to be paid attention to), makes more sense, and solves some mod matching issues.

Basically, the idea is to convert the {n} pattern of stat descriptors to a Lua pattern, which we can then iterate over to find a match. Local vs global mods are handled similar to EE2 by just adding a count filter with all matched options

Some option-based mods were also fixed that were broken due to casing or incorrect newline handling. Timeless jewel mods are still broken because PoB splits it into two mods, but who cares. This allows for matching mods which can have various forms based on the mod value, and the same descriptors should also include data on whether the value should be negated. This should also fix some mods where the first number in the line is NOT what is entered on the trade site, although this only includes a handful of mods

I'm also going to add tests of some sort

Steps taken to verify a working solution:

  • Many tests added
  • Many items manually tested

Link to a build that showcases this PR:

Before screenshot:

After screenshot:

Based on display item buy similar PR for testing purposes (first 3 commits)

@vaisest vaisest changed the title Add "Buy similar" button to display item controls Refactor buy similar to match by stat descriptors Jun 27, 2026
@vaisest vaisest added enhancement New feature, calculation, or mod pob1 Should also be merged into PoB1 Repo bug: behaviour Behavioral differences and removed enhancement New feature, calculation, or mod labels Jun 27, 2026
@vaisest
vaisest marked this pull request as draft June 27, 2026 18:28
@vaisest
vaisest force-pushed the refactor-buy-similar-matching-again branch from d177e72 to 40b8260 Compare June 29, 2026 10:04
@vaisest
vaisest force-pushed the refactor-buy-similar-matching-again branch from 40b8260 to d7aacdb Compare June 29, 2026 15:25
@vaisest
vaisest marked this pull request as ready for review June 29, 2026 15:25
@LocalIdentity
LocalIdentity merged commit 7b6fb53 into PathOfBuildingCommunity:dev Jun 30, 2026
4 of 5 checks passed
@LocalIdentity LocalIdentity added the technical Hidden from release notes label Jun 30, 2026
prado1506 added a commit to prado1506/PathOfBuilding-PoE2 that referenced this pull request Jun 30, 2026
Resolve conflicts: take upstream's PathOfBuildingCommunity#2314 trade-stat-descriptor refactor
(TradeHelpers, CompareBuySimilar, TestTradeHelpers) as the canonical merged
version of the local pr/2314; keep both sides for independent features in
CalcPerform (Stonefist glove transform + PathOfBuildingCommunity#2159 minion/spectre/companion life
pool) and TestDefence (guard-rate precedence regression test + PathOfBuildingCommunity#2159 tests).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug: behaviour Behavioral differences pob1 Should also be merged into PoB1 Repo technical Hidden from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants