diff --git a/components/Tracer/ExecutionStatus.tsx b/components/Tracer/ExecutionStatus.tsx index ac32820..2221270 100644 --- a/components/Tracer/ExecutionStatus.tsx +++ b/components/Tracer/ExecutionStatus.tsx @@ -6,15 +6,20 @@ import { import { Priority, useRegisterActions } from 'kbar' import { Button } from 'components/ui' +import { TraceEntry } from '.' const ExecutionStatus = ({ onStepIn, onStepOut, onContinueExecution, + trace, + executionTraceStepNumber, }: { onStepIn: () => void onStepOut: () => void onContinueExecution: () => void + trace: TraceEntry[] | undefined + executionTraceStepNumber: number }) => { const actions = [ { @@ -72,6 +77,7 @@ const ExecutionStatus = ({ padded={false} tooltip="Step back [b]" tooltipId="step1" + disabled={executionTraceStepNumber === 0} > @@ -81,6 +87,7 @@ const ExecutionStatus = ({ padded={false} tooltip="Step next [n]" tooltipId="step2" + disabled={executionTraceStepNumber + 1 === trace?.length || !trace} > @@ -90,6 +97,7 @@ const ExecutionStatus = ({ padded={false} tooltip="Continue execution [c]" tooltipId="continue-execution" + disabled={executionTraceStepNumber + 1 === trace?.length || !trace} > diff --git a/components/Tracer/index.tsx b/components/Tracer/index.tsx index a2a2ea2..94c54cb 100644 --- a/components/Tracer/index.tsx +++ b/components/Tracer/index.tsx @@ -190,6 +190,8 @@ export const Tracer = () => { onStepIn={stepIn} onStepOut={stepOut} onContinueExecution={continueExecution} + trace={trace} + executionTraceStepNumber={executionTraceStepNumber} />