feat(kanban): Interactive Kanban board with real-time task tracking (#83)
* feat(kanban): add Kanban board with task-manager skill, modal UI, and desk clutter Implement a full Kanban board system for tracking agent tasks: - Add task-manager skill with shared JSON task store for persistence - Render board as a floating modal over the live 3D office (not immersive) - Auto-create tasks from actionable user messages with heuristic filtering - Sync task status through OpenClaw agent lifecycle events - Collapse task details panel by default, expand on card click - Add dynamic desk clutter (papers, folders, etc.) reflecting active task count - Exclude done tasks from desk clutter count - Extract KANBAN_CLUTTER_OFFSET for easy positioning adjustment - Add install flow with progress bar for the task-manager skill - Include unit and e2e test coverage Made-with: Cursor * feat(kanban): production-harden task board with AI-free classification, resilient persistence, and modal UX - Harden shared task store with atomic writes, payload size limits, and server-side enum validation - Add client resilience: request timeouts (AbortController), exponential backoff retries, poll deduplication - Implement optimistic UI with rollback on all card mutations (update, move, archive) - Add modal accessibility: focus trap, Escape to close, aria-modal, keyboard card navigation - Trust OpenClaw agent lifecycle phase=start as task classification signal instead of regex heuristics - Keep regex heuristic only as lightweight filter for direct chat events (conversational noise) - Expand verb recognition with typo tolerance and broader action vocabulary - Create tasks from agent runs even when no chat event is received (external channel support) - Merge dual header bars into single bar; reposition close button outside modal corner - Exclude done tasks from desk clutter count; make clutter position configurable via KANBAN_CLUTTER_OFFSET - Update default furniture layout to match user configuration - Ensure kanban_board furniture persists in local storage across sessions - Add comprehensive test coverage for store, API route, and controller logic Made-with: Cursor --------- Co-authored-by: iamlukethedev <lucas.guilherme@smartwayslfl.com>
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { GatewayClient } from "@/lib/gateway/GatewayClient";
|
||||
import { GatewayResponseError } from "@/lib/gateway/errors";
|
||||
import {
|
||||
createGatewayTask,
|
||||
deleteGatewayTask,
|
||||
isUnsupportedTaskGatewayError,
|
||||
listGatewayTasks,
|
||||
updateGatewayTask,
|
||||
} from "@/lib/tasks/gateway";
|
||||
|
||||
describe("task gateway client", () => {
|
||||
it("lists tasks via tasks.list", async () => {
|
||||
const client = {
|
||||
call: vi.fn(async () => ({ tasks: [] })),
|
||||
} as unknown as GatewayClient;
|
||||
|
||||
await listGatewayTasks(client);
|
||||
|
||||
expect(client.call).toHaveBeenCalledWith("tasks.list", { includeArchived: true });
|
||||
});
|
||||
|
||||
it("creates tasks via tasks.create", async () => {
|
||||
const client = {
|
||||
call: vi.fn(async () => ({ id: "task-1", title: "Ship board", status: "todo" })),
|
||||
} as unknown as GatewayClient;
|
||||
|
||||
await createGatewayTask(client, {
|
||||
title: "Ship board",
|
||||
description: "Release the board.",
|
||||
status: "todo",
|
||||
source: "claw3d_manual",
|
||||
});
|
||||
|
||||
expect(client.call).toHaveBeenCalledWith(
|
||||
"tasks.create",
|
||||
expect.objectContaining({
|
||||
title: "Ship board",
|
||||
description: "Release the board.",
|
||||
status: "todo",
|
||||
source: "claw3d_manual",
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it("updates and deletes tasks via gateway methods", async () => {
|
||||
const client = {
|
||||
call: vi.fn(async () => ({ ok: true })),
|
||||
} as unknown as GatewayClient;
|
||||
|
||||
await updateGatewayTask(client, "task-1", { status: "review" });
|
||||
await deleteGatewayTask(client, "task-1");
|
||||
|
||||
expect(client.call).toHaveBeenCalledWith(
|
||||
"tasks.update",
|
||||
expect.objectContaining({ id: "task-1", status: "review" })
|
||||
);
|
||||
expect(client.call).toHaveBeenCalledWith("tasks.delete", { id: "task-1" });
|
||||
});
|
||||
|
||||
it("detects unsupported task gateway methods", () => {
|
||||
expect(
|
||||
isUnsupportedTaskGatewayError(
|
||||
new GatewayResponseError({
|
||||
code: "METHOD_NOT_FOUND",
|
||||
message: "Unknown method tasks.list",
|
||||
})
|
||||
)
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user