Skip to content

Conversation

@emptyrivers
Copy link
Contributor

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 reload

currently implemented:

  • url on information tab
  • most of the action tab
  • most of the group tab
  • most non-position properties on display tab

there's still a lot to do, especially for custom options & condition options
image
(there's other changes to be made undo-able not caught by that grep)

@emptyrivers emptyrivers added 🎨 Enhancement This pull request implements a new feature. 👩‍🔬 Work in Progress This pull request is still being actively developed and shouldn't be merged. labels Feb 8, 2024
@emptyrivers
Copy link
Contributor Author

note that this is downstream of #4844, so I might close that pull request & just fold it into this one

@Stanzilla
Copy link
Contributor

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

@InfusOnWoW
Copy link
Contributor

Yeah, please keep them separate.

@emptyrivers
Copy link
Contributor Author

emptyrivers commented Apr 4, 2024

an update on progess:

majority of controls in WA options now perform undo-able actions. exceptions are:

  • some region/subregion options
  • (regular) group options
  • "exotic" things like MoverPicker, or TextEditor (though I imagine most folks who read this won't consider the code editor to be "exotic")
  • Duplicate/Add/Delete/Rename whole auras is not yet supported (delete will also immediately break the history until you reload the UI)

@emptyrivers
Copy link
Contributor Author

(note, this pull has #4982 merged in, for my own sanity. The actual changeset is smaller (though, honestly not that much smaller)

@krazyito65
Copy link
Contributor

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

@emptyrivers emptyrivers force-pushed the undo branch 2 times, most recently from e42f616 to c1d2ff8 Compare April 4, 2024 21:17
@InfusOnWoW InfusOnWoW added the 🆕 Feature Preview This is a draft intended to show a preview of an upcoming feature. label May 3, 2024
@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2024

An experimental build of WeakAuras with the changes in this pull request is available here.
Build Time: Mon Jul 7 20:26:20 UTC 2025
Commit:

@emptyrivers emptyrivers removed the 👩‍🔬 Work in Progress This pull request is still being actively developed and shouldn't be merged. label Jan 20, 2025
@InfusOnWoW
Copy link
Contributor

Don't let the number of comments discourage you, most are pretty trivial.

I'm very much impressed that you have pulled this off.

Copy link
Contributor

@InfusOnWoW InfusOnWoW left a 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.

Copy link

Copilot AI left a 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 AddonName is declared but never used. Consider removing it or using it consistently for clarity.
local AddonName = ...

@InfusOnWoW
Copy link
Contributor

The New Aura / Import button's placement needs work now. I'm fine with changing them all to left aligned.
PYSArSmX8l

@emptyrivers
Copy link
Contributor Author

@InfusOnWoW i'm not seeing that behavior:
image

@InfusOnWoW
Copy link
Contributor

You have to resize the window to make the buttons overlap.

@emptyrivers
Copy link
Contributor Author

finally, a use for frame:SetCollapsesLayout:
image
image

@InfusOnWoW InfusOnWoW merged commit 12fd1eb into WeakAuras:main Jul 12, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎨 Enhancement This pull request implements a new feature. 🆕 Feature Preview This is a draft intended to show a preview of an upcoming feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants