fix(app): use pre-parsed props for Codex file edit diffs
ToolCall component had parsedEditEntries, parsedReadEntries, and parsedCommandDetails props defined but never used them. Now prefers these pre-parsed props when available, enabling Codex apply_patch diffs to render correctly in the expanded view. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1286,6 +1286,9 @@ export const ToolCall = memo(function ToolCall({
|
|||||||
result,
|
result,
|
||||||
error,
|
error,
|
||||||
status,
|
status,
|
||||||
|
parsedEditEntries,
|
||||||
|
parsedReadEntries,
|
||||||
|
parsedCommandDetails,
|
||||||
}: ToolCallProps) {
|
}: ToolCallProps) {
|
||||||
const [isExpanded, setIsExpanded] = useState(false);
|
const [isExpanded, setIsExpanded] = useState(false);
|
||||||
|
|
||||||
@@ -1397,7 +1400,8 @@ export const ToolCall = memo(function ToolCall({
|
|||||||
// Render based on type
|
// Render based on type
|
||||||
switch (structuredResult.type) {
|
switch (structuredResult.type) {
|
||||||
case "command": {
|
case "command": {
|
||||||
const cmd = extractCommandFromStructured(structuredResult);
|
// Use pre-parsed command details if available, otherwise extract from structured result
|
||||||
|
const cmd = parsedCommandDetails ?? extractCommandFromStructured(structuredResult);
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
// Reuse the command section rendering logic
|
// Reuse the command section rendering logic
|
||||||
sections.push(
|
sections.push(
|
||||||
@@ -1446,7 +1450,10 @@ export const ToolCall = memo(function ToolCall({
|
|||||||
|
|
||||||
case "file_write":
|
case "file_write":
|
||||||
case "file_edit": {
|
case "file_edit": {
|
||||||
const diffs = extractDiffFromStructured(structuredResult);
|
// Use pre-parsed entries if available, otherwise extract from structured result
|
||||||
|
const diffs = parsedEditEntries?.length
|
||||||
|
? parsedEditEntries
|
||||||
|
: extractDiffFromStructured(structuredResult);
|
||||||
diffs.forEach((entry, index) => {
|
diffs.forEach((entry, index) => {
|
||||||
sections.push(
|
sections.push(
|
||||||
<View
|
<View
|
||||||
@@ -1469,7 +1476,10 @@ export const ToolCall = memo(function ToolCall({
|
|||||||
}
|
}
|
||||||
|
|
||||||
case "file_read": {
|
case "file_read": {
|
||||||
const reads = extractReadFromStructured(structuredResult);
|
// Use pre-parsed entries if available, otherwise extract from structured result
|
||||||
|
const reads = parsedReadEntries?.length
|
||||||
|
? parsedReadEntries
|
||||||
|
: extractReadFromStructured(structuredResult);
|
||||||
reads.forEach((entry, index) => {
|
reads.forEach((entry, index) => {
|
||||||
sections.push(
|
sections.push(
|
||||||
<View
|
<View
|
||||||
|
|||||||
Reference in New Issue
Block a user