Repository navigation
Data-bound list and form screen in ui, composed by init --with ui,store (refs #262) - #328
Merged
Merged
Conversation
…init --with ui,store (refs #262) The ui extension gains screens config, reads the store's collection declaration at activation and serves a list/create/edit/delete screen driven by a nonce-loaded crud kit script. Edit drafts survive re-renders and failed optimistic toggles roll back. init dedupes identical host imports and the store scaffold's PROJECT_SHA256 description now matches ui and auth so the extensions compose. Co-Authored-By: Claude Sonnet 5 <[email protected]>
jimhoyd
force-pushed
the
feat/ui-store-crud-262
branch
from
September 20, 2026 19:53
d8c5cf5 to
f47c5ab
Compare
… (CodeQL) Co-Authored-By: Claude Sonnet 5 <[email protected]>
This was referenced Sep 20, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #262 (does not close it). Follows the maintainer decision: extend
@jimhoyd/urlcode-ui, no new core handler, host wiring throughinit --with.Spike: can a non-operator project render a bound list today?
Ran in a scratch project (no host file) with a trusted function importing
@jimhoyd/urlcode-ui.node_modules, andrenderDocument+tablereturn kit-styled static HTML (200, escaped).createKitlinks/assets/ui/..., nothing serves them), the nonce CSP (the function response carried no CSP header;renderDocumentinlines ~35 KB of style), and any data binding (no helper reads a data source). So a bound screen needs the host, which is what the scaffold now generates.What this adds
crudScreen/crudMarkup/crudFields: a create form, inline edit and delete for a collection declared like the store's ({mount, fields}), plus acrudkit script (content-hashed asset, loaded with the page nonce,connect-src 'self', no inline script).extensions.ui.config.screens(/todos: {collection, title}): the ui extension reads the store's collection fromextensions.storeat activation, so fields are declared once for API and screen. Routes are/todos/*withextension: ui.init --with ui,storewrites the screen entry and route (auth: truewhen auth is composed).textContent/value; the shell is escaped. Tests assert noinnerHTML-style sinks.Composition bugs found and fixed on the way
init --with ui,storeproduced a host with a duplicateimport {fileURLToPath}(SyntaxError).src/init-with.tsnow writes an identical import line once.PROJECT_SHA256differently, whichinitrefuses. Store's text now matches ui/auth.Verification
npm ci,npm run verify(includes verify:workspaces),npm run docs:llms,npm run check:docsall pass; no llms-full.txt change was needed.packages/ui/test/crud.test.ts(client behaviour against a small fake DOM intest/support/fake-dom.ts, extension activation and refusals, scaffold), and an integration test intest/workspace-scaffold.integration.tsthat runsinit --with ui,store, loads the generated host and serves/todos, the script asset and the API. Paths usejoin/tmpdir, no POSIX-only assumptions.init --with ui,storesite: created a record, hostile markup rendered as text, edit text and focus survived Refresh, a forced 500 on PATCH reverted the checkbox, no console errors, CSP header has nonce script-src and no unsafe-inline. Not run in CI (no browser tests there) and not tried on Windows or in other browsers.Open decisions (also in docs/OPEN-DECISIONS.md)
Per-field labels/columns config, filtering and sorting, per-record ownership before multi-user use, recipes/ entry and release wiring (#323/#324), a browser test in CI.
packages/uiunpacked size was about 3 KB over its package-audit budget; I kept scripts/package-audit.ts untouched and shrank the generated.d.tsinstead, so that budget has almost no headroom left.🤖 Generated with Claude Code