For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Bring the v4 queue panel in line with the z-code-2 queue UI, make queue edit extract the item into the composer, and wire drag reorder to CLI projection state.
Architecture: Keep queue authority in CLI projection (snapshot.queue.items) and send all mutations through v4 commands. UI renders projection state only; drag reorder computes a beforeQueueItemId anchor and lets TurnSteerReordered update projection. Queue edit deletes the item through deleteQueueItem before filling the composer.
Tech Stack: React 19, TypeScript, @dnd-kit/core, @dnd-kit/sortable, lucide-react, v4 command protocol.
DESIGN.md, use semantic tokens, support light/dark themes and mobile web.packages/ui/src/logger.ts.Files:
docs/ui/chat-message-queue.mdpackages/ui/src/v4/ConversationQueuePanel.tsxpackages/ui/test/v4ConversationQueuePanel.test.tsxInterfaces:
QueueState.items with queueItemId, text, and kind.Produces: a queue panel with drag-handle visual affordance, compact icon actions, and unchanged command callbacks.
[ ] Step 1: Write the failing visual test
Create a test that renders two queue items and asserts:
data-testid="v4-queue"data-queue-item-iddata-v4-queue-drag-handle立即, not 立即发送the old 上移 button copy is absent.
[ ] Step 2: Run test to verify it fails
Run: pnpm exec vitest run packages/ui/test/v4ConversationQueuePanel.test.tsx
Update ConversationQueuePanel to use Button, ControlHintTooltip, lucide icons, semantic classes, and chat.queue.* i18n labels. Keep reorder callback inert until Task 3.
Run: pnpm exec vitest run packages/ui/test/v4ConversationQueuePanel.test.tsx
Commit: feat(ui): align v4 queue panel visuals
Files:
docs/ui/chat-message-queue.mdpackages/ui/src/v4/SessionPane.tsxpackages/ui/src/v4/ConversationComposer.tsxpackages/ui/src/v4/ConversationQueuePanel.tsxpackages/ui/test/v4SessionPaneQueueEdit.test.tsxpackages/ui/test/v4ConversationComposerErrorBanner.test.tsInterfaces:
onEditItem(queueItemId) from queue panel.Produces: ConversationComposer prop externalTextInsertRequest?: { requestId: number; text: string }.
[ ] Step 1: Write failing tests
Add a SessionPane test that clicks queue edit and expects deleteQueueItem to be sent before composer receives the queue text. Add a ConversationComposer test that changes externalTextInsertRequest and expects the editor API setText and onTextChange to receive the text.
Run: pnpm exec vitest run packages/ui/test/v4SessionPaneQueueEdit.test.tsx packages/ui/test/v4ConversationComposerErrorBanner.test.ts
In SessionPane, look up the queue item text from the current projection, send deleteQueueItem, then set the composer insert request only for accepted/noop ACKs. In ConversationComposer, apply each new request once via inputApiRef.current.setText(), update local text state, persist draft, and focus.
Run: pnpm exec vitest run packages/ui/test/v4SessionPaneQueueEdit.test.tsx packages/ui/test/v4ConversationComposerErrorBanner.test.ts
Commit: feat(ui): extract queued edit into composer
Files:
docs/ui/chat-message-queue.mdpackages/ui/src/v4/ConversationQueuePanel.tsxpackages/desktop/test/e2e/helpers/v4-conversation.tspackages/desktop/test/e2e/conversation-session/queue/conversation-session-v4-queue.test.tspackages/ui/test/v4ConversationQueuePanel.test.tsxInterfaces:
onMoveItem(queueItemId, beforeQueueItemId) from panel props.Produces: resolveV4QueueReorderAnchor(items, activeId, overId) where downward moves use the item after overId, and tail moves use null.
[ ] Step 1: Write failing reorder tests
Add unit tests for upward, downward, tail, no-op, and missing-id anchor calculations.
Run: pnpm exec vitest run packages/ui/test/v4ConversationQueuePanel.test.tsx
Wrap queue items in DndContext and SortableContext. On drag end, compute the beforeQueueItemId anchor and call onMoveItem; do not mutate local queue order.
Replace the old clickV4QueueItemUp path with drag helpers that move the second item above the first and assert projection order changes.
Run: pnpm exec vitest run packages/ui/test/v4ConversationQueuePanel.test.tsx
Commit: feat(ui): reorder v4 queue by drag
pnpm exec vitest run packages/ui/test/v4ConversationQueuePanel.test.tsx packages/ui/test/v4SessionPaneQueueEdit.test.tsx packages/ui/test/v4ConversationComposerErrorBanner.test.tspnpm --filter @zcode/bootstrap test -- tests/product-projection.test.ts tests/v4-native-queue.test.tspnpm typecheckpnpm lint