WORK-057
ID:WORK-057Status:ready

Editor Registry-Powered Autocomplete

Priority:mediumComplexity:moderateMilestone:v1.0.0Source:SPEC-002
changeset-release/main View source

Criteria completion

No incremental history — criteria tracking started on Apr 19.

Branches 3
History 6
  1. f2b3512
    Content editedby Claude
    Add {ID}-{slug}.md filename convention + migrate filenames subcommand
  2. 59ded4a
    Content editedby Claude
    Implement SPEC-037 plan package hardening: all 7 work items
  3. f262d7b
    Content editedby Claude
    Backfill source attributes on all 123 work items
  4. 2637549
    Content editedby Björn Andersson
    chore(plan): create v1.0.0 milestone, complete v0.9.0, fix acceptance cr
  5. a129a9e
    Content editedby Claude
    Assign all new work items (WORK-051–068) to v0.9.0 milestone
  6. 2f24c14
    Created (ready)by Claude
    Add work items for SPEC-001 and SPEC-002

Summary

The entity registry enables intelligent autocomplete throughout the editor. Since the registry contains every named entity across the project, the editor can suggest entity names, page references, and rune attributes as the author types.

Acceptance Criteria

  • Bold text autocomplete: typing **Ves suggests Veshra when a character entity with that name exists in the registry
  • Autocomplete popup shows entity type and source page alongside the name
  • Rune attribute autocomplete: typing {% bond from=" suggests character and faction names from the registry
  • Page reference autocomplete: in nav, prerequisite, and page-slug attributes, suggest from registered pages
  • Design token autocomplete: inside sandbox CSS content, typing var(-- suggests design tokens from the registry
  • Term awareness: words matching registered concept terms show a subtle indicator (dotted underline) in the source view
  • Cross-package attribute awareness: autocomplete for character attributes includes both core and extension attributes, indicating which package provides each

Approach

Build on the background entity registry from WORK-056. Add completion providers to the editor's CodeMirror/Monaco instance that query the registry:

  1. Bold text provider: Detect cursor inside **...**, query registry for entity names matching the partial text
  2. Attribute value provider: Detect cursor inside a rune attribute value, determine the attribute name, query registry for appropriate entity types (e.g., from/to → characters + factions)
  3. Page reference provider: Detect page slug attributes, query registry for all page entities
  4. Design token provider: Detect var(-- inside sandbox content, query registry for design-token entities
  5. Term indicator: On document change, scan visible text for matches against term entities, apply decorations

References

  • SPEC-002 (Cross-Page Pipeline — Registry-Powered Autocomplete)
  • WORK-056 (Editor Background Entity Registry)