Skip to content

[Request]: Plain projects cannot use the UI kit declaratively; no data-bound CRUD screen pattern #262

Closed

Description

@jimhoyd

Tried: use URLCode's existing UI capabilities for the list/form interface.
Expected: a plain project can use the UI kit declaratively.
Got: @jimhoyd/urlcode-ui needs operator host wiring (run 2), and neither run found a data-bound list/form component, so both hand-wrote HTML plus 52-64 lines of browser JS. Both UI scripts had defects (edit text lost on re-render; a failed update left the checkbox flipped). Related: #217 (closed) covers UI wiring in auth/admin scaffolds only.
Suggestion: a documented path (and starter) for a plain project to serve a UI-kit page, and a small data-bound list/form pattern for CRUD screens.
Evidence: an A/B benchmark on URLCode 0.4.1 with Sonnet 5 agents building the same Todo app from the repo docs. Run 1 (benchmark Agent B, no authoring skill, no browser check) and run 2 (session "Todo application with URLCode", authoring skill loaded, tightened prompt) hit this independently. n=1 each; single small app, so treat frequency as anecdotal. The Agent A control (no URLCode) needed 2 shell calls and 0 dependencies for the same app.
Not verified: whether the UI package can already do this from a non-operator project.

Activity

  1. added
    enhancement
    on Sep 20, 2026
  2. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Placement: extend the existing @jimhoyd/urlcode-ui extension, built on top of the store extension in #253.

  3. added
    needs-decision
    extension
    on Sep 20, 2026
  4. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Decision: confirmed as the placement comment above: extend @jimhoyd/urlcode-ui, no new core handler.

    • Solve host wiring once through the init --with scaffold contract (ui, then store when it exists).
    • Order: land [Request]: Declarative persistence: store/collection handler and a file-backed CRUD recipe #253 first, then a CRUD screen in the ui package that reads the store's collection declaration, so a Todo app declares its fields once and gets both the API and the screen.
    • Still unverified: whether the ui package can already render a bound list from a non-operator project. Check that before scoping.
  5. removed
    needs-decision
    on Sep 20, 2026
  6. added
    important
    on Sep 20, 2026
  7. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Findings on the "not verified" question (read from packages/ui on main; nothing was run).

    What a plain project can do today: serve a kit-styled static page with no operator wiring. The UI README documents rendering a page with the kit, writing the HTML to public/welcome.html, and serving it with an ordinary page route.

    What exists: HTML helpers that turn data you pass in into safe markup: field, button, alert, navigation, table(caption, columns, rows), pagination, emptyState, postForm, renderDocument. None of them fetch data.

    What does not exist: a data-bound component that declares its fields once and reads them from a data source. That cannot exist before the store in #253.

    Unverified: whether a trusted function in a plain project can import the kit at runtime without the operator host file. The README does not say how the import resolves.

    Proposed (not a decision): keep the decided order (store in #253 first, then bound screens in the ui package). As a cheaper first step, document the build-time static path and the table/field helpers for plain projects now. That answers the "could not find the UI kit" complaint without waiting for the store.

  8. added
    in-progress
    on Sep 20, 2026
  9. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Progress: an agent has started on this; a PR will be linked here when it opens.

  10. removed
    in-progress
    on Sep 20, 2026
  11. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    First slice shipped in #328: crudScreen in @jimhoyd/urlcode-ui renders a list with create, inline edit and delete from the store's collection declaration, with a nonce'd content-hashed client script (no inline script), and init --with ui,store composes it. Both benchmark defects (edit text lost on re-render, checkbox left flipped after a failed update) are fixed with tests. Deferred, tracked separately: #330 (labels, columns, filtering), #331 (per-record ownership), #332 (browser test in CI).

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

    enhancementextensionimportant

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions