mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-24 10:27:00 -06:00
#1009: Dev Mode refuses data.fill, a design edit recorded as one grouped step
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user