evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
{
"context": "This criteria evaluates how well the engineer uses the nuqs package's useQueryStates hook to manage multiple URL query parameters with proper type parsing, URL key mapping, and atomic state updates.",
"type": "weighted_checklist",
"checklist": [
{
"name": "useQueryStates Import",
"description": "Correctly imports useQueryStates hook from the nuqs package",
"max_score": 10
},
{
"name": "Parser Configuration",
"description": "Uses appropriate nuqs parsers for each filter type: parseAsString for category and search, parseAsInteger or parseAsFloat for price values, and parseAsBoolean for stock filter",
"max_score": 20
},
{
"name": "URL Key Mapping",
"description": "Implements URL key mapping to map internal state names (category, minPrice, maxPrice, inStockOnly, searchQuery) to short URL parameter names (cat, min, max, stock, q)",
"max_score": 20
},
{
"name": "useQueryStates Hook Usage",
"description": "Uses useQueryStates hook with a parser object defining all five filters (category, minPrice, maxPrice, inStockOnly, searchQuery) to manage multiple parameters as a single state object",
"max_score": 15
},
{
"name": "Atomic Updates",
"description": "Implements atomic updates by calling the setState function with multiple parameters at once (e.g., for preset filter or clear all functionality)",
"max_score": 15
},
{
"name": "Clear All Functionality",
"description": "Implements clear all filters by calling setState(null) to remove all managed query parameters from the URL simultaneously",
"max_score": 10
},
{
"name": "Partial Updates",
"description": "Demonstrates partial updates where individual filter changes preserve other filter values by passing an object with only the changed properties",
"max_score": 10
}
]
}