Timeline: joints in feature folders (#8306) (#8316)

* claim: #8306

* Timeline: joints in feature folders (#8306)

timeline.group and timeline.move_to_group take joints as well as features, so
hundreds of joints fold into one folder tile. A closed folder shows one tile
whatever it holds; opening it shows its features and joints in both the bottom
and left History. Suppress, delete and ungroup on a folder reach its joints too
(one undo step), deleting a joint removes it from its folder, and an unknown
joint id or name is an error. Saved with the design; designs without joint
folders read and write as before.
This commit is contained in:
raykholo
2026-10-29 15:59:18 +00:00
committed by GitHub
parent c32f6b60eb
commit 3cdfec798f
16 changed files with 588 additions and 64 deletions
@@ -267,6 +267,17 @@ pub(super) fn clone_assembly(
features: &BTreeMap<u64, u64>,
bodies: &BTreeMap<String, String>,
) -> Result<Vec<String>> {
clone_assembly_with_joint_ids(doc, source, occurrences, features, bodies).map(|(messages, _)| messages)
}
/// The copied joint identity map is also needed when extracting saved timeline folders.
pub(super) fn clone_assembly_with_joint_ids(
doc: &mut Document,
source: &Document,
occurrences: &BTreeMap<u64, u64>,
features: &BTreeMap<u64, u64>,
bodies: &BTreeMap<String, String>,
) -> Result<(Vec<String>, BTreeMap<u64, u64>)> {
budget(&source.assembly)?;
budget(&doc.assembly)?;
validate_map(occurrences)?;
@@ -419,7 +430,7 @@ pub(super) fn clone_assembly(
budget(&a)?;
doc.next_id = item_id.checked_add(1).ok_or_else(|| invalid("assembly identifier space is exhausted"))?;
doc.assembly = a;
Ok(messages)
Ok((messages, joints))
}
#[cfg(test)]