Skip to content

feat(sort): add Expansion sort option for items#890

Merged
Cidan merged 1 commit intomainfrom
feat/agent-20260216-194736-000000000
Feb 16, 2026
Merged

feat(sort): add Expansion sort option for items#890
Cidan merged 1 commit intomainfrom
feat/agent-20260216-194736-000000000

Conversation

@Cidan
Copy link
Owner

@Cidan Cidan commented Feb 16, 2026

Adds a new Expansion sort option to the Item Order dropdown for Backpack and Bank. Items are sorted chronologically by expansion from Classic to Midnight, with alphabetical fallback for items within the same expansion.

Add a new "Expansion" sort option to the Item Order dropdown, allowing
users to sort items chronologically by the expansion they were introduced
in (Classic -> TBC -> ... -> Midnight).

Changes:
- core/constants.lua:273: Add EXPANSION = 4 to ITEM_SORT_TYPE enum
- config/config.lua:220-228: Add "Expansion" option to Item Order dropdown
  for both Backpack and Bank, mapping to const.ITEM_SORT_TYPE.EXPANSION
- util/sort.lua:220-242: Implement SortItemsByExpansion function that:
  * Uses data.itemInfo.expacID for expansion ordering
  * Defaults to 0 (Classic) for items with missing expacID
  * Falls back to alphabetical sort when expansions are equal
  * Falls back to item count and GUID for stable sorting
- util/sort.lua:61-76: Update GetItemSortFunction to return
  SortItemsByExpansion when EXPANSION sort type is selected

The expansion ID is already populated by the WoW API via C_Item.GetItemInfo()
and stored in itemInfo.expacID. Lower expansion IDs represent older content
(0 = Classic, 11 = Midnight), providing chronological ordering.

All luacheck validation passes with no warnings or errors.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Cidan Cidan merged commit 0425303 into main Feb 16, 2026
1 of 2 checks passed
@Cidan Cidan deleted the feat/agent-20260216-194736-000000000 branch February 16, 2026 19:49
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

Comments