Repository navigation
Remove entity-type slash commands (/ai-chat, /person, user-defined types) - #2181
Merged
Merged
Conversation
…pes) core#2133 established that slash commands are for content primitives plus task; entity types are not slash-creatable. core#2151 documented three surfaces that predated the rule as known exceptions, explicitly not precedent. This retires them: - aiChatNodePlugin and personNodePlugin now register slashCommands: [] while keeping their viewer/reference/schema-form/backspace-guard registrations intact. - createPluginFromSchema no longer generates a slash command for user-defined schema types; the plugin registration still exists for reference/viewer resolution. - PLUGIN_PRIORITIES is removed from schema-plugin-loader.ts — CUSTOM_ENTITY was its only consumer, and CORE/USER_COMMAND were already unreferenced anywhere in the codebase. - Inverted the five schema-plugin-loader.test.ts assertions that expected a generated slash command; updated core-plugins.test.ts and slash-command-service-registry-integration.test.ts command counts (13 -> 11 core commands). - Deleted the now-resolved "known exceptions" paragraph from core-plugins.ts's slash-command doc comment. Verified via an isolated dev:browser + real daemon stack that person, ai-chat, and a fresh user-defined schema (Venue) all still create instances through the sidenav/sidebar surfaces after their slash commands are gone, and that the slash-command dropdown offers only the 11 primitive+task commands. Co-Authored-By: Claude <noreply@anthropic.com>
…ds on hasTitleTemplate)
…yTitle Merging main pulled in #2179 (Fix stale cached title on tab titles, query views, and collections), which added PluginRegistry.resolveDisplayTitle() and made getNodeTitle() delegate to it. Both derive hasTitleTemplate via findSlashCommand(nodeType)?.hasTitleTemplate — the exact field this PR's earlier commit stopped populating when it emptied createPluginFromSchema's slashCommands array. Combined, every title_template-driven user-defined schema type would have shown a blank/stale title instead of its computed name across node-row.svelte, resolveDisplayTitle's consumers (query list/ kanban/table views, the collections sidebar), and getNodeTitle's consumers (tab titles). Moves hasTitleTemplate/titleTemplate off SlashCommandDefinition and onto PluginDefinition as top-level fields (alongside deletableViaBackspace), since the signal is a per-type property, not tied to slash-command availability. Adds PluginRegistry.hasTitleTemplate()/getTitleTemplate() accessors mirroring the acceptsContentMerge()/deletableViaBackspace() pattern, and updates every consumer (resolveDisplayTitle, node-row.svelte, base-node-viewer.svelte's now-dead custom-entity-slash-command branch) to read from them instead of findSlashCommand(...)?.hasTitleTemplate. createPluginFromSchema now sets hasTitleTemplate/titleTemplate at the plugin level. Updates the 5 test files that constructed synthetic plugins with these fields nested in a slash command, adds direct coverage for the new accessors, and restores the two schema-plugin-loader.test.ts titleTemplate assertions that had collapsed into duplicate bodies (both previously only checked slashCommands is empty, losing coverage of hasTitleTemplate/ titleTemplate propagation). Also fixes stale doc comments (core_schemas.rs, capture_service.rs, agent_session_service.rs, agent_session_service.proto) that described ai-chat nodes as created via the now-removed `/ai-chat` slash command, and drops two GitHub issue-number references from comments this PR was already touching. Co-Authored-By: Claude <noreply@anthropic.com>
…Unicode/empty-template edge cases - base-node-viewer.svelte: delete handleCustomEntitySlashCommand and its two rendersAsEntityRow(newNodeType) call sites — unreachable now that no first-party plugin's slash command ever targets an entity-row type (ai-chat, person, and all user-defined schema types have slashCommands: [] after this PR). No production registration path can still reach it, so per this repo's no-dead-code convention it's deleted rather than kept as latent "extension point" infrastructure. - node-row.svelte: use the same Unicode-aware HAS_RESOLVED_CHARACTER_RE (exported from node-display-title.ts) that resolveDisplayTitle's consumers use, instead of the ASCII-only /\w/ — a title_template resolving to a non-Latin-script name (CJK, Arabic, Cyrillic, ...) now renders correctly here too instead of falling back to the raw template placeholder. - plugin-registry.ts: getTitleTemplate() now gates on hasTitleTemplate() instead of titleTemplate's own truthiness, so a plugin with titleTemplate: '' (which hasTitleTemplate correctly treats as "no template") can't return a defined-but-empty string, matching the method's documented "undefined means no template" contract. Co-Authored-By: Claude <noreply@anthropic.com>
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
core#2133 established the rule: slash commands are for content primitives (text, headers, checkboxes, code, quotes, ordered lists, rules, tables) plus
task. Entity types — core and user-defined alike — are not slash-creatable. core#2151 documented three surfaces that predated the rule as known exceptions, explicitly marked as not precedent, without changing them. This PR removes them.aiChatNodePlugin(core-plugins.ts) —slashCommands: []. Viewer, reference, and thedeletableViaBackspace: false/acceptsContentMerge: falseguards are untouched.personNodePlugin(core-plugins.ts) —slashCommands: []. Inline node component and hardcoded schema form are untouched.createPluginFromSchema(schema-plugin-loader.ts) — no longer generates a slash command for user-defined schema types. The plugin registration itself is untouched (still needed for reference/viewer fallback).PLUGIN_PRIORITIESfromschema-plugin-loader.tsentirely —CUSTOM_ENTITYwas its only consumer anywhere in the codebase, andCORE/USER_COMMANDwere already dead before this change.core-plugins.ts's slash-command doc comment.schema-plugin-loader.tsthat described the old slash-command-generation behavior.Tests
schema-plugin-loader.test.tsassertions that expected a generated slash command (now assertslashCommandsis empty).core-plugins.test.tsandslash-command-service-registry-integration.test.tsslash-command counts: 13 → 11 core commands (ai-chat and person no longer contribute one).Manual verification (real daemon, not assumed)
Stood up an isolated
nodespaced+ dev-proxy + vite stack (freshNODESPACE_HOME, rebuilttarget/debug/nodespacedfrom current source) and drove the real app with Playwright:/in the outline — dropdown shows exactly the 11 primitive+task commands (Text, Header 1-3, Task, Checkbox, Code Block, Quote Block, Ordered List, Horizontal Line, Table). No AI Chat, no Person.+ New→ item count went 1 → 2, new person node created.+ New chat→ chat viewer opened with model selector.Venueschema via CLI to simulate a real custom type): sidenav → Schema Types → Venue → type view →+ New→ item count went 0 → 1, new venue node created and opened for editing.All three creation paths work end-to-end after the slash commands are removed — nothing is stranded.
Acceptance criteria
/ai-chatremoved (slashCommands: [], plugin otherwise intact)/personremoved (slashCommands: [], inline component and schema form intact)createPluginFromSchemano longer generates slash commands for user-defined typesschema-plugin-loader.test.tsinvertedPLUGIN_PRIORITIES.CUSTOM_ENTITYremoved (wholePLUGIN_PRIORITIESobject was dead, removed)person,ai-chat(via its dedicated sidebar section), and a user-defined type after the removals — actually exercised via Playwright against a real daemon, not assumedcore-plugins.tsdeletedslashCommandsnon-empty only for primitives +taskCloses #2152
🤖 Generated with Claude Code