Remove redo; undo rename on a device

Redo is gone in both file and device mode: the Edit menu entry, Ctrl/Cmd+Y
and Ctrl/Cmd+Shift+Z, and the redo stack. An undone step is dropped.
Undoing past the last save now leaves the saved depth unreachable, so a
new edit cannot be mistaken for the saved state.

Renames on a device are undoable: LiveRenameCommand renames back on the
device first, and warns and clears history if the device refuses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 20:51:02 +03:00
co-authored by Claude Opus 5.5
parent 8b21c5f389
commit b63655462f
5 changed files with 50 additions and 56 deletions
+6 -5
View File
@@ -462,11 +462,12 @@ def rename_component(comp_element, new_name):
for link, attr, _, new_ref in link_changes:
link.set(attr, new_ref)
if not app_state.live_mode:
undo.push(undo.RenameComponentCommand(
comp_element, old_name, new_name, link_changes,
label=f"rename {old_name} to {new_name}"
))
command_class = (undo.LiveRenameCommand if app_state.live_mode
else undo.RenameComponentCommand)
undo.push(command_class(
comp_element, old_name, new_name, link_changes,
label=f"rename {old_name} to {new_name}"
))
app_state.mark_dirty()
refresh_treeview_from_dom(root)