Skip to content

Gear sets: a category named after a set takes the set's items (#1368) - #1372

Merged
Cidan merged 1 commit into
mainfrom
fix-1368-gear-set-named-category
Nov 19, 2026
Merged

Cidan merged 1 commit into
mainfrom
fix-1368-gear-set-named-category

Conversation

@Cidan

@Cidan Cidan commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Fixes #1368.

Problem

Since #1333, an equipment set gets no Gear: <set> category when one of the player's categories (or a plugin's) already has that name. Before #1333, every set item was labeled Gear: <set> ahead of every category, so a category with that name received all of the set's items. Players have such categories: made by hand to style the section, a search category named after it, or made by the classic bags' Shift title drop on the set's header. After #1333 those items went to their type category, so a rule category = "Gear: Tank" matched nothing and a search for the set's name matched only item names.

Reproduced on the real Items, Categories and Search modules over test.lua, before 1d1299a and on main:

Configuration Before #1333 main This PR
No category named Gear: Tank 3 of 3 in Gear: Tank 3 of 3 3 of 3
Rule named Gear: Tank, category = "Gear: Tank" 3 of 3 0 of 3 3 of 3
List Gear: Tank holding 1 of the set's items 3 of 3 1 of 3 3 of 3 (on top of the list)

Change

  • Categories:gearSetOf: a set with no category of its own uses the category named after it (the player's first, else a plugin's). The Equipment Set switch, Used In and Ignored Items apply as for a set's category, and the category competes by its place in the Categories list as a set's category does.
  • Categories:GetCustomCategory returns a fourth value, added (the item was added by hand). items:GetCategory and the vendor (next/merchant.lua) read it in place of the category's save flag, so a category of the player's reached through its set does not win over rules placed above it.
  • Docs: category-lifecycle.md §6 and §12, README.md, data/README.md, help article.

Tests

New assertions in spec/categories_spec.lua, spec/refresh_pipeline_spec.lua, spec/next/merchant_spec.lua and spec/debug_dump_harness_spec.lua (real profile). Each failed before the change. Full suite and luacheck pass.

Bug review

No proven bug. A missing test for which category wins when both the player's and a plugin's have the set's name was added. One edge case, a set whose Gear: name equals a group by's section of another category, is recorded in §12 and not built for.

Since #1333 each equipment set is a category named "Gear: <set>", and a set
gets none when another category (the player's or a plugin's) already has that
name. Before #1333, items:GetCategory labeled every set item "Gear: " and its
first set's name ahead of every category, so a category of the player's with
that name received every item of the set. Players have such categories: made
by hand to style the set's section, a search category named after it, or made
by the classic bags' Shift title drop on the set's header. After #1333 the
set's items fell through to their type category, so a rule
`category = "Gear: Tank"` matched nothing and a bare set name matched only item
names. Reproduced on the real Items, Categories and Search modules over
test.lua, against the build before 1d1299a and against this one.

- Categories:gearSetOf: for a set with no gear set category of its own, the
  category named after it (the player's first, else a plugin's) is the set's
  category. The bag's Equipment Set switch, the category's Used In and its
  Ignored Items apply as for a set's category, and it competes by the order
  of the Categories list as a set's category does. Deleting the player's
  category gives the set its own category at the next sweep.
- Categories:GetCustomCategory returns a fourth value, `added`: the item was
  added to the category by hand. items:GetCategory and the vendor's copy of
  the same decision (next/merchant.lua) read it in place of the category's
  `save` flag. A category of the player's reached through its set also has
  `save`, and with the old check it would have won every set item over every
  rule, including rules placed above it.
- Docs: category-lifecycle.md §6 and §12 (paths now include next/merchant.lua
  and its spec), README.md (the `category` field and Gear Set Categories),
  data/README.md, and the help article's Gear: name line.

Bug review (Prime Directive #2): no proven bug. It found no test pinning
which category takes the items when both the player's and a plugin's have the
set's name (a surviving mutation); one now does. Not built for, recorded in
§12: a set whose "Gear: " name equals a group by's section of another category
puts its items in that section, whose own Ignored Items are empty.

Tests: spec/categories_spec.lua ("gear sets": the player's and a plugin's
category of the name, the order, ignored, Used In, the switch, a rename onto
the name, deletion, precedence), spec/refresh_pipeline_spec.lua and
spec/next/merchant_spec.lua (a rule above the player's category named after
the set takes the item; hand-added stubs return `added`),
spec/debug_dump_harness_spec.lua (the real profile: a rule and a list named
after a set taking its items, the profile's rules above the list taking
theirs). Each new assertion failed before the change. Full suite: 8174
passing before the precedence test was added, which passes on its own in
spec/categories_spec.lua; luacheck clean.
@Cidan
Cidan merged commit 5e5b7be into main Nov 19, 2026
4 checks passed
@Cidan
Cidan deleted the fix-1368-gear-set-named-category branch November 19, 2026 05:24
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.

Search categories for equipment sets ("Gear: <Set Name>") no longer match all set items

1 participant