Skip to content

Remove entity-type slash commands (/ai-chat, /person, user-defined types) - #2181

Merged
mstomar125 merged 4 commits into
mainfrom
issue-2152-remove-entity-slash
Aug 20, 2026
Merged

mstomar125 merged 4 commits into
mainfrom
issue-2152-remove-entity-slash

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

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 the deletableViaBackspace: false / acceptsContentMerge: false guards 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).
  • Removed PLUGIN_PRIORITIES from schema-plugin-loader.ts entirely — CUSTOM_ENTITY was its only consumer anywhere in the codebase, and CORE/USER_COMMAND were already dead before this change.
  • Deleted the now-resolved "known exceptions" paragraph from core-plugins.ts's slash-command doc comment.
  • Updated stale doc comments in schema-plugin-loader.ts that described the old slash-command-generation behavior.

Tests

  • Inverted the 5 schema-plugin-loader.test.ts assertions that expected a generated slash command (now assert slashCommands is empty).
  • Updated core-plugins.test.ts and slash-command-service-registry-integration.test.ts slash-command counts: 13 → 11 core commands (ai-chat and person no longer contribute one).
  • Full frontend suite: 223 files / 4765 tests passing.

Manual verification (real daemon, not assumed)

Stood up an isolated nodespaced + dev-proxy + vite stack (fresh NODESPACE_HOME, rebuilt target/debug/nodespaced from current source) and drove the real app with Playwright:

  • Typed / 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.
  • Person: sidenav → Schema Types → Person → type view → + New → item count went 1 → 2, new person node created.
  • AI Chat: sidebar's dedicated "AI Chats" section (from Add an "AI Chats" sidebar section listing conversations with a "+ New chat" button #2153, already merged) → + New chat → chat viewer opened with model selector.
  • User-defined type (created a Venue schema 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-chat removed (slashCommands: [], plugin otherwise intact)
  • /person removed (slashCommands: [], inline component and schema form intact)
  • createPluginFromSchema no longer generates slash commands for user-defined types
  • The five affected assertions in schema-plugin-loader.test.ts inverted
  • PLUGIN_PRIORITIES.CUSTOM_ENTITY removed (whole PLUGIN_PRIORITIES object was dead, removed)
  • Sidenav → type view → create instance verified working for 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 assumed
  • Known-exceptions paragraph in core-plugins.ts deleted
  • No remaining entity type carries a slash command — slashCommands non-empty only for primitives + task

Closes #2152

🤖 Generated with Claude Code

mstomar125 and others added 4 commits August 20, 2026 11:45
…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>
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove entity-type slash commands (/ai-chat, /person, user-defined types) to match the primitives-plus-task rule

1 participant