Skip to content

Restore Market Filter with Custom Expression Parser#403

Open
GODrums wants to merge 2 commits into
feat/market-pattern-enhancementsfrom
feat/expression-ast-parser
Open

Restore Market Filter with Custom Expression Parser#403
GODrums wants to merge 2 commits into
feat/market-pattern-enhancementsfrom
feat/expression-ast-parser

Conversation

@GODrums

@GODrums GODrums commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Closes #400

Step 3 of #395

Adds a compatibility layer to support our filter container in the Steam Market Beta.

Due to React's self CSP, it also replaces filtrex with a custom expression parser supporting the same input syntax. Architected with Opus 4.8, reviewed by Fable 5. Tested all variables and operators manually

Screenshots

image

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 gFilterService highlighting used on the classic market.

filtrex is removed and replaced with an in-tree compile_expression tokenizer/parser/evaluator so filter syntax still works under React’s stricter CSP. Filter now compiles through that module; isValidReturnValue treats any non-Error result as valid instead of only booleans and 0/1.

Beta BetaListingEnhancer derives 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.

@GODrums GODrums self-assigned this Jun 13, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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.

Comment thread src/lib/components/market/react/listing.ts
/** Use the title of the page to get the market hash name */
function marketHashName(): string | undefined {
return document.title.match(/^(.+?) - Steam Community Market$/)?.[1] ?? undefined;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

English-only title filter key

Medium Severity

Item filter storage keys are parsed from document.title with a suffix fixed to the English string Steam Community Market. Localized Steam clients use different title suffixes, so marketHashName() returns undefined, the filter panel renders nothing, and per-item filters never initialize on the beta market for those users.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 47b0317. Configure here.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant