Skip to content

Add Reset button to debugger toolbar after solver completion - #24

Open
seveibar wants to merge 1 commit into
mainfrom
codex/add-reset-button-to-debugger-toolbar
Open

Add Reset button to debugger toolbar after solver completion#24
seveibar wants to merge 1 commit into
mainfrom
codex/add-reset-button-to-debugger-toolbar

Conversation

@seveibar

Copy link
Copy Markdown
Contributor

Motivation

  • Allow users to reset a solver from the debugger UI after it reaches a terminal state (solved or failed) instead of leaving the Solve button disabled.
  • Provide a simple programmatic hook for reset behavior so the debugger can create a fresh solver instance and re-render the UI.

Description

  • Added an optional onSolverReset?: () => void prop to GenericSolverToolbar and replaced the toolbar's Solve button with a Reset button when solver.solved || solver.failed.
  • Wired a handleSolverReset in GenericSolverDebugger and passed it to the toolbar; the handler prefers createSolver() when provided and otherwise attempts to reconstruct a new solver using the current solver constructor and getConstructorParams().
  • Converted the debugger's solver to state (useState) so it can be replaced with setSolver(...), and call incRenderCount() to trigger a re-render after reset.
  • Defensive TypeScript fix: normalize getConstructorParams() result to an array before spreading into the constructor to avoid iterator errors.

Testing

  • Ran unit tests with bun test tests and all tests passed (22 pass, 0 fail).
  • Typechecked with bunx tsc --noEmit which succeeded with no errors.
  • Ran code formatting with bun run format which completed successfully.

Codex Task

@vercel

vercel Bot commented Apr 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solver-utils Ready Ready Preview, Comment Apr 10, 2026 2:37am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant