Skip to content

Decouple UI data screens from the store extension's private configuration #709

Closed

Description

@jimhoyd

Observed gap

packages/ui/src/host/extension.ts makes extensions.ui.config.screens a store-specific feature: it loads the project document, reads extensions.store.config.collections, and validates that exact shape. The UI scaffold also conditionally creates a Todos screen only when store is installed.

This makes an otherwise generic presentation extension know a sibling extension's name and private YAML layout, but ui does not declare store as a requirement. A different collection/data extension cannot supply the same screen without emulating the store's configuration, and a change in store's schema creates an implicit cross-package compatibility seam outside requires/contributes.

The source also keeps structural copies of core extension runtime interfaces in the same file while importing loadDocument from the core root, contrary to the documented authoritative contract at @jimhoyd/urlcode/extensions.

Desired direction

Keep the existing generic host composition boundary. Either move the store-specific CRUD screen integration into a store-owned optional UI contribution, or introduce an explicit generic, versioned data-screen/resource contract passed through contributes/ctx.get. Make any dependency visible in the add-on graph and add fixtures proving a second provider can participate without copying store YAML.

Replace the UI package's structural copies of core extension contract types with imports from @jimhoyd/urlcode/extensions where possible.

Evidence

  • packages/ui/src/host/extension.ts: screens, storeCollections(), and the structural RuntimeExtension/ExtensionInstance copies.
  • packages/ui/src/host/scaffold.ts: /todos screen conditional on the store package.
  • docs/EXTENSIONS.md#nesting: dependency and contribution mechanisms are documented as the composition seam.

Activity

  1. added
    enhancement
    extension
    on Sep 25, 2026
  2. jimhoyd commented on Sep 25, 2026

    @jimhoyd
    CollaboratorAuthor

    Decision (owner, 2026-09-25): store owns its CRUD screen. Move the store-specific screen integration out of ui and into a store-owned, optional UI contribution passed through the documented contributes/ctx.get seam. ui stops reading extensions.store.config.collections (storeCollections()) and stays provider-neutral. A general, versioned data-source contract is deferred until a second data provider exists. Any store→ui dependency must be visible in the add-on graph.

    Already done in #720: ui imports core's extension contract types from @jimhoyd/urlcode/extensions instead of keeping structural copies. What remains is the screen move above, with fixtures showing that ui no longer reads store YAML and that the existing Todos screen still works.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementextension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions