2.3 KiB
2.3 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| message-queue-merge-03 | Frontend merge control | completed | 3 |
|
plan.md | ../../specs/ui/requirements/message-queue-merge.md |
Task 03: Frontend merge control
Acceptance
mergeQueuedEntryinlib/api/domains/queue-api.tssendsmessage.queue.mergeand rethrows queue errors;useQueueexposes amergeEntry(entryId)action that refetches after success and refetches onQueueEntryNotFoundError.- The queue panel renders a Merge with above ghost button
(
data-testid="queue-entry-merge", titleMerge with above,IconArrowMerge) on an entry only when the entry and the one above it are both mergeable and share the same sender kind (user↔user,agent↔agent); agent rows additionally require an identical non-emptysender_task_idin metadata (mirroring the backend'smergeAllowed), and the control is hidden for the first entry, mismatched kinds, and workflow/system entries. - Unit tests cover button gating and the click →
mergeEntrywiring.
Verification
cd apps && pnpm --filter @kandev/web test -- --run components/task/chat/queued-ghost-message.test.tsx components/task/chat/queued-ghost-list.test.tsx
Files
apps/web/lib/api/domains/queue-api.tsapps/web/hooks/domains/session/use-queue.tsapps/web/components/task/chat/queued-ghost-message.tsxapps/web/components/task/chat/queued-ghost-list.tsxapps/web/components/task/chat/queued-ghost-message.test.tsxapps/web/components/task/chat/queued-ghost-list.test.tsx
Inputs
- Spec sections:
What,Permissions,Scenarios. - Plan sections:
Frontend. - Patterns to mirror:
removeEntryinuse-queue.ts, the Edit/Remove ghost buttons inqueued-ghost-message.tsx,handleRemove/handleSaveinqueued-ghost-list.tsx, and the existingqueued-ghost-list.test.tsx/queued-ghost-message.test.tsxharnesses. - Verify
IconArrowMergeexists in the installed@tabler/icons-react(^3.36.1) before importing; otherwise useIconArrowsJoinor the closest merge glyph.
Risks
- Frontend code-quality limits (≤100-line functions, complexity) — keep the mergeability helpers tiny and pure.
senderKindOfis currently private inqueued-ghost-message.tsx; export the merge helpers from the same module.