#1009: Dev Mode refuses data.fill, a design edit recorded as one grouped step

This commit is contained in:
bflatastic
2026-10-24 13:02:11 +07:00
parent a7b7dfe1c4
commit d9d9e1d978
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -224,9 +224,11 @@ pub struct DevItem {
/// Revert to saved, which isn't an undo step but throws the design's unsaved edits away.
pub fn dev_mode_allows(id: &str) -> bool {
const OWN: [&str; 5] = ["annotation.", "dev.", "devResource.", "codeConnect.", "comment."];
// Edits recorded as one grouped undo step, so their spec says no history of its own.
const GROUPED: [&str; 1] = ["data.fill"];
match id.strip_prefix("tool.") {
Some(t) => matches!(t, "move" | "hand" | "comment"),
None if id == "file.revert" => false,
None if id == "file.revert" || GROUPED.contains(&id) => false,
None => OWN.iter().any(|p| id.starts_with(p)) || crate::cmd::find_command(id).is_none_or(|c| !c.history),
}
}
@@ -124,6 +124,7 @@ fn dev_mode_runs_its_own_edits_and_refuses_design_edits_from_menus_and_shortcuts
"tool.place",
"file.import",
"file.revert",
"data.fill",
] {
assert!(!dev_mode_allows(id), "{id} edits the design");
}