WORK-256
Setting up your dashboard 0 entities found · 9/32 branches scanned
ID:WORK-256Status:ready

EntityRegistration.scope: 'page' | 'site' field

Small registry interface evolution to support page-scoped entities (drawers from WORK-257, future page-local primitives). Page-scoped entries are namespaced internally by page URL so two pages can each declare the same ID without collision. Site-scoped entries (the existing behavior, the default for back-compat) continue to be globally addressable.

Priority:mediumComplexity:simpleMilestone:v0.15.0Source:SPEC-060
claude/modal-drawer-pattern-a1Wgb View source

Criteria completion

Criteria completion: 0 of 8 (0%) checked; tracking started on May 23, no incremental history yet0%25%50%75%100%May 23Jun 15

Tracking started May 23 — check back for trends.

Branches 2
claude/modal-drawer-pattern-a1Wgb current ready
main doneclaude/v0.15.0 done
History 1
  1. c15804e
    Created (ready)by bjornolofandersson

Acceptance Criteria

  • EntityRegistration interface gains an optional scope?: 'page' | 'site' field
  • Default is 'site' when omitted (back-compatible — existing registrations behave identically)
  • EntityRegistry implementation namespaces page-scoped entries internally by page URL, so two pages can register the same ID with scope: 'page' without colliding
  • Lookup of a page-scoped entity from a specific page resolves correctly to that page's entry
  • Cross-page lookup of a page-scoped entity finds it (used by xref resolution for cross-page drawer triggers, though end-to-end UX is out of v1)
  • Existing site-scoped registrations and lookups are unaffected (no regression)
  • Tests cover the same-ID-different-pages case for page-scoped entries
  • Documentation note in the registry interface explains the field and its consequences

Approach

Per the spec: EntityRegistration interface in packages/types/src/registry.ts (or wherever the interface lives) gains the optional field. EntityRegistryImpl in packages/content/src/registry.ts adds internal page-qualified keying (something like ${pageUrl}::${id} under the hood) for page-scoped entries. Site-scoped path stays as-is.

Dependencies

  • None within v0.15.0.

References

  • SPEC-060 — drawer-rune spec (the motivating consumer)
  • packages/types/src/registry.tsEntityRegistration interface
  • packages/content/src/registry.tsEntityRegistryImpl