Webdev-Bench / tasks /c42 /task.json
Roy-DOU's picture
Fix the c36 language instruction and drop unrelated reference images
4385304 verified
Raw History Blame Contribute Delete
9.08 kB
{
"task_id": "c42",
"layer": "composite",
"seed_type": "prd",
"operators": [
"generate",
"wire up data",
"add state",
"remove section",
"make interactive"
],
"difficulty": "challenging",
"levers": [
"state coupling",
"cross-requirement combined state",
"exact numeric assertions"
],
"domain": "e-commerce",
"repair": false,
"inject_type": null,
"seed_meta": {
"authored_by": "hand",
"materials": "none"
},
"title": "Shiwuji: e-commerce list from build to inventory linkage and filter takedown",
"milestones": [
{
"operator": "generate",
"request": "Build a niche-goods e-commerce list page called \"Shiwuji\". Put the shop name and a \"Cart (0)\" in the top bar. Below, a category bar: All / Objects / Study / Textiles, defaulting to \"All\".\n\nThere are 18 products in total: Objects 7, Study 6, Textiles 5. Each needs a name, category, price, and an \"Add to cart\" button. Prices start at 88 and each subsequent item adds 37 (88, 125, 162…), sorted by price low to high. The list fits on one page, no pagination."
},
{
"operator": "wire up data",
"request": "Add an inventory number behind each product. Inventory follows this rule: in the current display order, the n-th item's inventory = (n × 7) mod 5 plus 1, i.e. cycling between 1 and 5. Products with inventory 1 must be marked \"Only 1 left\"."
},
{
"operator": "add state",
"request": "The cart has to actually work. Clicking \"Add to cart\" increments the top-bar count by 1, and the same item can be added up to its inventory limit; once at the limit the button changes to \"Reached limit\" and can't be clicked. Also add a \"Total ¥X\" to the top bar, where X is the sum of added products' prices times quantities, and it must be accurate."
},
{
"operator": "remove section",
"request": "We're not doing the \"Textiles\" category any more — remove the category tab and those 5 products together. After removal, the product total and the inventory numbering rule are recomputed in the new order (i.e. the n-th item still computes inventory by its new position)."
},
{
"operator": "make interactive",
"request": "Add an \"In stock only\" toggle to the category bar; when on, hide products with inventory 0 — there are none with 0 inventory right now, so the list doesn't change when it's on, but the toggle itself must be able to turn on and off, and the toggle state must persist after switching categories. Also, the cart count and total must not be lost after switching categories or toggling the filter."
}
],
"checklist": [
{
"id": "gen.cats.four",
"m": 1,
"dimension": "visual",
"w": 1.5,
"description": "The category bar has exactly 4 tabs: All / Objects / Study / Textiles, with \"All\" in the selected state and distinguishable from the others."
},
{
"id": "gen.count.18",
"m": 1,
"dimension": "functional",
"w": 1.5,
"description": "Under the All category there are exactly 18 products, all displayed on one page, with no pagination controls on the page."
},
{
"id": "gen.price.seq",
"m": 1,
"dimension": "functional",
"w": 1.5,
"description": "In price ascending order: item 1 is ¥88, item 2 is ¥125, item 3 is ¥162."
},
{
"id": "gen.price.last",
"m": 1,
"dimension": "functional",
"w": 1.0,
"description": "The last item (the 18th) has a price of ¥717."
},
{
"id": "gen.cat.split",
"m": 1,
"dimension": "functional",
"w": 1.0,
"description": "After switching category: Objects 7, Study 6, Textiles 5."
},
{
"id": "gen.card.parts",
"m": 1,
"dimension": "visual",
"w": 1.0,
"description": "Each product card simultaneously shows name, category, price, and an \"Add to cart\" button."
},
{
"id": "gen.cart.zero",
"m": 1,
"dimension": "visual",
"w": 1.0,
"description": "The top bar shows the shop name \"Shiwuji\" and the cart entry, with an initial count of 0."
},
{
"id": "data.stock.first",
"m": 2,
"dimension": "functional",
"w": 1.5,
"description": "Inventory is computed by position: item 1 inventory 3, item 2 inventory 5, item 3 inventory 2 (n×7 mod 5 + 1)."
},
{
"id": "data.stock.only1",
"m": 2,
"dimension": "visual",
"w": 1.5,
"description": "The \"Only 1 left\" mark is visible on product cards whose inventory is 1, and that mark appears only on cards with inventory 1."
},
{
"id": "data.stock.visible",
"m": 2,
"dimension": "visual",
"w": 1.0,
"description": "Every product card shows an inventory number."
},
{
"id": "data.stock.range",
"m": 2,
"dimension": "functional",
"w": 1.0,
"description": "Checking item by item, all inventory values fall between 1 and 5, with no 0 or values greater than 5."
},
{
"id": "st.cart.add",
"m": 3,
"dimension": "interaction",
"w": 1.5,
"description": "Clicking \"Add to cart\" on item 1 changes the top-bar count to 1 and the total to ¥88."
},
{
"id": "st.cart.sum2",
"m": 3,
"dimension": "interaction",
"w": 1.5,
"description": "Adding item 2 changes the top-bar count to 2 and the total to ¥213 (88+125)."
},
{
"id": "st.cart.limit",
"m": 3,
"dimension": "interaction",
"w": 1.5,
"description": "Clicking item 3 (inventory 2) three times in a row increases the count by only 2, and the button changes to \"Reached limit\" and can't be clicked."
},
{
"id": "st.cart.sum.exact",
"m": 3,
"dimension": "functional",
"w": 1.5,
"description": "After adding 1 of item 1, 1 of item 2, and filling 2 of item 3, the total is exactly ¥537 (88+125+162×2)."
},
{
"id": "st.cart.keep.cat",
"m": 3,
"dimension": "interaction",
"w": 1.5,
"description": "After adding, switching to Study and back to All leaves the top-bar count and total unchanged."
},
{
"id": "st.cart.display",
"m": 3,
"dimension": "visual",
"w": 1.0,
"description": "The top bar simultaneously shows the cart count and the \"Total ¥X\"."
},
{
"id": "del.textile.gone",
"m": 4,
"dimension": "coverage",
"w": 1.5,
"description": "The category bar has only 3 tabs left, and \"Textiles\" no longer appears."
},
{
"id": "del.count.13",
"m": 4,
"dimension": "functional",
"w": 1.5,
"description": "Under the All category the products become 13."
},
{
"id": "del.no.textile",
"m": 4,
"dimension": "coverage",
"w": 1.0,
"description": "Browsing all 13 items, none has the category Textiles."
},
{
"id": "del.stock.recalc",
"m": 4,
"dimension": "functional",
"w": 1.5,
"description": "Inventory is recomputed by the new positions: after deletion item 1 has inventory 3, item 2 has inventory 5, item 3 has inventory 2."
},
{
"id": "del.keep.cart",
"m": 4,
"dimension": "interaction",
"w": 1.5,
"description": "Add 2 Objects items before deletion; after deleting Textiles the top-bar count and total stay unchanged."
},
{
"id": "int.stock.toggle",
"m": 5,
"dimension": "visual",
"w": 1.5,
"description": "An \"In stock only\" toggle control exists near the category bar, is clickable, and has clear on/off states."
},
{
"id": "int.stock.on",
"m": 5,
"dimension": "interaction",
"w": 1.5,
"description": "After turning on \"In stock only\" the product count is still 13 (there are currently no zero-inventory products), and the list has not been emptied."
},
{
"id": "int.stock.off",
"m": 5,
"dimension": "interaction",
"w": 1.0,
"description": "After turning the toggle off it returns to the off state, and the product count is still 13."
},
{
"id": "int.stock.keep.cat",
"m": 5,
"dimension": "interaction",
"w": 1.5,
"description": "After turning on \"In stock only\" and switching to Study, the toggle is still on (not reset)."
},
{
"id": "int.cart.keep.filter",
"m": 5,
"dimension": "interaction",
"w": 1.5,
"description": "After adding 2 items, toggling \"In stock only\" twice leaves the top-bar count and total unchanged."
},
{
"id": "int.combo.all",
"m": 5,
"dimension": "interaction",
"w": 1.5,
"description": "Adding 2 items → switching to Study → turning on In stock only → switching back to All leaves the top-bar count, total, and toggle state all correct at the same time."
},
{
"id": "int.layout.stable",
"m": 5,
"dimension": "visual",
"w": 1.0,
"description": "After the toggle filter, each card's name/price/inventory information is still fully visible, with no misalignment or truncation."
},
{
"id": "int.cat.select",
"m": 5,
"dimension": "visual",
"w": 1.0,
"description": "After switching category the current category tab is in the selected state, and only one tab is selected."
}
],
"inject": null,
"qc_static": [],
"review_status": "hand_authored",
"hand_notes": {
"cross_requirement_items": 5,
"dim_counts": {
"visual": 9,
"functional": 9,
"interaction": 10,
"coverage": 2
}
}
}