Skip to content

Add +colN perk column search with quote-safe parsing and autocomplete#11872

Open
delphiactual wants to merge 2 commits into
masterfrom
perk-column-search
Open

Add +colN perk column search with quote-safe parsing and autocomplete#11872
delphiactual wants to merge 2 commits into
masterfrom
perk-column-search

Conversation

@delphiactual

Copy link
Copy Markdown
Contributor

Lets perk:/perkname:/exactperk: restrict matches to specific perk columns via a +colN suffix (e.g. rangefinder+col3, repeatable as +col3+col4), counting an item's visible perk columns from the left.

  • Re-attach a trailing +colN run to a quoted filter's args in the lexer so perkname:"firefly"+col3 works the same as the unquoted form (the suffix otherwise fell outside the quotes and was silently dropped).
  • Autocomplete +col1..+col5 as soon as a + is typed right after a perk value, with or without quotes and without a separating space. Scoped to perk filters, so multiquery + filters like dupe: are unaffected.
  • Tests: parsePerkColumns units, real-item column filtering (incl. the quoted regression), lexer snapshots, and autocomplete + dupe cases.

Closes #11724

Lets perk:/perkname:/exactperk: restrict matches to specific perk columns
via a +colN suffix (e.g. rangefinder+col3, repeatable as +col3+col4),
counting an item's visible perk columns from the left.

- Re-attach a trailing +colN run to a quoted filter's args in the lexer so
  perkname:"firefly"+col3 works the same as the unquoted form (the suffix
  otherwise fell outside the quotes and was silently dropped).
- Autocomplete +col1..+col5 as soon as a `+` is typed right after a perk
  value, with or without quotes and without a separating space. Scoped to
  perk filters, so multiquery `+` filters like dupe: are unaffected.
- Tests: parsePerkColumns units, real-item column filtering (incl. the
  quoted regression), lexer snapshots, and autocomplete + dupe cases.

Changelog: Perk searches can now target a specific perk column, e.g. perkname:rangefinder+col3.
- perkColumnCompletion: the partial-selector group was captured but unused
  (regexp/no-unused-capturing-group) - make it non-capturing.
- freeform.test.ts: ItemFilter<DimItem> -> ItemFilter (DimItem is the default).
@bhollis

bhollis commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

I don't really think specific-column searches make sense. Don't you think it'd be nicer to have a "perks that can be selected together" search e.g. perkname:A&B?

@Revadike

Revadike commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

One example could be if you want to search guns with a damage perk in the left column

@bhollis

bhollis commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

I mean, I guess I won't fight it too hard but targeting specific columns seems extremely niche vs. expressing what you want more directly (e.g. "I want both of these perks to be usable at once")

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.

Filter weapon perks by column index

3 participants