Drop the per-list item declaration; every item carries its own kind
A list no longer says what its items are. ListDef.items, ListDef.fields,
ListFieldDef.items and SetListItemsCommand are gone; the single seam is
src/core/properties/listItems.ts. JSON already tells number, text, boolean
and struct apart, so only two kinds need a tag: {"$color": n} and the new
{"$texture": id}. Field names cannot start with "$", so a tag never
collides with a struct field. On a data link a texture item arrives as
its bare id; the graph has no images.
List tab: the mark in front of each row is the kind picker, "+ Item"
asks for the kind, both are ordinary value edits (one undo step). A list
inside a struct field only offers the flat kinds because the depth rule
forbids a struct item there (ListAccess.kinds); the menu used to offer
it and silently do nothing.
Legacy lists that declared items: 'color' are tagged on load.
Actor demo: the four walk animations and four standing frames live in
two list variables of texture items indexed by facing (Item at), so the
graph can be rebuilt in the editor. The stand frames get their grid ids
back; 44 nodes instead of 46.
Also: the user's edits to on-start-during-play.md and the new note
reseed-because-of-list.md.
Verified: check.sh 794 tests, full e2e 631 checks, smokes 24/19/20.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
e147dd6d21
commit
11c900c998
34 files changed
+1218
-640
No files matched your search
+16
-1
@@ -6,6 +6,12 @@ export async function structVariable(t) {
|
||||
const { check, sleep, json, find, shot, click, clickText, press, typeText, mutate, select, undo } = t;
|
||||
|
||||
/** `locate` throws when the text is absent, which is the wrong shape for "is it there?". */
|
||||
|
||||
/** A kind menu entry, always the last drawn one: the panels behind carry those words too. */
|
||||
const pickKind = async (label) => {
|
||||
const at = await json(`__gm.locate(${JSON.stringify(label)}, true)`);
|
||||
await click(at.x, at.y);
|
||||
};
|
||||
const piece = () => json("__gm.state.project.assets.find((a) => a.id === 'structy').props.piece");
|
||||
/** Left edge of each row's control – one column grid means one number, in the browser's own font. */
|
||||
const leftsOf = (labels) =>
|
||||
@@ -80,7 +86,7 @@ export async function structVariable(t) {
|
||||
// 4. Adding a field reaches the declaration and the value at once.
|
||||
await clickText('+ Field');
|
||||
await sleep(150);
|
||||
await clickText('Boolean');
|
||||
await pickKind('Boolean');
|
||||
await sleep(250);
|
||||
const grown = await piece();
|
||||
check('+ Field grows the bundle', 'field1' in grown && grown.field1 === false, JSON.stringify(grown));
|
||||
@@ -125,7 +131,16 @@ export async function structVariable(t) {
|
||||
const info = await json('__gm.list.info()');
|
||||
check('whose title names the field inside the bundle', info.title.endsWith('· field1'), info.title);
|
||||
|
||||
// The depth the stored value goes ends here: this list sits in a struct field, so a struct item
|
||||
// would be dropped by the next write. It is left out of the menu rather than doing nothing.
|
||||
await clickText('+ Item');
|
||||
await sleep(150);
|
||||
check(
|
||||
'the menu of a list in a struct field leaves the struct kind out',
|
||||
(await find('Number')) !== null && (await find('Struct')) === null,
|
||||
JSON.stringify((await json('__gm.list.info()')).offers),
|
||||
);
|
||||
await pickKind('Number');
|
||||
await sleep(250);
|
||||
check(
|
||||
'and an item added there leaves the neighbouring fields alone',
|
||||
|
||||
Reference in new issue
Block a user