Skip to content

Conversation

@elliottmejia
Copy link
Contributor

The undo button was showing up next to the submit button but wasn't actually clickable. It was just a div with some text. This PR makes it work properly.

What Changed

I converted the undo element from a non-interactive div to a proper button with an onClick handler. The keyboard shortcut (U key) was already working, so I extracted that logic into a shared handleUndo function that both the button and keyboard shortcut now use.

The button now:

  • Actually responds to clicks
  • Gets disabled when there's nothing to undo
  • Uses the same logic as the keyboard shortcut for consistency

Also cleaned up some TypeScript strict mode errors and lint warnings while I was in there.

The undo button was showing up next to the submit button but wasn't actually clickable. It was just a div with some text. This PR makes it work properly.

## What Changed

I converted the undo element from a non-interactive div to a proper button with an onClick handler. The keyboard shortcut (U key) was already working, so I extracted that logic into a shared `handleUndo` function that both the button and keyboard shortcut now use.

The button now:
- Actually responds to clicks
- Gets disabled when there's nothing to undo
- Uses the same logic as the keyboard shortcut for consistency

Also cleaned up some TypeScript strict mode errors and lint warnings while I was in there.
[gameState.status, selectedSlots]
);

const handleUndo = useCallback((): void => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have react compiler here but I guess it does not hurt

Copy link
Owner

@WilsonNet WilsonNet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it is working nice, good coe

@WilsonNet WilsonNet merged commit 3205cb0 into WilsonNet:main Dec 1, 2025
2 checks passed
@elliottmejia
Copy link
Contributor Author

Thanks! Love the project, and contributing may remind me to use it more :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants