Split Body: each piece can be renamed on its own (#3510) (#3527)

* claim: #3510

* Split Body: each piece can be renamed on its own (#3510)

A split named its new pieces after the split body every time (`Top (1)`),
so renaming a piece did nothing, and renaming the split body renamed the
other piece too (and broke the features that used it). The pieces now
take the names body.rename stores, and a rename keeps the names later
features derive from the renamed body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Phanoob <phanoob@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
phanoob
2026-10-21 00:54:11 +00:00
committed by GitHub
parent 98cd67f029
commit f44ff18ca4
2 changed files with 35 additions and 5 deletions
+5 -1
View File
@@ -5523,7 +5523,11 @@ fn eval_feature(doc: &Document, vals: &BTreeMap<String, Value>, f: &Feature, st:
*slot = ModelBody::traced_new(mb.name.clone(), first, mb.feature);
}
for (k, b) in it.enumerate() {
let mut name = format!("{} ({})", mb.name, k + 1);
// A piece renamed with `body.rename` keeps its own name (#3510).
let mut name = match f.body_names.get(k).filter(|n| !n.trim().is_empty() && st.body(n).is_none()) {
Some(n) => n.clone(),
None => format!("{} ({})", mb.name, k + 1),
};
while st.body(&name).is_some() {
name.push('\'');
}