-
-
Notifications
You must be signed in to change notification settings - Fork 341
undo & redo support #4863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undo & redo support #4863
Conversation
|
note that this is downstream of #4844, so I might close that pull request & just fold it into this one |
I think keeping it separate makes more sense, we just need to review the FF PR properly and test it, I haven't done that so far |
|
Yeah, please keep them separate. |
|
an update on progess: majority of controls in WA options now perform undo-able actions. exceptions are:
|
|
(note, this pull has #4982 merged in, for my own sanity. The actual changeset is smaller (though, honestly not that much smaller) |
|
Small graphical request: if either the 'undo' or 'redo' is empty (or the last item in the history), have the text 'fade' (optionally unclickable?) to indicate you can't go any further |
e42f616 to
c1d2ff8
Compare
|
An experimental build of WeakAuras with the changes in this pull request is available here. |
|
Don't let the number of comments discourage you, most are pretty trivial. I'm very much impressed that you have pulled this off. |
InfusOnWoW
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting an aura needs to clear the undo stack of anything that affects that aura, which I think pratically means we should probably just clear it fully.
Importing with an Update probably should similarly clear the stack.
Eventually Delete should be undoable too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces undo and redo support for WeakAuras by adding a TimeMachine module and integrating it into the UI and core workflows.
- Adds toolbar buttons for undo/redo in the options frame, tied to TimeMachine’s state
- Wraps data mutations (e.g., URL changes, add/rename/convert/delete) in TimeMachine transactions
- Registers the new module in all .toc files and updates the toolbar button widget for proper disabled styling
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| WeakAurasOptions/OptionsFrames/OptionsFrame.lua | Add undo/redo toolbar buttons and subscribe to TimeMachine events |
| WeakAurasOptions/InformationOptions.lua | Wrap URL-setting logic in TimeMachine transaction |
| WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasToolbarButton.lua | Update button widget to reset text color and track smallFont state |
| WeakAuras/WeakAuras_Vanilla.toc, WeakAuras/WeakAuras_Cata.toc, WeakAuras/WeakAuras.toc | Include TimeMachine.lua in all distributions |
| WeakAuras/WeakAuras.lua | Reset TimeMachine history on destructive operations and wrap Add |
| WeakAuras/TimeMachine.lua | New TimeMachine module implementing undo/redo logic |
| WeakAuras/Features.lua | Register the "undo" feature and add a debug printing wrapper |
Comments suppressed due to low confidence (2)
WeakAuras/TimeMachine.lua:1
- [nitpick] The new TimeMachine logic isn't covered by any unit tests. Consider adding automated tests to validate undo/redo actions, edge cases, and error handling in this module.
local AddonName = ...
WeakAuras/TimeMachine.lua:1
- [nitpick] The local variable
AddonNameis declared but never used. Consider removing it or using it consistently for clarity.
local AddonName = ...
WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasToolbarButton.lua
Outdated
Show resolved
Hide resolved
|
@InfusOnWoW i'm not seeing that behavior: |
|
You have to resize the window to make the buttons overlap. |




if you want to test it out, checkout this branch, or download the build artifact, either should have the feature automatically enabled. This feature is (for now) disabled by default on alpha/beta/release builds, though you can enable it via the command
/wa ff undo- this will persist thru a reloadcurrently implemented:
there's still a lot to do, especially for custom options & condition options

(there's other changes to be made undo-able not caught by that grep)