Runs / stock-adjustment The run stopped with an error
Page check failed: async newContext: Target page, context or browser has been closed
Batch Runs from different design-system versions should not be compared.
page.tsx As the agent left it; marked lines broke a rule.
Violations 52 counted, under 4 rules. “Not counted” marks a compiler error that restates a design-system violation, “Ignored” one the agent silenced with a comment.
Steps One row per model call, with the tools it asked for. An agent that reads the guidelines before writing shows it here; what a checker or submit_view answered is under its call.
Step Tools Tokens in Tokens out Cost 0 list_files 503 32 $0.0000 1 read_file 357 36 $0.0000 2 list_files 479 28 $0.0000 3
cdb5d9e77633
Output cap 20,000 tokens a step 12 if (!/^-?\d+$/.test(trimmed)) return "Must be a whole number";
13 const n = Number(trimmed);
14 if (!Number.isFinite(n) || n < 0) return "Cannot be negative";
15 return null;
16 }
17
18 export default function Page() {
19 const [qty, setQty] = useState("");
20 const [reason, setReason] = useState("");
21 const [comment, setComment] = useState("");
22 const [submitted, setSubmitted] = useState(false);
23 const [touchedQty, setTouchedQty] = useState(false);
24 const [touchedReason, setTouchedReason] = useState(false);
25 const [saved, setSaved] = useState<number | null>(null);
26
27 const qtyError = validateQty(qty);
28 const reasonError = reason ? null : "Required";
29
30 const showQtyError = (submitted || touchedQty) && qtyError;
31 const showReasonError = (submitted || touchedReason) && reasonError;
32
33 const selectedReason = data.reasons.find((r) => r.code === reason);
34
35 let diffText = "";
36 const parsedQty = Number(qty.trim());
37 if (qty.trim() !== "" && !Number.isNaN(parsedQty) && Number.isInteger(parsedQty)) {
38 const diff = parsedQty - item.onHand;
39 const sign = diff >= 0 ? "+" : "-";
40 diffText = `${sign}${Math.abs(diff)} ${item.unit}`;
41 }
42
43 function handleSubmit(e: React.FormEvent) {
44 e.preventDefault();
45 setSubmitted(true);
46 if (qtyError || reasonError) return;
47 setSaved(Number(qty.trim()));
48 }
49
50 return (
51 <main
52 className={css({
53 maxWidth: "640px",
54 margin: "0 auto",
55 padding: "2rem 1rem",
56 fontFamily: "system-ui, sans-serif",
57 })}
58 >
59 <h1 className={css({ fontSize: "1.5rem", fontWeight: "700", marginBottom: "1.5rem" })}>
60 Correct stock after count
61 </h1>
62
63 <section
64 className={css({
65 border: "1px solid #e5e7eb",
66 borderRadius: "0.5rem",
67 padding: "1rem",
68 marginBottom: "1.5rem",
69 backgroundColor: "#f9fafb",
70 })}
71 >
72 <div className={css({ display: "grid", gap: "0.25rem" })}>
73 <div>
74 <strong>SKU:</strong> {item.sku}
75 </div>
76 <div>
77 <strong>Name:</strong> {item.name}
78 </div>
79 <div>
80 <strong>Location:</strong> {item.location}
81 </div>
82 <div>
83 <strong>On hand:</strong> {item.onHand} {item.unit}
84 </div>
85 </div>
86 </section>
87
88 <form onSubmit={handleSubmit} noValidate className={css({ display: "grid", gap: "1rem" })}>
89 <div className={css({ display: "grid", gap: "0.25rem" })}>
90 <label htmlFor="newQty" className={css({ fontWeight: "600" })}>
91 New quantity
92 </label>
93 <input
94 id="newQty"
95 type="text"
96 inputMode="numeric"
97 value={qty}
98 onChange={(e) => setQty(e.target.value)}
99 onBlur={() => setTouchedQty(true)}
100 aria-invalid={!!showQtyError}
101 className={css({
102 padding: "0.5rem",
103 border: "1px solid",
104 borderColor: showQtyError ? "#dc2626" : "#d1d5db",
105 borderRadius: "0.375rem",
106 })}
107 />
108 {showQtyError && (
109 <span className={css({ color: "#dc2626", fontSize: "0.875rem" })}>{qtyError}</span>
110 )}
111 <span className={css({ fontSize: "0.875rem", color: "#4b5563" })}>
112 Difference: {diffText || "—"}
113 </span>
114 </div>
115
116 <div className={css({ display: "grid", gap: "0.25rem" })}>
117 <label htmlFor="reason" className={css({ fontWeight: "600" })}>
118 Reason
119 </label>
120 <select
121 id="reason"
122 value={reason}
123 onChange={(e) => setReason(e.target.value)}
124 onBlur={() => setTouchedReason(true)}
125 aria-invalid={!!showReasonError}
126 className={css({
127 padding: "0.5rem",
128 border: "1px solid",
129 borderColor: showReasonError ? "#dc2626" : "#d1d5db",
130 borderRadius: "0.375rem",
131 })}
132 >
133 <option value="">Select a reason…</option>
134 {data.reasons.map((r) => (
135 <option key={r.code} value={r.code}>
136 {r.label} — {r.description}
137 </option>
138 ))}
139 </select>
140 {showReasonError && (
141 <span className={css({ color: "#dc2626", fontSize: "0.875rem" })}>{reasonError}</span>
142 )}
143 {selectedReason && (
144 <span className={css({ fontSize: "0.875rem", color: "#4b5563" })}>
145 {selectedReason.description}
146 </span>
147 )}
148 </div>
149
150 <div className={css({ display: "grid", gap: "0.25rem" })}>
151 <label htmlFor="comment" className={css({ fontWeight: "600" })}>
152 Comment (optional)
153 </label>
154 <textarea
155 id="comment"
156 value={comment}
157 onChange={(e) => setComment(e.target.value)}
158 rows={3}
159 className={css({
160 padding: "0.5rem",
161 border: "1px solid #d1d5db",
162 borderRadius: "0.375rem",
163 })}
164 />
165 </div>
166
167 <button
168 type="submit"
169 className={css({
170 padding: "0.625rem 1rem",
171 backgroundColor: "#2563eb",
172 color: "#ffffff",
173 border: "none",
174 borderRadius: "0.375rem",
175 fontWeight: "600",
176 cursor: "pointer",
177 justifySelf: "start",
178 })}
179 >
180 Save adjustment
181 </button>
182 </form>
183
184 {saved !== null && (
185 <p
186 role="status"
187 className={css({ marginTop: "1rem", color: "#15803d", fontWeight: "600" })}
188 >
189 Adjustment saved. New quantity: {saved} {item.unit}.
190 </p>
191 )}
192 </main>
193 );
194 }
195
`0.25rem` is a raw length. Use a token.
page.tsx:170:22 · 0.625rem 1rem `0.625rem 1rem` is a raw length. Use a token. token-names/unknown-token 7 design-system page.tsx:56:21 · system-ui, sans-serif `fontFamily: "system-ui, sans-serif"`: `system-ui, sans-serif` is not a fonts token. Use one of: sans, mono. page.tsx:59:60 · 700 `fontWeight: "700"`: `700` is not a fontWeights token. Use one of: normal, medium, semibold. page.tsx:90:64 · 600 `fontWeight: "600"`: `600` is not a fontWeights token. Use one of: normal, medium, semibold. page.tsx:117:64 · 600 `fontWeight: "600"`: `600` is not a fontWeights token. Use one of: normal, medium, semibold. page.tsx:151:65 · 600 `fontWeight: "600"`: `600` is not a fontWeights token. Use one of: normal, medium, semibold. page.tsx:175:25 · 600 `fontWeight: "600"`: `600` is not a fontWeights token. Use one of: normal, medium, semibold. page.tsx:187:77 · 600 `fontWeight: "600"`: `600` is not a fontWeights token. Use one of: normal, medium, semibold. Every run that broke token-names/unknown-token 10 read_file 1,625 51 $0.0000
12 write_file 147 2,698 $0.0000
13 write_file 4,533 1,990 $0.0000
15 write_file 5,048 1,641 $0.0000