don't show virtuoso loader when pending approval (#909)

This commit is contained in:
Gabriel Gordon-Hall
2025-10-01 18:16:15 +01:00
committed by GitHub
parent b631f6fbc6
commit d10c37f061
2 changed files with 27 additions and 17 deletions

View File

@@ -147,20 +147,18 @@ function DenyReasonForm({
disabled={isResponding}
className="text-sm"
/>
<div className="mt-3 flex flex-wrap items-center justify-between gap-2">
<div className="flex items-center gap-2 text-sm">
<Button
variant="ghost"
size="sm"
onClick={onCancel}
disabled={isResponding}
>
Cancel
</Button>
<Button size="sm" onClick={onSubmit} disabled={isResponding}>
Deny
</Button>
</div>
<div className="mt-3 flex flex-wrap items-center justify-end gap-2">
<Button
variant="ghost"
size="sm"
onClick={onCancel}
disabled={isResponding}
>
Cancel
</Button>
<Button size="sm" onClick={onSubmit} disabled={isResponding}>
Deny
</Button>
</div>
</div>
);

View File

@@ -255,10 +255,22 @@ export const useConversationHistory = ({
e.type !== 'NORMALIZED_ENTRY' ||
e.content.entry_type.type !== 'user_message'
);
const hasPendingApprovalEntry = entriesExcludingUser.some((entry) => {
if (entry.type !== 'NORMALIZED_ENTRY') return false;
const entryType = entry.content.entry_type;
return (
entryType.type === 'tool_use' &&
entryType.status.status === 'pending_approval'
);
});
entries.push(...entriesExcludingUser);
if (
getLiveExecutionProcess(p.executionProcess.id)?.status === 'running'
) {
const isProcessRunning =
getLiveExecutionProcess(p.executionProcess.id)?.status ===
'running';
if (isProcessRunning && !hasPendingApprovalEntry) {
entries.push(loadingPatch);
}
} else if (