Skip to content

Commit

Permalink
Merge pull request #142 from melnikga/chore/trace-control-buttons
Browse files Browse the repository at this point in the history
chore: Execution trace control buttons disabled state - Issue #141
  • Loading branch information
barabanovro authored Apr 11, 2024
2 parents 7272b2d + 4be683e commit a2ac75b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/Tracer/ExecutionStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand Down Expand Up @@ -72,6 +77,7 @@ const ExecutionStatus = ({
padded={false}
tooltip="Step back [b]"
tooltipId="step1"
disabled={executionTraceStepNumber === 0}
>
<RiArrowGoBackLine size={16} className="text-indigo-500" />
</Button>
Expand All @@ -81,6 +87,7 @@ const ExecutionStatus = ({
padded={false}
tooltip="Step next [n]"
tooltipId="step2"
disabled={executionTraceStepNumber + 1 === trace?.length || !trace}
>
<RiArrowGoForwardLine size={16} className="text-indigo-500" />
</Button>
Expand All @@ -90,6 +97,7 @@ const ExecutionStatus = ({
padded={false}
tooltip="Continue execution [c]"
tooltipId="continue-execution"
disabled={executionTraceStepNumber + 1 === trace?.length || !trace}
>
<RiPlayCircleLine size={16} className="text-indigo-500" />
</Button>
Expand Down
2 changes: 2 additions & 0 deletions components/Tracer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ export const Tracer = () => {
onStepIn={stepIn}
onStepOut={stepOut}
onContinueExecution={continueExecution}
trace={trace}
executionTraceStepNumber={executionTraceStepNumber}
/>
</div>

Expand Down

0 comments on commit a2ac75b

Please sign in to comment.