Problem. In alpha.18, useIslandMutation exposes only mutationFn/onSuccess/onError. True optimistic UI (snapshot → optimistic cache write → reconcile/rollback) needs onMutate and onSettled. VS4's KnowledgePanel had to emulate optimistic prepend + rollback with a local overlay because those hooks aren't available.
Proposal. Add onMutate (returns a context/snapshot) and onSettled to the mutation options, matching TanStack Query semantics, so islands get real optimistic rollback + invalidation without per-app overlays.
Surfaced during the eis-chat v2 refactor (netscript alpha.18). Promotion candidate → @netscript/fresh-ui / web-layer.
Problem. In alpha.18,
useIslandMutationexposes onlymutationFn/onSuccess/onError. True optimistic UI (snapshot → optimistic cache write → reconcile/rollback) needsonMutateandonSettled. VS4's KnowledgePanel had to emulate optimistic prepend + rollback with a local overlay because those hooks aren't available.Proposal. Add
onMutate(returns a context/snapshot) andonSettledto the mutation options, matching TanStack Query semantics, so islands get real optimistic rollback + invalidation without per-app overlays.Surfaced during the eis-chat v2 refactor (netscript alpha.18). Promotion candidate →
@netscript/fresh-ui/ web-layer.