Skip to content

Transition controls on store screens (#863) - #872

Merged
jimhoyd merged 1 commit into
mainfrom
claude/ui-transition-controls
Sep 28, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
claude/ui-transition-controls

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Fixes #863 item 2. Store screens over collections with transitionOnly fields are no longer refused.

What changes

  • Generic contract (ui). CrudCollection gains transitions: [{name, from, mount?}] and idempotency, and field specs gain transitionOnly. crudTransitions validates them at activation. A screen with no transitions renders exactly as before.
  • The crud script (the existing nonce-loaded asset; CSP unchanged):
    • transitionOnly fields are read-only and never included in request bodies.
    • A button appears on each row whose values match a transition's from.
    • A click sends POST with no body, same-origin credentials, If-Match, and a fresh Idempotency-Key when the collection retains keys.
    • 409, 412, 403 and other errors become page messages (new ui.crud.transition* copy keys in English and French).
  • Breaking store change: list responses on collection and readers mounts now include etags: {<id>: etag}, so a page can send If-Match for any row.
  • Readers screens. readers: true on a store screen lists the readers mount read-only and offers exactly the by: others transitions. The owner's screen never offers them.

Evidence (macOS, Node 26)

  • npm run verify passes: root 1126, ui 110, store 125, form-records 23, test:addons 6, test:proof 12.
  • npm run test:package passes.
  • crud-transitions.test.ts (7 tests): read-only fields, when buttons appear, the POST shape, error messages, XSS through values, from and hostile names.
  • screens-transitions.test.ts serves ui, store and a test principal extension for real and runs the served script:
    • the owner creates a request, and a reviewer approves it on the readers screen
    • a stale page gets 412 with nothing written
    • the owner's withdraw succeeds
    • a conflict gets 409 and its message
    • a reviewer approving their own request gets 403
    • a non-member's readers list does not load
    • hostile titles stay text
  • ui unpacked budget raised to 360 KiB (measured 367,111 bytes). ui packed is 99,966 bytes against 100 KiB, so the next ui change will need that limit raised.

Limits

  • The screen cannot know whether the viewer passes a members gate, so a non-member sees the button and gets the 403 message.
  • Edit and delete on the screen still send no If-Match, even though list ETags now make that possible.
  • Tested on the fake DOM only; the Playwright browser test is not extended.

Follow-ups are filed in a separate issue.

🤖 Generated with Claude Code

Screens over collections with transitionOnly fields are no longer refused.
ui shows those fields read-only (never a control, never sent) and offers
each declared transition as a button on the rows holding its `from`
values. A click posts no body, same-origin, with If-Match from the list's
ETag (or the screen's own last write) and a fresh Idempotency-Key when the
collection retains keys; 409, 412, 403 and other refusals are page
messages.

A store screen may declare `readers: true` to list the readers mount
read-only and offer exactly the `by: others` transitions on their own
mounts; the default screen offers the transitions served on the
collection mount.

Breaking: store list answers add `etags`, each listed record's ETag keyed
by id, so a client can make a write conditional on the version it listed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jimhoyd
jimhoyd enabled auto-merge (squash) September 28, 2026 23:32
@jimhoyd
jimhoyd merged commit ce41133 into main Sep 28, 2026
33 checks passed
@jimhoyd
jimhoyd deleted the claude/ui-transition-controls branch September 28, 2026 23:38
jimhoyd added a commit that referenced this pull request Sep 29, 2026
…lters; declared targets in validate/capabilities (#866, #867) (#876)

* feat(store,core)!: members CLI, audited membership, reassign memberships, enum filters, declared targets in validate (#866, #867)

- urlcode-store members add|remove|list, beside the live server.
- Membership collections may declare audit: true; every grant and revocation
  (CLI, library, StoreExports, reassign) writes its event in the same
  transaction. Changing a membership key is refused.
- reassign moves membership entries with the records it moves.
- A filter value outside a field's enum is 400 invalid_query.
- readers.showOwner: true exposes the owner's opaque id to members only.
- urlcode validate (--target) and urlcode capabilities use installed
  descriptors' declared targets without a host file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: regenerate after rebase

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(store): keep per-record etags on readers list responses with showOwner

The readers mount built its list answer by hand to keep _owner, which dropped
the etags map #872 adds to every list response. It now goes through listView
with the readers projection, and the showOwner test asserts the etags.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store transitions follow-ups: reviewer gate, ui transition controls, interval constraints, retries for host transactions

1 participant