Fix instance lookups that trusted stale data
Two regressions from the template-resolution rework, plus the harness gap that hid them: - `instanceTargetOf` decided from the shape of the id. Unpacking keeps the derived ids, so unpacked content still counted as template content. It now asks whether the object is spelled out in the holder. - The parent picker captured its holder when the row was built. Since `viewOf()` returns a derived copy, the menu listed the objects of that moment (measured: 40 in the model, 17 in the menu). It resolves on open. - `evaluate()` swallowed page exceptions, so a mutate that died half-way let every later check pass or fail for the wrong reason. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ead649eec3
commit
f40b8a0523
5 files changed
+45
-6
No files matched your search
@@ -449,11 +449,14 @@ function parentRow(host: InspectorHost, holder: ObjectHolder, object: SceneObjec
|
||||
}
|
||||
const button = new Dropdown(name);
|
||||
button.onClick = () => {
|
||||
// Resolved anew on every open: `holder` is a derived copy of the scene, so one captured when
|
||||
// the row was built lists the objects of that moment, not the ones there now.
|
||||
const current = viewOf(host.state.project, holder.id) ?? holder;
|
||||
const items: MenuItem[] = [
|
||||
{ label: 'None', onSelect: () => host.state.execute(new SetParentCommand(holder.id, object.id, '')) },
|
||||
];
|
||||
for (const { object: candidate, depth } of treeOrder(holder)) {
|
||||
if (isSelfOrAncestor(holder, object.id, candidate.id)) continue;
|
||||
for (const { object: candidate, depth } of treeOrder(current)) {
|
||||
if (isSelfOrAncestor(current, object.id, candidate.id)) continue;
|
||||
const label = `${' '.repeat(depth)}${nameOf(candidate)}`;
|
||||
items.push({
|
||||
label: candidate.id === object.parentId ? `● ${label}` : label,
|
||||
|
||||
Reference in new issue
Block a user