Repository navigation
Default new-node content to "Untitled {Type}" for name-as-content Core types - #2018
Conversation
…e types
project/skill (and collection/agent-guidance/tool, which share the constraint)
are Core types whose content field is the node's name — their NodeBehavior
rejects empty content. The sidebar "+New" path (createSchemaInstance) always
created with content:'' and so always failed validation for these types, leaving
them with no working creation path.
Seed "Untitled {DisplayName}" for that explicit set; body-content types
(text/header/task/…) and titleTemplate/custom types are unchanged — empty
content is correct for them. Kept as an explicit list since no frontend signal
distinguishes name-as-content Core types from primitives. Reuses the existing
humanizeSchemaId helper (now exported).
Closes #1995.
Co-Authored-By: Claude <noreply@anthropic.com>
Comment-only: note that including tool in the name-as-content set keeps the content rule uniform but does not by itself make a bare tool creatable (its validation also requires a non-empty handler). Co-Authored-By: Claude <noreply@anthropic.com>
Pragmatic Code Review + /address-reviewVerdict: APPROVE. Load-bearing check passed — the 5 🟡 tool inclusion is slightly misleading — addressed: added a comment noting 🟡 coupling ( Re-Review Decision: NO RE-REVIEW NEEDED — only a clarifying comment was added. |
Summary
projectandskillare Core types whosecontentfield is the node's name, not body text — theirNodeBehavior::validate()rejects empty content. The sidebar "+New" path (createSchemaInstance) always created withcontent: '', so creation always failed validation for these types — they had no working creation path. Closes #1995.Change
schema-authoring.ts:createSchemaInstanceseeds"Untitled {DisplayName}"for an explicitNAME_AS_CONTENT_TYPESset (project,skill,collection,agent-guidance,tool— all share the non-empty-content constraint); every other type keepscontent: ''.schema-plugin-loader.ts: export the existinghumanizeSchemaIdhelper (reused for the display name —agent-guidance→"Untitled Agent Guidance").Kept as an explicit list per the issue's guidance: no frontend signal (schema field,
isCore, field count) distinguishes name-as-content Core types from primitives, so inferring the set would silently drift.Non-goals honored
text,header,task,code-block, …) unchanged — empty content is correct ("start typing").titleTemplate/custom types unchanged —contentstays''perschema-management.md.Tests
Extended
schema-authoring.test.ts(+2): the 5 name-as-content types each round-trip"Untitled {Type}";text/header/task/code-block/invoicestay empty. Full frontend suite green (192 files / 4452 tests); eslint + svelte-check clean; pre-push gate passed.🤖 Generated with Claude Code