Skip to content

feat: content-node editor scope#1004

Open
YKDZ wants to merge 8 commits into
mainfrom
copilot/content-node-editor-scope-20260518
Open

feat: content-node editor scope#1004
YKDZ wants to merge 8 commits into
mainfrom
copilot/content-node-editor-scope-20260518

Conversation

@YKDZ
Copy link
Copy Markdown
Owner

@YKDZ YKDZ commented May 18, 2026

Summary

Implements the content-node editor workbench with explicit EditorScope as specified in docs/content-node-editor/plan.md.

Changes

Shared contracts (Phase 1)

  • packages/shared/src/schema/editor.tsEditorScope, EditorElement, and related Zod schemas
  • Extended AgentSessionMetadata with branchId, contentNodeIds, currentElementContentNodeId
  • Agent tool context picks up new metadata fields

Domain queries (Phase 2)

  • editor-scope-elements.query.ts — recursive CTE for subtree union, full-project semantics, branch-overlay-before-pagination
  • list-editor-scope-content-nodes.query.ts — branch-aware content-node metadata
  • editor-overlay-payload.ts — typed VCS branch write contracts
  • Integration tests for scope semantics and branch overlay consistency

oRPC editor API (Phase 3)

  • apps/app-api/src/orpc/routers/editor.tsorpc.editor.* with project-viewer guard, cross-project branch rejection
  • Legacy orpc.document.* handlers delegate to single-node EditorScope

Canonical URLs and route guards (Phase 4)

  • scope-url.ts / scope-url.spec.ts — URL parse/build helpers
  • Canonical /editor/project/:projectId/:languageToId/:elementId routes with +guard.server.ts
  • Legacy /editor/:documentId/:languageToId/:elementId SSR-redirects to canonical URLs

Frontend store and UI (Phase 5)

  • useEditorContextStore repurposed as EditorScope store
  • useEditorTableStore calls orpc.editor.*
  • EditorScopeBar.vue, ContentNodeFilterPicker.vue, EditorStatusFilter.vue — new scope UI
  • ContentNodeTree.vue / ContentNodeTreeNode.vue renamed from DocumentTree
  • DocumentTree.vue becomes a compatibility wrapper

Agent integration (Phase 6)

  • AgentChatPanel.vue populates session metadata with current editor scope
  • list-elements.tool.ts supports project scope and contentNodeIds filter
  • assert-session-scope.ts — subtree-aware assertContentNodesInSession()

QA

  • All local checks pass: moon ci :test :lint :typecheck :fmt
  • Full workspace: moon exec :test :lint :typecheck :fmt
  • autodoc:validate

Auto-Dev Agent added 8 commits May 18, 2026 00:50
…th shared:build

In CI (no cached dist/), source-collector:test-unit would start immediately
(no deps) while shared:build ran concurrently. When vitest tried to import
@cat/shared/dist/index.js before it was built, tests failed with:
  'Failed to resolve entry for package @cat/shared'

Adding ^:build ensures shared:build completes first.
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.

1 participant