Skip to content

Review a connection's actions as one batch - #542

Draft
ndisidore wants to merge 1 commit into
feat/action-apply-through-foundationfrom
feat/apply-though-ui
Draft

ndisidore wants to merge 1 commit into
feat/action-apply-through-foundationfrom
feat/apply-though-ui

Conversation

@ndisidore

Copy link
Copy Markdown
Member

Replaces the singular apply/reject action buttons with the batch application work. Sectioned per-connection since each of these has its own sequential queue (though we could make a unified approval view if you prefer that)

Screenshot from 2026-09-21 16-00-18 Screenshot from 2026-09-21 16-01-52 Screenshot from 2026-09-21 16-02-02

@github-actions github-actions Bot added the workshop/frontend Changes to the Workshop frontend label Sep 21, 2026
@github-actions

Copy link
Copy Markdown

Preview: pr542-feat-apply-though-ui

https://pr542-feat-apply-though-ui-router.cloudflare-os-previews.workers.dev

Dashboard · deleted when this PR closes

@ndisidore
ndisidore added this pull request to stack #544 September 21, 2026 21:10
Approving and rejecting one action at a time put the decision in three places
-- the Activity list, the header popover, and every chat card -- each with its
own resolver, its own inline "Always approve" shortcut, and, in chat, an
optimistic write that guessed the outcome before the server reported one. That
guess is not sound under apply-through: a veto can invalidate a later action,
so no client can know what a submission decided. The three surfaces also had
no way to express "all of these except that one", which is the thing the
backend's applyActionsThrough already accepts.

Move the decision to Activity, one Gatekeeper connection at a time.
useActionReview owns the drafts for the workspace's lifetime: it freezes each
connection's boundary the first time the user looks at a *complete* pending
snapshot, so a batch can only ever authorize rows that were on screen, and
arrivals after that wait behind an explicit Include rather than joining a
request the user already read. Vetoes are browser-local intent -- a checkbox
sends no RPC -- and Apply submits the captured (boundary, vetoes) pair once,
behind a synchronous per-connection guard so a double click cannot duplicate
it. Nothing optimistic is written on either outcome: the action subscription
remains the only source of a decision, and a refusal keeps the boundary and
every still-pending selection so a stopped action can be vetoed and the batch
re-submitted. A replaced stub or workspace bumps a session generation that
fences late completions out of the new one.

Standing policy stays in the Auto-approval tab, which now also offers kinds
that only a pending card advertises -- listPreApprovableActions visits
gadget-bound connections alone, so an eligible kind could be unconfigurable --
and refuses to grant a new rule on a connection with staged vetoes or a batch
in flight, since that would apply rows the user is still deciding about.
Revoking is never blocked.

Chat cards and the popover preview navigate to that review, focused on the
action's own connection, instead of deciding. The composer stays blocked until
the awaited action is authoritatively resolved; opening Activity or ticking
Veto does not unblock it. useResolveAction, useAlwaysApproveTag, ResolveButton
and AutoApproveConfirmDialog have no callers left and are gone, along with
chat's applyOptimisticActionState and the auto-approve reload plumbing;
useActionEntries, hook toggles and history are untouched. The backend is
untouched too: applyActionsThrough, its stop semantics and its tests already
describe this behaviour, and this is the first client to use them.
@cloudflare cloudflare deleted a comment from ask-bonk Bot Sep 21, 2026
@ask-bonk

ask-bonk Bot commented Sep 21, 2026

Copy link
Copy Markdown

@ndisidore Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

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

Labels

workshop/frontend Changes to the Workshop frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant