Skip to content

Commit 3c71761

Browse files
majdyzclaude
andcommitted
fix(frontend): remove unused reviewData prop from PendingReviewsList
- Remove reviewData prop from PendingReviewCard usage - Fix TypeScript error after prop removal - Component now extracts data directly from review payload 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 8fa5762 commit 3c71761

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

autogpt_platform/frontend/src/components/organisms/PendingReviewCard/PendingReviewCard.tsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,11 @@ function extractReviewData(payload: unknown): {
3535
};
3636
}
3737

38-
// Fallback: treat entire payload as data
3938
return { data: payload };
4039
}
4140

4241
interface PendingReviewCardProps {
4342
review: PendingHumanReviewModel;
44-
reviewData: string;
4543
onReviewDataChange: (nodeExecId: string, data: string) => void;
4644
reviewMessage: string;
4745
onReviewMessageChange: (nodeExecId: string, message: string) => void;
@@ -51,27 +49,19 @@ interface PendingReviewCardProps {
5149

5250
export function PendingReviewCard({
5351
review,
54-
reviewData: _reviewData, // Keep prop for compatibility but don't use since we extract from payload
5552
onReviewDataChange,
5653
reviewMessage,
5754
onReviewMessageChange,
5855
isDisabled,
5956
onToggleDisabled,
6057
}: PendingReviewCardProps) {
61-
// Extract structured data and instructions from payload
6258
const extractedData = extractReviewData(review.payload);
6359
const isDataEditable = review.editable;
64-
65-
// Use instructions from payload or from API field
6660
const instructions = extractedData.instructions || review.instructions;
67-
68-
// Local state to track the current value
6961
const [currentData, setCurrentData] = useState(extractedData.data);
7062

7163
const handleDataChange = (newValue: unknown) => {
72-
// Update local state
7364
setCurrentData(newValue);
74-
// Convert back to JSON string for the parent component
7565
onReviewDataChange(review.node_exec_id, JSON.stringify(newValue, null, 2));
7666
};
7767

@@ -123,7 +113,6 @@ export function PendingReviewCard({
123113
</div>
124114
);
125115
} else {
126-
// For objects, arrays, null, etc. - show JSON editor
127116
return (
128117
<Input
129118
id="data-json"
@@ -137,9 +126,7 @@ export function PendingReviewCard({
137126
try {
138127
const parsed = JSON.parse(e.target.value);
139128
handleDataChange(parsed);
140-
} catch {
141-
// Invalid JSON, let user continue editing
142-
}
129+
} catch {}
143130
}}
144131
placeholder="Edit JSON data"
145132
className="font-mono text-sm"
@@ -152,7 +139,6 @@ export function PendingReviewCard({
152139
<div
153140
className={`space-y-4 rounded-lg border p-4 ${isDisabled ? "bg-muted/50 opacity-60" : ""}`}
154141
>
155-
{/* Header with title and disable toggle */}
156142
<div className="flex items-start justify-between">
157143
<div className="flex-1">
158144
{isDisabled && (
@@ -173,7 +159,6 @@ export function PendingReviewCard({
173159
</Button>
174160
</div>
175161

176-
{/* Review Instructions */}
177162
{instructions && (
178163
<div>
179164
<Text variant="body" className="mb-2 font-semibold">
@@ -183,7 +168,6 @@ export function PendingReviewCard({
183168
</div>
184169
)}
185170

186-
{/* Data Editor */}
187171
<div>
188172
<Text variant="body" className="mb-2 font-semibold">
189173
Data to Review:

autogpt_platform/frontend/src/components/organisms/PendingReviewsList/PendingReviewsList.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ export function PendingReviewsList({
189189
<PendingReviewCard
190190
key={review.node_exec_id}
191191
review={review}
192-
reviewData={reviewDataMap[review.node_exec_id] || ""}
193192
onReviewDataChange={handleReviewDataChange}
194193
reviewMessage={reviewMessageMap[review.node_exec_id] || ""}
195194
onReviewMessageChange={handleReviewMessageChange}

0 commit comments

Comments
 (0)