Skip to content

Conversation

@duiker101
Copy link
Contributor

@duiker101 duiker101 commented Jan 7, 2024

There is already a sort by type, but this is not used for a lot of breakdowns. Applying a sort by value should make it easier to read the breakdown without disrupting the sort by type.

Fixes #4433 #7228

Description of the problem being solved:

The calculations breakdown popups are unsorted, making it harder to compare between builds.

Steps taken to verify a working solution:

  • Verified the mods are sorted in various controls

Before screenshot:

image

After screenshot:

image

There is already a sort by type, but this is not used for a lot of
breakdowns. Applying a sort by value should make it easier to read the
breakdown without disrupting the sort by type.
@QuickStick123 QuickStick123 added the enhancement New feature, calculation, or mod label Jan 8, 2024
Some breakdowns can contain a mix of `number` and `boolean`. e.g. the skill buffs breakdown if you have a golem active will have a `Condition: have golem` with value of `true`.

The values in this kind of breakdown are pretty sparse and sorting them in a coherent way is not easy, so for the sake of this PR we can just keep skip(return false) when comparing number and boolean.
If we try to sort on the original modlist, we'll actually change the order of the values in memory and next time we sort again, some of the mods can move position.

Using a copy of the table--which will be discarded after use--will prevent this.
@LocalIdentity LocalIdentity self-requested a review January 12, 2024 12:09
Copy link
Contributor

@LocalIdentity LocalIdentity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently doesn't sort the stat requirements for gems

@duiker101 duiker101 changed the title Sort the CalcBreakdownControl list by value. ux: Sort the Calc Tab breakdown lists by value Jan 12, 2024
@duiker101 duiker101 changed the title ux: Sort the Calc Tab breakdown lists by value Sort the Calculations Tab breakdown lists by value Jan 12, 2024
Breakdowns can also accept direct breakdown tables and slots values. These also need to be sorted by value.
@duiker101
Copy link
Contributor Author

Added sorting for both breakdown and slots values.

Screenshot from 2024-01-12 11-06-28

Screenshot from 2024-01-12 11-08-02

@LocalIdentity LocalIdentity merged commit 71fefa8 into PathOfBuildingCommunity:dev Jan 13, 2024
@ConKou
Copy link

ConKou commented Jan 23, 2024

Is that working? I'm using the new update and I don't see any difference.
Screenshot_84

@Wires77
Copy link
Member

Wires77 commented Jan 23, 2024

Yes, the value column on the left in your screenshot is sorted in descending order. Previously it would've been in a random order (it's possible the previous listing looked similar so you didn't notice the change)

@ConKou
Copy link

ConKou commented Jan 23, 2024

Yeah I'm stupid, was expecting alphabetical for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, calculation, or mod

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sorting modifiers in Calcs view

5 participants