From c2633823fb5bfe39d9bb2d284d8bec6c111b9a06 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Mon, 29 Jun 2026 12:12:18 +0900 Subject: feat(chat): cancel a queued steering message from the UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implements the frontend for the cancel-queued-message backend feature (transport-contract 0.23.0 → 0.24.0, ADDITIVE). While a turn is generating and a user message is queued (awaiting steering delivery), the user can now cancel a single queued message by id so it never runs. - Consume the contract: regenerate the .dispatch/transport-contract.reference.md mirror to 0.24.0; add chat.queue.cancel to the exhaustive WsClientMessage guard (core/wire/conformance.ts) + its test. - ChatTransport port accepts ChatQueueCancelMessage; cancelQueuedMessage(id) on the chat store + app store sends chat.queue.cancel { conversationId, messageId } (fire-and-forget, idempotent — the server no-ops an already- drained/unknown id). - UI: a × cancel affordance per queued row in MessageQueueList.svelte, threaded through SurfaceView's onCancelQueuedMessage (dispatched on rendererId, never the surface id) and wired to store.cancelQueuedMessage. Optimistic removal (pure selectVisibleMessages/reconcileCancelledIds in logic/message-queue.ts) hides the row on click and reconciles from the message-queue surface's post-cancel snapshot. No new event handling — the existing surface subscription reflects the result. Tests: +12 (chat store cancel op ×3, optimistic-removal logic ×11 already existed pattern, MessageQueueList component cancel behavior ×9). Repo fix: package.json + bun.lock were still pinning file:../dispatch-backend/... (stale from the dispatch-backend → backend rename) — corrected to file:../backend/packages/...; bun install now resolves natively with no worktree symlink hack. typecheck 0/0, 1140 tests green (run twice), biome clean, build OK. --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index ea6c751..f772728 100644 --- a/package.json +++ b/package.json @@ -14,17 +14,17 @@ "check:fix": "biome check --write ." }, "dependencies": { - "@dispatch/transport-contract": "file:../dispatch-backend/packages/transport-contract", - "@dispatch/ui-contract": "file:../dispatch-backend/packages/ui-contract", - "@dispatch/wire": "file:../dispatch-backend/packages/wire", + "@dispatch/transport-contract": "file:../backend/packages/transport-contract", + "@dispatch/ui-contract": "file:../backend/packages/ui-contract", + "@dispatch/wire": "file:../backend/packages/wire", "dompurify": "^3.4.5", "highlight.js": "^11.11.1", "marked": "^18.0.4", "marked-highlight": "^2.2.4" }, "overrides": { - "@dispatch/ui-contract": "file:../dispatch-backend/packages/ui-contract", - "@dispatch/wire": "file:../dispatch-backend/packages/wire" + "@dispatch/ui-contract": "file:../backend/packages/ui-contract", + "@dispatch/wire": "file:../backend/packages/wire" }, "devDependencies": { "@biomejs/biome": "^2.4.16", -- cgit v1.2.3