Skip to content

Fix the activation of the toolbar's Undo and Redo buttons - #2404

Merged
gunterkoenigsmann merged 3 commits into
mainfrom
claude/fix-redo-button-activation
Sep 29, 2026
Merged

gunterkoenigsmann merged 3 commits into
mainfrom
claude/fix-redo-button-activation

Conversation

@gunterkoenigsmann

Copy link
Copy Markdown
Member

Requested by Gunter · project thread

Before: the toolbar's Redo button never changed state. Whether there was something to redo switched the Undo button instead, so Undo followed whichever of the two was updated last. After showing or hiding a group of toolbar buttons from the toolbar's context menu, buttons with nothing to act on (Undo, Copy, ...) could stay active.

After: Undo and Redo each follow their own state, and re-created tools become inactive again at the next update.

How: ToolBar::CanRedo() now enables wxID_REDO rather than wxID_UNDO. AddTools() re-creates every tool enabled, but the remembered states that CanUndo(), CanCopy(), ... compare against were kept, so an update to "disabled" was skipped as redundant. AddTools() now resets them.

Test: test_ToolBarUndoRedo covers both. With the two fixes reverted, both scenarios fail; with them, all 55 unit tests pass. Found while fixing #2403, which touches the same header but not the same lines.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q7P4rJ2sLJfF5fWc6JgT7n


Generated by Claude Code

ToolBar::CanRedo() enabled or disabled wxID_UNDO, so Redo never changed
state and Undo followed whichever of the two was set last. Also,
AddTools() re-creates every tool enabled but kept the remembered states
CanUndo(), CanCopy(), ... compare against, so after the user showed or
hid a group of tools a button could stay active with nothing to act on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7P4rJ2sLJfF5fWc6JgT7n
@gunterkoenigsmann gunterkoenigsmann self-assigned this Sep 29, 2026
@gunterkoenigsmann
gunterkoenigsmann merged commit 8ed444c into main Sep 29, 2026
18 of 20 checks passed
@gunterkoenigsmann
gunterkoenigsmann deleted the claude/fix-redo-button-activation branch September 29, 2026 17:00
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