add /loop-n command for repeated prompt execution

This commit is contained in:
2026-03-14 17:28:55 +08:00
parent df5954c8e1
commit 816af87ac8
5 changed files with 109 additions and 4 deletions

View File

@@ -93,6 +93,9 @@ interface StatusRowProps {
wasAborted?: boolean;
abortActive?: boolean;
retryInfo?: { attempt?: number; next?: number } | null;
// Loop state
loopInfo?: { current: number; total: number; prompt: string } | null;
onStopLoop?: () => void;
// Abort state (for mobile/vscode)
showAbort?: boolean;
onAbort?: () => void;
@@ -108,6 +111,8 @@ export const StatusRow: React.FC<StatusRowProps> = ({
wasAborted,
abortActive,
retryInfo,
loopInfo,
onStopLoop,
showAbort,
onAbort,
showAbortStatus,
@@ -254,9 +259,26 @@ export const StatusRow: React.FC<StatusRowProps> = ({
) : null}
</div>
{/* Right: Abort (mobile only) + Todo */}
{/* Right: Abort (mobile only) + Todo + Loop indicator */}
<div className="relative flex items-center gap-2 flex-shrink-0" ref={popoverRef}>
{abortButton}
{loopInfo && (
<div className="flex items-center gap-1.5 text-[var(--status-info)]">
<span className="typography-ui-label">
Loop {loopInfo.current}/{loopInfo.total}
</span>
{onStopLoop && (
<button
type="button"
onClick={onStopLoop}
className="flex items-center justify-center h-[1.2rem] w-[1.2rem] text-[var(--status-error)] transition-opacity hover:opacity-80 focus-visible:outline-none flex-shrink-0"
aria-label="Stop loop"
>
<RiCloseCircleLine size={18} aria-hidden="true" />
</button>
)}
</div>
)}
{todoTrigger}
{/* Popover dropdown */}