Runs / stock-adjustment Batch Runs from different design-system versions should not be compared.
page.tsx As the agent left it; marked lines broke a rule.
Violations 33 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 read_file 857 49 $0.0000 1 write_file 1,126 3,238 $0.0000 2 stop 4,390 21 $0.0000
cdb5d9e77633
Output cap 20,000 tokens a step 12
13 export default function Page() {
14 const { sku, name, location, onHand, unit } = data.item;
15 const reasons: Reason[] = data.reasons;
16
17 const [newQty, setNewQty] = useState<number | null>(null);
18 const [selectedReason, setSelectedReason] = useState<Reason | null>(null);
19 const [comment, setComment] = useState<string>("");
20 const [message, setMessage] = useState<string | null>(null);
21 const [errors, setErrors] = useState<{ newQty?: string; reason?: string }>({});
22
23 const diff = newQty !== null ? newQty - onHand : 0;
24 const diffDisplay =
25 diff > 0 ? `+${diff}` : diff < 0 ? diff : "0";
26
27 const handleSave = () => {
28 const newErrors: { newQty?: string; reason?: string } = {};
29 if (newQty === null || !Number.isInteger(newQty) || newQty < 0) {
30 newErrors.newQty = "Enter a valid whole number (≥ 0)";
31 }
32 if (!selectedReason) {
33 newErrors.reason = "Select a reason";
34 }
35 if (Object.keys(newErrors).length) {
36 setErrors(newErrors);
37 return;
38 }
39 setMessage(`Adjusted quantity to ${newQty}`);
40 setNewQty(null);
41 setSelectedReason(null);
42 setComment("");
43 setErrors({});
44 };
45
46 return (
47 <div
48 style={{
49 maxWidth: 460,
50 margin: "2rem auto",
51 padding: 1.5rem,
52 border: "1px solid #e5e7eb",
53 borderRadius: 6,
54 fontFamily: "system-ui, sans-serif",
55 }}
56 >
57 <h2 style={{ marginTop: 0, marginBottom: 1.2rem }}>Stock Correction</h2>
58
59 <div style={{ marginBottom: 0.8rem }}>
60 <strong>SKU:</strong> {sku}
61 </div>
62 <div style={{ marginBottom: 0.8rem }}>
63 <strong>Name:</strong> {name}
64 </div>
65 <div style={{ marginBottom: 0.8rem }}>
66 <strong>Location:</strong> {location}
67 </div>
68 <div style={{ marginBottom: 0.8rem }}>
69 <strong>Current Qty ({unit}):</strong> {onHand}
70 </div>
71
72 {/* New Quantity field */}
73 {errors.newQty && (
74 <p style={{ color: "dc2626", marginBottom: 0.4rem, fontSize: 0.875rem }}>
75 {errors.newQty}
76 </p>
77 )}
78 <div style={{ marginBottom: 0.8rem }}>
79 <label style={{ display: "block", marginBottom: 0.3rem }}>
80 New quantity ({unit}):
81 </label>
82 <input
83 type="number"
84 step="1"
85 value={newQty ?? ""}
86 onChange={(e) => {
87 const val = Number(e.target.value);
88 if (!isNaN(val) && Number.isInteger(val) && val >= 0) {
89 setNewQty(val);
90 }
91 }}
92 style={{
93 width: "100%",
94 padding: 0.5rem,
95 border: "1px solid #d1d5db",
96 borderRadius: 4,
97 fontSize: 1rem,
98 }}
99 />
100 </div>
101
102 {/* Difference display */}
103 {newQty !== null && (
104 <p style={{ marginTop: 0.4rem, marginBottom: 0.6rem, fontSize: 0.875rem }}>
105 Difference:{" "}
106 {diff > 0 ? `+${diff}` : diff < 0 ? diff : diff}{" "}({unit})
107 </p>
108 )}
109
110 {/* Reason select */}
111 {errors.reason && (
112 <p style={{ color: "dc2626", marginBottom: 0.4rem, fontSize: 0.875rem }}>
113 {errors.reason}
114 </p>
115 )}
116 <label style={{ display: "block", marginBottom: 0.3rem }}>
117 Reason:
118 <select
119 value={selectedReason ? selectedReason.code : ""}
120 onChange={(e) => {
121 const code = e.target.value as string;
122 const reason = reasons.find((r) => r.code === code);
123 setSelectedReason(reason ?? null);
124 }}
125 style={{
126 width: "100%",
127 padding: 0.5rem,
128 border: "1px solid #d1d5db",
129 borderRadius: 4,
130 fontSize: 1rem,
131 }}
132 >
133 <option value="">--Select reason--</option>
134 {reasons.map((r) => (
135 <option key={r.code} value={r.code}>
136 {r.label} - {r.description}
137 </option>
138 ))}
139 </select>
140 </label>
141
142 {/* Optional comment */}
143 <label style={{ display: "block", marginBottom: 0.3rem, marginTop: 1rem }}>
144 Comment (optional):
145 </label>
146 <textarea
147 value={comment}
148 onChange={(e) => setComment(e.target.value)}
149 placeholder="Add any additional comment"
150 style={{
151 width: "100%",
152 padding: 0.5rem,
153 border: "1px solid #d1d5db",
154 borderRadius: 4,
155 fontSize: 1rem,
156 marginTop: 0.3rem,
157 }}
158 />
159
160 <button
161 onClick={handleSave}
162 style={{
163 width: "100%",
164 marginTop: 1rem,
165 padding: 0.6rem,
166 backgroundColor: "#2563eb",
167 color: "white",
168 border: "none",
169 borderRadius: 4,
170 fontSize: 1rem,
171 cursor: "pointer",
172 }}
173 disabled={Object.keys(errors).length > 0}
174 >
175 Save adjustment
176 </button>
177
178 {message && (
179 <p
180 style={{
181 marginTop: 1rem,
182 color: "059669",
183 fontSize: 0.875rem,
184 textAlign: "center",
185 }}
186 >
187 {message}
188 </p>
189 )}
190 </div>
191 );
192 }
page.tsx:78:38 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:79:60 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:94:25 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:97:24 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:104:35 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:104:57 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:104:77 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:112:55 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:112:75 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:116:58 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:127:25 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:130:24 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:143:58 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:143:75 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:152:23 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:155:22 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:156:25 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:164:23 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:165:23 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:170:22 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:181:25 An identifier or keyword cannot immediately follow a numeric literal. page.tsx:183:28 An identifier or keyword cannot immediately follow a numeric literal. lint/syntax-error 1 quality render/build-failed 1 completeness