Restore Market Filter with Custom Expression Parser#403
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 47b0317. Configure here.
Step7750
left a comment
There was a problem hiding this comment.
Great stuff, the expression parser is quite clean and ReactListingHighlight is cleaner than I thought it'd be under the React framework.
| @@ -0,0 +1,665 @@ | |||
| import type {InternalInputVars} from './types'; | |||
There was a problem hiding this comment.
Unsure if we have the right infra for testing in the extension, but this would certainly be a spot to use it!
Not a hard blocker, but if it's a few prompts away then I'd say it's worth it.
| const context = this.injectionContext; | ||
| if (!card || !context) return; | ||
|
|
||
| const colour = gFilterService.matchColour(context.itemInfo, this.convertedPrice) || ''; |
There was a problem hiding this comment.
nit: If we don't have a color to apply, we should skip applying a style below. Otherwise, there is risk that we reset a bg color that Valve applies in the future.
| throw new Error(`unexpected token "${token.value}" at ${token.position}`); | ||
| } | ||
|
|
||
| /** Parses the `(...)` operand of `in` / `not in` into a list node. Allows an empty list `()`. */ |
There was a problem hiding this comment.
nit: empty list shouldn't be valid syntax IMO. Is there a use case where var in () could be true?

Closes #400
Step 3 of #395
Adds a compatibility layer to support our filter container in the Steam Market Beta.
Due to React's
selfCSP, it also replacesfiltrexwith a custom expression parser supporting the same input syntax. Architected with Opus 4.8, reviewed by Fable 5. Tested all variables and operators manuallyScreenshots
!https://github.com/user-attachments/assets/1d296ca3-3ec6-4eed-88c5-7ec2f2d5bdef
Note
Medium Risk
Replaces the entire filter expression engine and broadens valid return types, so subtle syntax or truthiness mismatches vs filtrex could affect highlights across classic and beta market pages.
Overview
Brings CSFloat highlight filters back on the Steam Market beta by mounting the existing filter UI above the React listing grid and wiring beta listing cards to the same
gFilterServicehighlighting used on the classic market.filtrexis removed and replaced with an in-treecompile_expressiontokenizer/parser/evaluator so filter syntax still works under React’s stricter CSP.Filternow compiles through that module;isValidReturnValuetreats any non-Errorresult as valid instead of only booleans and0/1.Beta
BetaListingEnhancerderives price from listing fiber props, subscribes to filter updates, and paints each card’s background/text when a filter matches.Reviewed by Cursor Bugbot for commit 47b0317. Configure here.