Describe every value kind in one table instead of spreading it over the code
A kind like colour or texture used to be spelled out in five parallel lists, its port type, its empty value, its glyph, its label and its list tag - 22 literal places for texture alone. core/properties/kinds.ts now holds one row per kind and the rest is derived from it, so adding a kind is one row. The five literal nodes collapse into literals.ts, the six kind menus into one helper. Number, Text, Boolean is now the one order everywhere; the variable and port menus used to list Boolean before Text. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8a7185948d
commit
3ed8b68ecf
39 files changed
+699
-565
No files matched your search
@@ -15,7 +15,7 @@ import {
|
||||
withInlineDefault,
|
||||
} from '../../src/core/graph';
|
||||
import { BUILT_IN_NODES } from '../../src/core/graph/nodes';
|
||||
import { textureItem } from '../../src/core/model/Properties';
|
||||
import { tagged } from '../../src/core/model/Properties';
|
||||
import { findAsset } from '../../src/core/model/Project';
|
||||
import { type PropertyDef, structOf, variableDef } from '../../src/core/properties/PropertySchema';
|
||||
import { makeBehavior, makeProject, roundTrip } from '../helpers';
|
||||
@@ -54,7 +54,7 @@ describe('a variable of kind color or texture', () => {
|
||||
describe('a struct field of kind texture', () => {
|
||||
/** Declared, so the value needs no tag: the field says what it is, as a color field does. */
|
||||
it('holds the plain id, and starts empty', () => {
|
||||
expect(structOf([{ key: 'pic', kind: 'texture' }], { pic: textureItem('fr-0-1') })).toEqual({
|
||||
expect(structOf([{ key: 'pic', kind: 'texture' }], { pic: tagged('texture', 'fr-0-1') })).toEqual({
|
||||
pic: 'fr-0-1',
|
||||
});
|
||||
expect(structOf([{ key: 'pic', kind: 'texture' }], undefined)).toEqual({ pic: '' });
|
||||
|
||||
Reference in new issue
Block a user