Datasets:
File size: 19,006 Bytes
dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f dd5428d c14c78f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | {
"task_id": "c12",
"layer": "composite",
"seed_type": "brownfield",
"operators": [
"repair",
"make interactive",
"restyle",
"restructure layout",
"wire up data"
],
"difficulty": "challenging",
"levers": [
"boundary and error paths",
"exact numeric assertions"
],
"domain": "booking service",
"repair": true,
"inject_type": "Missed state update",
"seed_meta": {
"repo_src": null,
"exclude_slug": "react_zh_000043",
"repo_shot": true
},
"title": "Photo Studio Booking Calendar: From Bug Fix to Two-Column Booking Desk and Day/Night Dual Skin",
"milestones": [
{
"operator": "repair",
"request": "First deal with an old bug. Ops reports: the three layout-density icons on the right of each project's title row in the portfolio — clicking one does immediately change the image layout below, but the highlighted icon stays on the previously selected position, and only when you click another icon does the highlight lag over, so it looks like two things are selected. On first page load it's correct, but the moment you click it goes out of sync. Please fix it so the one you click is the one that lights up, with the highlight and the actual column count pointing to the same value at all times. While you're at it, confirm you haven't broken anything around it: clicking the same icon repeatedly must not jump around, changing one project's density must not affect other projects, on narrow screens (browser window dragged narrower than 1100px) the icon row still doesn't appear and the grid is still two columns, and on desktop the original staggered arrangement and the hatched placeholder blocks must stay as they are."
},
{
"operator": "wire up data",
"request": "We want to push this personal site one step toward \"taking on work\": below the opening self-introduction, before the portfolio projects begin, add a whole \"Calendar & Booking\" block. The content is the rental availability of three studios over the next two weeks — the black studio Studio N, the white studio Studio W, and the outdoor deck Deck. Dates run from March 4, 2026 (Wednesday) through March 17 (Tuesday), one full-day slot per studio per day, so that's the total number of entries — the number shown on the page must match. On prices: black studio 1800 a day on weekdays, white studio 1500, deck 1200; Saturdays and Sundays are weekdays price plus twenty percent. The sold portion I've recorded like this: black studio March 5, 6 and 12 are taken by the Bentley shoot; white studio the 7th is booked by a client, and the 13th and 14th shouldn't be released either; the deck has the 4th and 15th booked; also the whole venue is closed for maintenance on the 9th, so none of the three studios can be booked. Each entry must show the studio name, the date (with day of week) and that day's price, and the occupied ones must be clearly marked as unbookable. At the top of this block give me a summary line: how many entries are released in total, how many are still bookable, and how many are occupied — the three numbers must line up exactly with what's actually in the list below. Leave the existing top nav and the footer's \"Lets work together\" plus four links alone."
},
{
"operator": "make interactive",
"request": "The calendar list needs to be filterable, selectable and orderable. The filtering part: a studio filter (All / Studio N / Studio W / Deck), an \"available only\" toggle, and a sort (default by date order, plus price low-to-high and high-to-low — all three sort options must work); there are many entries so show at most 12 per page, with Previous and Next both clickable and correct in both directions, and returning to page 1 whenever a filter or sort changes. The selecting and ordering part: bookable entries can be added to the booking list on the right, occupied ones can't; clicking the same entry repeatedly must not double-count; entries in the booking list can be removed individually, and there must be a \"Clear\" entry to clear them all at once, with an empty-state message when cleared down to nothing. The money works like this: add up the prices of the selected slots, and an order with 3 or more days (inclusive) gets 12% off the whole thing, truncated to remove any decimals; the amount saved must be visible too; the discount applies only to the slot fee, and each order has a fixed 200 setup service fee added after the discount; when the booking list is empty, don't show that 200 either and the total is 0. Placing an order goes in three steps: first select slots, then fill in the contact (name + phone — missing either one blocks proceeding with a clear message), and finally confirm and submit; after submitting, show a booking success and an order number, clear the booking list, and immediately mark the just-booked slots in the list as occupied, with the summary line numbers updating too. The main booking button must stand out, don't make people look for it."
},
{
"operator": "restructure layout",
"request": "Right now the booking block is stacked top to bottom and too long — rearrange it: at window width 1100px and above, make it two columns, with filtering, sorting and the slot list on the left and a booking summary on the right — selected count, slot fee, discount, service fee, amount due — with a \"Go to checkout\" entry beneath that starts the contact form when clicked; as you scroll down the list the summary block on the right must stay visible, not scroll off with it. Between 760 and 1100 pixels is up to you, two columns or a transitional form; at 760px and below it must return to a single column, collapsing the summary into a persistent bar at the bottom showing at least the selected count and the amount due, and the numbers must be identical to the desktop column. During the rearrangement nothing existing may be affected: the filter, sort, current page number and the contents of the booking list must not be reset when the window is resized wider or narrower; the portfolio project area below still runs section by section after the calendar area, with the three density icons still lighting up on the one you click and syncing the column count; and the footer must not be covered by the summary."
},
{
"operator": "restyle",
"request": "Finally add a day/night toggle to the site, with the control at the top. Night is dark background with light text, and the whole site changes together — top, calendar area, portfolio area and footer must all follow, no big glaring white block left; the hatched placeholder blocks in the portfolio grid must darken along with it at night, not become a bright white blotch, and switching back to day must restore the original light-gray hatching. Style-wise keep this site's original restrained black-and-white minimalist feel, not garish — the site keeps only one accent color, shared by the main booking button and the \"selected / added\" states, and this holds under both skins. Switching the skin is only a change of appearance: the booking list's entry count and amount due, the filter and sort, the current page number, and each project's grid density highlight must all stay as they were before the switch. At night the summary line numbers, prices, page numbers and the \"occupied\" markers must also be readable."
}
],
"checklist": [
{
"id": "fix.highlight.sync",
"m": 1,
"dimension": "functional",
"w": 1.5,
"description": "After clicking the \"2 columns\" icon on any project's density switcher, only that icon is immediately in the highlighted/selected state while the other two are not; then clicking \"3 columns\" and then \"4 columns\" highlights exactly the one just clicked each time, with no one-step lag."
},
{
"id": "fix.cols.match",
"m": 1,
"dimension": "functional",
"w": 1.0,
"description": "After clicking \"2 columns\" that project's grid actually renders 2 columns, \"3 columns\" renders 3, \"4 columns\" renders 4; at any moment the column count represented by the highlighted icon matches the actual column count."
},
{
"id": "fix.idempotent",
"m": 1,
"dimension": "interaction",
"w": 1.0,
"description": "Clicking the same density icon 5 times in a row leaves the column count and highlight state unchanged, with no flicker or jumping to another column count."
},
{
"id": "fix.section.isolated",
"m": 1,
"dimension": "functional",
"w": 1.0,
"description": "After switching the first project to 2 columns, the remaining project sections each keep their own column count and highlight (default 4 columns), unaffected."
},
{
"id": "fix.responsive.regression",
"m": 1,
"dimension": "visual",
"w": 1.0,
"description": "Regression: at viewport width ≤1100px the density switcher is not visible, the project grid is fixed at 2 columns, and the cells no longer carry staggered top offsets."
},
{
"id": "fix.stagger.regression",
"m": 1,
"dimension": "visual",
"w": 1.0,
"description": "Regression: at desktop width the original staggered arrangement (some cells offset downward), the hatched placeholder blocks and the image crop ratios present the same as before the fix."
},
{
"id": "data.count.42",
"m": 2,
"dimension": "data",
"w": 1.5,
"description": "The calendar area has 42 slots in total (3 studios × 14 days from 3/4–3/17), and the top summary line shows a total of 42, bookable 31, occupied 11, with all three numbers fully matching the actual entry states in the list."
},
{
"id": "data.price.exact",
"m": 2,
"dimension": "functional",
"w": 1.5,
"description": "Prices exact: weekdays Studio N 1800, Studio W 1500, Deck 1200; weekends (3/7, 3/8, 3/14, 3/15) are twenty percent higher, i.e. Studio N 2160, Studio W 1800, Deck 1440 — these specific dates' prices can be verified entry by entry on the page."
},
{
"id": "data.occupied.set",
"m": 2,
"dimension": "functional",
"w": 1.0,
"description": "The occupied set is exact: all three studios are occupied on 3/9; Studio N on 3/5, 3/6, 3/12, Studio W on 3/7, 3/13, 3/14, and the Deck on 3/4, 3/15 are also occupied, while the remaining 31 entries all show as bookable."
},
{
"id": "data.slot.fields",
"m": 2,
"dimension": "coverage",
"w": 1.0,
"description": "Each slot simultaneously shows the studio name, the date (with day of week) and that day's price; occupied entries carry a clear unbookable marker and bookable entries do not."
},
{
"id": "data.placement",
"m": 2,
"dimension": "visual",
"w": 1.0,
"description": "The calendar area sits below the self-introduction paragraph and above the first portfolio project (polestar); the top nav is still the five links on the right, the footer is still \"Lets work together\" plus four social links, with copy unchanged."
},
{
"id": "flow.combo.diagonal",
"m": 3,
"dimension": "functional",
"w": 1.5,
"description": "Combination spot-check with two-way paging: with \"available only\" on and sorted by price high-to-low there are 3 pages, page 3 has exactly 7 entries and every one is a 1200-yuan weekday Deck slot; clicking \"Previous\" on page 3 returns to page 2, which restores to 12 entries with the page indicator showing 2, and clicking \"Next\" again returns to exactly the same page 3 with 7 entries; turning the filter off and using the default date sort gives 4 pages, with 6 entries on the last page."
},
{
"id": "flow.sort.asc",
"m": 3,
"dimension": "functional",
"w": 1.0,
"description": "Sorted by price low-to-high (with no filter), the first entry on page 1 is a 1200-yuan weekday Deck slot and prices on that page are non-decreasing from top to bottom; switching to the last page, the final entry is a 2160-yuan weekend Studio N slot."
},
{
"id": "flow.filter.studio",
"m": 3,
"dimension": "functional",
"w": 1.0,
"description": "With the studio filter set to \"Studio W\" the list has 14 entries in total (4 of them occupied); adding \"available only\" on top leaves 10 entries shown within a single page and the page number automatically returns to page 1."
},
{
"id": "cart.total.exact",
"m": 3,
"dimension": "functional",
"w": 1.5,
"description": "Amounts and discount exact: after adding Studio N 3/4 (1800) and Studio W 3/5 (1500) the summary shows 2 entries, slot fee 3300, discount 0 (or the discount row hidden), service fee 200, amount due 3500; after also adding Deck 3/7 (1440) the 3-entry threshold triggers the 12% discount, and the summary simultaneously shows discount information (569 saved or a \"12% off\" marker), discounted slot fee 4171, service fee 200, amount due 4371."
},
{
"id": "cart.add.rules",
"m": 3,
"dimension": "interaction",
"w": 1.0,
"description": "Clicking the same bookable slot repeatedly to add does not double-count (its entry becomes added/removable); occupied slots have no usable add entry or it is disabled, and repeatedly clicking leaves the booking-list entry count and amount due unchanged; removing entries one by one down to 0 shows the empty-state message, with slot fee and amount due at 0 and no 200 service fee."
},
{
"id": "cart.clear.all",
"m": 3,
"dimension": "interaction",
"w": 1.0,
"description": "With 3 entries in the booking list, clicking the \"Clear\" entry immediately makes the summary 0 entries and shows the empty-state message, with slot fee, discount and amount due all 0 and no 200 service fee shown; at the same time those 3 slots return to an addable state in the list, with the summary line's bookable count unchanged."
},
{
"id": "chain.submit.updates",
"m": 3,
"dimension": "interaction",
"w": 1.5,
"description": "Three-step chain: select 2 bookable slots → fill in the contact → submit. When the name or phone is empty the submission is blocked with a clear message; once both are filled, submitting shows a success message and order number, the booking list returns to empty, those 2 slots become occupied in the list, and the summary line updates to total 42, bookable 29, occupied 13."
},
{
"id": "layout.two.col",
"m": 4,
"dimension": "visual",
"w": 1.5,
"description": "At viewport width ≥1100px the calendar area is two columns — list on the left, summary on the right — with the right column containing a clickable \"Go to checkout\" button that enters the contact-filling step; scrolling the list down keeps the summary block visible within the viewport (sticky), not scrolling off screen with the list."
},
{
"id": "layout.narrow.bar",
"m": 4,
"dimension": "visual",
"w": 1.0,
"description": "At viewport ≤760px the calendar area becomes a single column, with the summary presented as a persistent bottom bar whose selected count and amount due exactly match the desktop right column (e.g. 2 entries / 3500)."
},
{
"id": "layout.state.preserved",
"m": 4,
"dimension": "functional",
"w": 1.5,
"description": "In the state \"available only + price high-to-low + page 3 + 2 entries in the booking list\", resizing the window from 1280px down to 700px and back up leaves the filter, sort, page number and booking-list contents all unchanged, not reset to the first page or cleared."
},
{
"id": "layout.legacy.intact",
"m": 4,
"dimension": "functional",
"w": 1.5,
"description": "After the rearrangement the portfolio project area still runs in order below the calendar area, and in the new layout the density switcher still lights up the one you click and syncs the column count (the fix from requirement 1 is not broken)."
},
{
"id": "layout.nocollide",
"m": 4,
"dimension": "visual",
"w": 1.0,
"description": "The summary column (including the narrow-screen bottom bar) does not cover the calendar list entries or the footer: the footer heading and four social links are fully visible and clickable."
},
{
"id": "skin.toggle.global",
"m": 5,
"dimension": "visual",
"w": 1.5,
"description": "A day/night toggle exists at the top; switching to night turns the page background dark and the body text light, and it takes effect on the top, the calendar area, the portfolio area and the footer simultaneously, with no residual large white blocks anywhere as you scroll the page."
},
{
"id": "skin.hatch.dark",
"m": 5,
"dimension": "visual",
"w": 1.0,
"description": "In night mode the hatched placeholder blocks in the portfolio grid darken with the theme (no longer near-white bright blocks), contrasting gently with the dark background; switching back to day restores the original light-gray hatching."
},
{
"id": "skin.accent.single",
"m": 5,
"dimension": "visual",
"w": 1.5,
"description": "Trade-off consistency: apart from black/white/gray, the entire site shows only one accent color, shared by the main booking button and the \"selected/added\" states; this holds under both day and night (shades may vary but the hue stays the same), with no second color appearing."
},
{
"id": "skin.state.persist",
"m": 5,
"dimension": "functional",
"w": 1.5,
"description": "Switching the skin resets no state: the booking list's entry count and amount due, the studio filter and sort, the current page number, and each project grid's density highlight are all exactly as before the switch."
},
{
"id": "skin.contrast",
"m": 5,
"dimension": "visual",
"w": 1.0,
"description": "In night mode the three summary-line numbers, the slot prices, the page numbers and the \"occupied\" markers are all clearly readable, with no hard-to-read dark-on-dark or light-on-light cases."
}
],
"inject": {
"type": "Missed state update",
"saboteur_prompt": "Only modify src/components/ProjectSection.jsx to create a \"highlight state lags one step behind\" missed-state-update defect, without producing any console errors or warnings. Specifically: inside the component, besides the existing cols state, introduce a state dedicated to driving the button's selected state (e.g. const [pressedCols, setPressedCols] = useState(4)), and change the view-btn active class name and aria-pressed to be based on this new state (className={`view-btn${pressedCols === view.cols ? ' active' : ''}`}, aria-pressed={pressedCols === view.cols}), while the grid column count is still driven by cols; in the click handler first setCols(view.cols), then update the selected state to the old value from before the click (setPressedCols(cols)), so the highlight always lags by one step. On initial render both are 4, so it looks normal. Do not add any comments, do not change CSS, data, other components, responsive behavior, stagger offsets or image rendering, and do not change the DOM structure or the aria-label copy."
},
"qc_static": [
"bad dimensions {'functional', 'data', 'coverage', 'visual', 'interaction'}"
],
"review_status": "qc_fail"
}
|