{ "task_id": "c47", "layer": "composite", "seed_type": "prd", "operators": [ "generate", "add state", "remove section", "wire up data", "restructure layout" ], "difficulty": "challenging", "levers": [ "state coupling", "cross-requirement combined state", "exact numeric assertions" ], "domain": "booking service", "repair": false, "inject_type": null, "seed_meta": { "authored_by": "hand", "materials": "none" }, "title": "Short Stay Lodging: From Site Build to Nightly-Price Recalculation and High-Rating Filtering", "milestones": [ { "operator": "generate", "request": "Build a site homepage called “Short Stay Lodging”, with the tagline “Stay one night, remember it for a long time”. Put the site name and a “My Saved (0)” entry in the top bar.\n\nBelow that is a filter bar whose categories are fixed as All / Homestay / Hotel / Campground, defaulting to “All”. The main body is a room type list with 20 items in total, distributed as: Homestay 8, Hotel 7, Campground 5.\n\nEach item must have a name, its category, a nightly price, and a “Save” button. Nightly prices are assigned by position: item n = 180 + n × 40. Each item also has a rating; item 1 is 4.9, and each subsequent item is 0.15 lower than the previous one. The list is sorted by rating from high to low by default." }, { "operator": "add state", "request": "“Save” must actually work. After clicking, the button changes to “Saved” and the “My Saved” count in the top bar increases by 1; clicking again cancels it and the count decreases by 1. This count and each item's button state must not be lost after switching categories." }, { "operator": "wire up data", "request": "Add a summary line below the filter bar: “N items · Total nightly prices M”. N is the number of items under the current category, and M is the sum of the nightly prices of those items; it must update when switching categories, and the numbers must be calculated accurately." }, { "operator": "remove section", "request": "We're dropping the “Campground” category; remove the category together with those 5 items. After removal, nightly prices are recalculated by new position (item n = 180 + n × 40), and the summary line must update accordingly." }, { "operator": "make interactive", "request": "Add a “High ratings only” toggle to the filter bar; when on, only items with a rating of at least 4.5 are shown. The toggle state must persist after switching categories, and the top-bar count must not change before or after toggling the filter." } ], "checklist": [ { "id": "gen.tabs", "m": 1, "dimension": "visual", "w": 1.5, "description": "The filter bar has exactly 4 categories, with the text, in order: All / Homestay / Hotel / Campground; “All” is selected and distinguishable from the other categories." }, { "id": "gen.total", "m": 1, "dimension": "functional", "w": 1.5, "description": "Under the All category, the total number of room types is 20." }, { "id": "gen.val.desc", "m": 1, "dimension": "functional", "w": 1.5, "description": "By default sorted by rating in descending order: item 1 is 4.9, item 2 is 4.8, item 3 is 4.6." }, { "id": "gen.extra.rule", "m": 1, "dimension": "functional", "w": 1.5, "description": "Nightly prices are calculated by position: item 1 is 220, item 2 is 260, item 5 is 380." }, { "id": "gen.split", "m": 1, "dimension": "functional", "w": 1.0, "description": "After switching categories, the counts per category are: Homestay 8, Hotel 7, Campground 5." }, { "id": "gen.card", "m": 1, "dimension": "visual", "w": 1.0, "description": "Each card simultaneously shows the name, category, nightly price, rating, and a “Save” button." }, { "id": "gen.header", "m": 1, "dimension": "visual", "w": 1.0, "description": "The top bar shows the site name “Short Stay Lodging”, the tagline “Stay one night, remember it for a long time”, and the “My Saved” entry, with an initial count of 0." }, { "id": "gen.sel.one", "m": 1, "dimension": "visual", "w": 1.0, "description": "At any given moment, exactly one category in the filter bar is selected." }, { "id": "st.add1", "m": 2, "dimension": "interaction", "w": 1.5, "description": "Click “Save” on item 1; the button changes to “Saved” and the top-bar count is 1." }, { "id": "st.add3", "m": 2, "dimension": "interaction", "w": 1.5, "description": "Then do the same for items 2 and 3; the top-bar count is 3 and all three items show “Saved”." }, { "id": "st.cancel", "m": 2, "dimension": "interaction", "w": 1.5, "description": "Click item 2 again; the button returns to “Save” and the top-bar count is 2." }, { "id": "st.keep.tab", "m": 2, "dimension": "interaction", "w": 1.5, "description": "After acting on 3 items, switch to “Homestay” and back to All; the top-bar count is still 3 and the original three items still show “Saved”." }, { "id": "st.no.dup", "m": 2, "dimension": "interaction", "w": 1.0, "description": "Click the same item twice in a row; the net change in count is 0 (no duplicate counting)." }, { "id": "st.badge.visible", "m": 2, "dimension": "visual", "w": 1.0, "description": "The top-bar count number updates visibly immediately after the action, without refreshing the page." }, { "id": "data.sum.all", "m": 3, "dimension": "functional", "w": 1.5, "description": "Under All, the summary line shows “20 items”, and the total nightly prices equal the sum of the 20 items, with exact numbers." }, { "id": "data.sum.tab", "m": 3, "dimension": "functional", "w": 1.5, "description": "Switch to “Homestay”; the item count in the summary line becomes 8, and the total equals the sum of that category's items." }, { "id": "data.sum.pos", "m": 3, "dimension": "visual", "w": 1.0, "description": "The summary line is located below the filter bar, with wording of the form “N items · Total nightly prices M”." }, { "id": "data.sum.switch", "m": 3, "dimension": "interaction", "w": 1.5, "description": "Switch back and forth twice between two different categories; the item count and total in the summary line match the current category each time." }, { "id": "data.sum.keep.state", "m": 3, "dimension": "interaction", "w": 1.5, "description": "Act on 2 items first, then switch categories; the summary line changes with the category while the top-bar count remains 2." }, { "id": "del.tab.gone", "m": 4, "dimension": "coverage", "w": 1.5, "description": "The filter bar has only 3 categories left; “Campground” no longer appears." }, { "id": "del.total", "m": 4, "dimension": "functional", "w": 1.5, "description": "Under All, the total becomes 15 items." }, { "id": "del.none.left", "m": 4, "dimension": "coverage", "w": 1.0, "description": "Browse the 15 items one by one; no item's category is “Campground”." }, { "id": "del.extra.recalc", "m": 4, "dimension": "functional", "w": 1.5, "description": "Nightly prices are recalculated by new position: item 1 is 220, item 5 is 380, and the last item (item 15) is 780." }, { "id": "del.sum.update", "m": 4, "dimension": "functional", "w": 1.5, "description": "The summary line updates in sync to “15 items”, and the total equals the sum of the 15 recalculated items." }, { "id": "del.keep.state", "m": 4, "dimension": "interaction", "w": 1.5, "description": "Before deleting, act on 2 items in the retained categories; after deleting “Campground”, the top-bar count is still 2 and those 2 items still show “Saved”." }, { "id": "int.toggle.exists", "m": 5, "dimension": "visual", "w": 1.5, "description": "A “High ratings only” toggle exists near the filter bar; it is clickable and has clearly distinct on/off states." }, { "id": "int.toggle.filter", "m": 5, "dimension": "interaction", "w": 1.5, "description": "After turning on “High ratings only”, every item in the list has a rating of at least 4.5; all items below that value are invisible." }, { "id": "int.toggle.off", "m": 5, "dimension": "interaction", "w": 1.0, "description": "After turning the toggle off, the list returns to 15 items." }, { "id": "int.toggle.keep.tab", "m": 5, "dimension": "interaction", "w": 1.5, "description": "After turning on “High ratings only”, switch categories; the toggle is still in the on state (not reset)." }, { "id": "int.count.keep", "m": 5, "dimension": "interaction", "w": 1.5, "description": "After acting on 2 items, toggle “High ratings only” on and off twice in a row; the top-bar count is always 2." }, { "id": "int.combo.all", "m": 5, "dimension": "interaction", "w": 1.5, "description": "Act on 2 items → switch to “Homestay” → turn on High ratings only → switch back to All; the top-bar count, summary line, and toggle state are all correct at the same time." }, { "id": "int.layout.ok", "m": 5, "dimension": "visual", "w": 1.0, "description": "After toggling the filter, card information remains fully visible, with no text truncation or element overlap." }, { "id": "int.sum.with.filter", "m": 5, "dimension": "visual", "w": 1.0, "description": "After enabling the filter, the summary line is still visible and not empty." } ], "inject": null, "qc_static": [], "review_status": "hand_authored", "hand_notes": { "cross_requirement_items": 7, "dim_counts": { "visual": 9, "functional": 9, "interaction": 13, "coverage": 2 } } }