updateUndoRedoButtons

fun updateUndoRedoButtons(onStateUpdated: (canUndo: Boolean, canRedo: Boolean) -> Unit? = null)

Updates the enabled state of undo/redo buttons asynchronously. Calls UndoProvider.canUndo and UndoProvider.canRedo on a background thread with a 500ms timeout fallback to prevent ANRs.

Buttons are disabled while any undo/redo operation is executing to prevent concurrent operations that could corrupt the undo stack.

Parameters

onStateUpdated

Optional callback invoked on main thread when undo/redo state is determined. Receives (canUndo, canRedo) boolean values. Called even during timeout fallback with (false, false) values.