Skip to content

Commit 2915e56

Browse files
authored
feat(workboard): show full boards on session dashboards (#125094)
* feat(workboard): full-board dashboard widget Adds a third trusted plugin widget kind, workboard:board, rendering the complete Kanban board (all columns, live plugin.workboard.changed refresh) inside a session dashboard. Props {boardId} scope it to one board; without it the widget shows every board, matching workboard:mini semantics. Card rendering reuses the workboard page renderColumn with an explicit surface option so page and widget cannot drift; the shared board filter moved to ui/src/lib/workboard/board-filter.ts. Mutations follow the connection's canMutate; read-only connections get a view-only board. Proof: pnpm test ui/src/lib/board ui/src/pages/workboard ui/src/lib/workboard extensions/workboard (9,494 passed), i18n baseline green, autoreview clean (codex/gpt-5.6-sol). tsgo core/ui/extensions green locally; remote check:changed blocked by Daytona capacity and the tsgo:core Daytona exit reproduced locally as a heavy-check lock race, passing on retry. * test(ui): seed workboard fixtures in the mocked dev server * fix(ci): register workboard proof capture script
1 parent a3578c7 commit 2915e56

18 files changed

Lines changed: 585 additions & 84 deletions

File tree

‎docs/plugins/workboard.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,16 @@ the template id is stored as card metadata.
363363

364364
### Session-board widgets
365365

366-
Workboard ships two native widgets for session dashboards (see
366+
Workboard ships three native widgets for session dashboards (see
367367
[Dashboards](/web/dashboards)). The agent pins them with its `dashboard` tool
368368
using `content: { kind: "plugin", pluginKind, props }`, and they render as
369369
first-party UI with live data — no sandbox frame or capability grant:
370370

371371
- `workboard:card` with `props: { cardId }` shows one card with its status
372372
control, priority, and assigned agent.
373+
- `workboard:board` with optional `props: { boardId }` shows the full Kanban
374+
board with draggable cards and status controls. Without `boardId` it shows
375+
every board; with `boardId` it shows only that board.
373376
- `workboard:mini` with optional `props: { boardId, limit }` shows per-status
374377
counts plus the top ready/running cards, and links to the full board page.
375378
Without `boardId` it aggregates every board; with `boardId` it scopes to that

‎extensions/workboard/index.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ export default definePluginEntry({
2323
description: "Dashboard workboard for agent-owned issues and sessions.",
2424
register(api) {
2525
const store = WorkboardStore.openSqlite();
26+
api.session.controls.registerControlUiDescriptor({
27+
surface: "widget",
28+
id: "board",
29+
label: "Workboard board",
30+
requiredScopes: ["operator.read"],
31+
});
2632
api.session.controls.registerControlUiDescriptor({
2733
surface: "widget",
2834
id: "card",

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,6 +1990,7 @@
19901990
"ui:i18n:report": "node --import tsx scripts/control-ui-i18n-report.ts",
19911991
"ui:i18n:sync": "node --import tsx scripts/control-ui-i18n.ts sync --write",
19921992
"ui:i18n:verify": "node --import tsx scripts/control-ui-i18n-verify.ts verify",
1993+
"ui:proof:workboard": "node --import tsx scripts/capture-workboard-ui-proof.mts",
19931994
"native:i18n:baseline": "node --import tsx scripts/native-app-i18n.ts baseline --write",
19941995
"native:i18n:check": "node --import tsx scripts/native-app-i18n.ts check",
19951996
"native:i18n:sync": "node --import tsx scripts/native-app-i18n.ts sync --write",
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/usr/bin/env node
2+
import { mkdir } from "node:fs/promises";
3+
import path from "node:path";
4+
import { chromium } from "playwright";
5+
import {
6+
canRunPlaywrightChromium,
7+
resolvePlaywrightChromiumExecutablePath,
8+
} from "../ui/src/test-helpers/control-ui-e2e.ts";
9+
10+
const DEFAULT_BASE_URL = "http://127.0.0.1:5187";
11+
const DEFAULT_OUTPUT_DIR = path.resolve(".artifacts/control-ui-e2e/workboard-proof");
12+
const WORKBOARD_SESSION_KEY = "agent:main:workboard-proof";
13+
14+
function readOption(name: string): string | undefined {
15+
const prefix = `--${name}=`;
16+
const inline = process.argv.slice(2).find((arg) => arg.startsWith(prefix));
17+
if (inline) {
18+
return inline.slice(prefix.length);
19+
}
20+
const index = process.argv.indexOf(`--${name}`);
21+
return index >= 0 ? process.argv[index + 1] : undefined;
22+
}
23+
24+
const baseUrl = new URL(readOption("base-url") ?? DEFAULT_BASE_URL);
25+
const outputDir = path.resolve(readOption("output-dir") ?? DEFAULT_OUTPUT_DIR);
26+
const executablePath = resolvePlaywrightChromiumExecutablePath(chromium.executablePath());
27+
if (!canRunPlaywrightChromium(executablePath)) {
28+
throw new Error(`Playwright Chromium is unavailable at ${executablePath}`);
29+
}
30+
31+
await mkdir(outputDir, { recursive: true });
32+
const browser = await chromium.launch({ executablePath });
33+
const context = await browser.newContext({
34+
colorScheme: "light",
35+
reducedMotion: "reduce",
36+
viewport: { width: 1440, height: 900 },
37+
});
38+
const page = await context.newPage();
39+
page.setDefaultTimeout(30_000);
40+
41+
const gatewayUrl = new URL(baseUrl);
42+
gatewayUrl.protocol = gatewayUrl.protocol === "https:" ? "wss:" : "ws:";
43+
const settingsKey = `openclaw.control.settings.v1:${gatewayUrl.origin}`;
44+
await page.addInitScript(
45+
({ key, sessionKey }) => {
46+
localStorage.setItem(
47+
key,
48+
JSON.stringify({
49+
boardSessionViews: { [sessionKey]: { activeTabId: "main" } },
50+
theme: "light",
51+
}),
52+
);
53+
},
54+
{ key: settingsKey, sessionKey: WORKBOARD_SESSION_KEY },
55+
);
56+
57+
try {
58+
await page.goto(new URL("/workboard/peter-tasks", baseUrl).toString());
59+
const automationChip = page.locator(".workboard-automation-chip");
60+
await automationChip.waitFor();
61+
if ((await automationChip.textContent())?.trim() !== "Automation") {
62+
throw new Error("Workboard automation chip did not render its expected label");
63+
}
64+
await page.getByText("Prepare launch readiness checklist", { exact: true }).waitFor();
65+
await page.screenshot({
66+
animations: "disabled",
67+
path: path.join(outputDir, "workboard-chip.png"),
68+
});
69+
70+
await page.goto(new URL("/dashboard", baseUrl).toString());
71+
const widget = page.locator('[data-test-id="workboard-board-widget"]');
72+
await widget.waitFor();
73+
await page.getByText("Validate onboarding flow", { exact: true }).waitFor();
74+
await page.getByText("Review accessibility audit", { exact: true }).waitFor();
75+
await page.locator(".board-session-surface--dock-hidden").waitFor();
76+
const columnCount = await widget.locator(".workboard-column").count();
77+
if (columnCount !== 6) {
78+
throw new Error(`Expected 6 Workboard columns, received ${columnCount}`);
79+
}
80+
await page.screenshot({
81+
animations: "disabled",
82+
path: path.join(outputDir, "workboard-widget.png"),
83+
});
84+
} finally {
85+
await context.close();
86+
await browser.close();
87+
}
88+
89+
console.log(`[workboard-ui-proof] ${outputDir}`);

‎scripts/control-ui-mock-dev.ts‎

Lines changed: 117 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { buildSkillWorkshopMocks } from "./control-ui-mock-skill-workshop.js";
3939

4040
type CliOptions = {
4141
allowedHosts: string[];
42-
fixture?: "approval" | "board" | "swarm";
42+
fixture?: "approval" | "board" | "swarm" | "workboard";
4343
host: string;
4444
port: number;
4545
};
@@ -161,7 +161,7 @@ function parseFixture(value: string | undefined): CliOptions["fixture"] {
161161
if (!value) {
162162
return undefined;
163163
}
164-
if (value !== "approval" && value !== "board" && value !== "swarm") {
164+
if (value !== "approval" && value !== "board" && value !== "swarm" && value !== "workboard") {
165165
throw new Error(`Unknown Control UI mock fixture: ${value}`);
166166
}
167167
return value;
@@ -645,7 +645,7 @@ function buildProfileUsageMocks(baseTime: number) {
645645
* across a few real section keys, and `config.get` returns a matching
646646
* snapshot with the hash `config.set`/`config.apply` are guarded by.
647647
*/
648-
function buildConfigMocks(options: { swarmEnabled?: boolean } = {}) {
648+
function buildConfigMocks(options: { swarmEnabled?: boolean; workboardEnabled?: boolean } = {}) {
649649
const config = {
650650
logging: { level: "info", consoleTimestamps: true },
651651
messages: { queueLimit: 5, responsePrefix: "" },
@@ -654,6 +654,7 @@ function buildConfigMocks(options: { swarmEnabled?: boolean } = {}) {
654654
commands: { native: "auto", nativeSkills: "auto" },
655655
models: { mode: "merge" },
656656
...(options.swarmEnabled ? { tools: { swarm: true } } : {}),
657+
...(options.workboardEnabled ? { plugins: { entries: { workboard: { enabled: true } } } } : {}),
657658
channels: {
658659
whatsapp: {
659660
enabled: true,
@@ -898,6 +899,86 @@ function buildConfigMocks(options: { swarmEnabled?: boolean } = {}) {
898899
};
899900
}
900901

902+
function buildWorkboardMocks(baseTime: number) {
903+
const boardId = "peter-tasks";
904+
const card = (
905+
id: string,
906+
title: string,
907+
status: string,
908+
priority: string,
909+
position: number,
910+
labels: string[],
911+
) => ({
912+
id,
913+
title,
914+
status,
915+
priority,
916+
labels,
917+
position,
918+
createdAt: baseTime - 86_400_000,
919+
updatedAt: baseTime - position * 1_000,
920+
metadata: { automation: { boardId } },
921+
});
922+
const cards = [
923+
card("card-inbox", "Capture customer feedback themes", "todo", "normal", 1, ["research"]),
924+
card("card-brief", "Draft weekly product brief", "todo", "low", 2, ["writing"]),
925+
card("card-ready", "Prepare launch readiness checklist", "ready", "high", 1, ["launch"]),
926+
card("card-running", "Validate onboarding flow", "running", "urgent", 1, ["quality"]),
927+
card("card-review", "Review accessibility audit", "review", "high", 1, ["frontend"]),
928+
card("card-blocked", "Confirm staging environment access", "blocked", "normal", 1, ["ops"]),
929+
card("card-done", "Publish support handoff notes", "done", "low", 1, ["docs"]),
930+
];
931+
const statuses = ["todo", "ready", "running", "review", "blocked", "done"];
932+
const board = {
933+
id: boardId,
934+
name: "Product Operations",
935+
description: "Shared product delivery queue",
936+
icon: "✓",
937+
color: "#2563eb",
938+
automationJobId: "job-product-operations-daily",
939+
total: cards.length,
940+
active: cards.length - 1,
941+
archived: 0,
942+
byStatus: Object.fromEntries(
943+
statuses.map((status) => [status, cards.filter((entry) => entry.status === status).length]),
944+
),
945+
updatedAt: baseTime,
946+
};
947+
const sessionKey = "agent:main:workboard-proof";
948+
return {
949+
board,
950+
cards,
951+
sessionKey,
952+
methodResponses: {
953+
"board.get": {
954+
sessionKey,
955+
revision: 1,
956+
tabs: [{ tabId: "main", title: "Workboard", position: 0, chatDock: "hidden" }],
957+
widgets: [
958+
{
959+
name: "workboard-product-operations",
960+
tabId: "main",
961+
title: "Product Operations",
962+
contentKind: "plugin",
963+
pluginKind: "workboard:board",
964+
props: { boardId },
965+
heightMode: "fixed",
966+
sizeW: 12,
967+
sizeH: 16,
968+
position: 0,
969+
grantState: "none",
970+
revision: 1,
971+
},
972+
],
973+
},
974+
"workboard.boards.list": { boards: [board] },
975+
"workboard.cards.list": { boards: [board], cards, statuses },
976+
"workboard.cards.stats": { ...board, byAgent: {} },
977+
"workboard.cards.move": { card: cards[0] },
978+
},
979+
};
980+
}
981+
901982
function chatHistoryMessage(role: "assistant" | "user", text: string, timestamp: number) {
902983
return {
903984
content: [{ text, type: "text" }],
@@ -1294,7 +1375,16 @@ async function createChatPickerScenario(
12941375
}),
12951376
]
12961377
: [];
1378+
const workboardMocks = buildWorkboardMocks(baseTime);
12971379
const sessions = [
1380+
...(fixture === "workboard"
1381+
? [
1382+
sessionRow(workboardMocks.sessionKey, "Product operations dashboard", baseTime, {
1383+
boardFace: "dashboard",
1384+
pinned: true,
1385+
}),
1386+
]
1387+
: []),
12981388
sessionRow("agent:main:main", "Molty", baseTime - 1_000, {
12991389
activeRunIds: [PLAN_DEMO_RUN_ID],
13001390
childSessions: ["agent:main:lisbon-trip", ...swarmChildRows.map((row) => row.key)],
@@ -1421,7 +1511,10 @@ async function createChatPickerScenario(
14211511
const skillWorkshop = buildSkillWorkshopMocks(Date.now());
14221512
const cronMocks = buildCronMocks(Date.now());
14231513
const channelWizard = buildChannelWizardMocks();
1424-
const configMocks = buildConfigMocks({ swarmEnabled: fixture === "swarm" });
1514+
const configMocks = buildConfigMocks({
1515+
swarmEnabled: fixture === "swarm",
1516+
workboardEnabled: fixture === "workboard",
1517+
});
14251518
const custodianHistory = {
14261519
turns: [
14271520
{
@@ -1502,7 +1595,25 @@ async function createChatPickerScenario(
15021595
"sessions.create",
15031596
"system.info",
15041597
"terminal.open",
1598+
...(fixture === "workboard"
1599+
? [
1600+
"board.get",
1601+
"workboard.boards.list",
1602+
"workboard.cards.list",
1603+
"workboard.cards.move",
1604+
"workboard.cards.stats",
1605+
]
1606+
: []),
15051607
],
1608+
...(fixture === "workboard"
1609+
? {
1610+
controlUiWidgetKinds: [
1611+
{ pluginId: "workboard", kind: "workboard:board", label: "Workboard board" },
1612+
{ pluginId: "workboard", kind: "workboard:card", label: "Workboard card" },
1613+
{ pluginId: "workboard", kind: "workboard:mini", label: "Workboard summary" },
1614+
],
1615+
}
1616+
: {}),
15061617
// Terminal has a second gate beyond the advertised method (see
15071618
// ui/src/lib/terminal-availability.ts).
15081619
terminalEnabled: true,
@@ -2268,6 +2379,7 @@ async function createChatPickerScenario(
22682379
...buildSessionListCases([...sessions, ...archivedSessions], {}, MOCK_SESSION_CREATORS),
22692380
],
22702381
},
2382+
...(fixture === "workboard" ? workboardMocks.methodResponses : {}),
22712383
},
22722384
models: modelProviders.models,
22732385
repeatingSessionEvents: {
@@ -2339,7 +2451,7 @@ async function createChatPickerScenario(
23392451
hasActiveRun: true,
23402452
key: "agent:main:main",
23412453
},
2342-
sessionKey: "agent:main:main",
2454+
sessionKey: fixture === "workboard" ? workboardMocks.sessionKey : "agent:main:main",
23432455
workspace: "/Users/peter/Projects/openclaw",
23442456
workspaceGit: true,
23452457
};

‎src/agents/tools/dashboard-tool.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ const DashboardToolSchema = Type.Object(
7272
pluginKind: Type.Optional(
7373
Type.String({
7474
pattern: BOARD_PLUGIN_KIND_PATTERN,
75-
description: "Plugin widget kind, for example workboard:card or workboard:mini",
75+
description:
76+
"Plugin widget kind, for example workboard:card, workboard:mini, or workboard:board",
7677
}),
7778
),
7879
props: Type.Optional(
@@ -256,7 +257,7 @@ export function createDashboardTool(opts: DashboardToolOptions = {}): AnyAgentTo
256257
label: "Dashboard",
257258
name: "dashboard",
258259
description:
259-
"Read and arrange this session dashboard: read snapshot; tab_create/tab_update/tab_delete/tabs_reorder; widget_put/widget_move/widget_resize/widget_remove; focus_tab; set_chat_dock moves or hides the chat dock (left/right/bottom/hidden). Widgets use stable names. Create trusted plugin widgets with widget_put; examples: workboard:card props {cardId}, workboard:mini props {boardId, limit}. Sizes: sm=3x3, md=6x4, lg=8x6, xl=12x8, full=12x8 single-widget emphasis.",
260+
"Read and arrange this session dashboard: read snapshot; tab_create/tab_update/tab_delete/tabs_reorder; widget_put/widget_move/widget_resize/widget_remove; focus_tab; set_chat_dock moves or hides the chat dock (left/right/bottom/hidden). Widgets use stable names. Create trusted plugin widgets with widget_put; examples: workboard:card props {cardId}, workboard:mini props {boardId, limit}, workboard:board props {boardId}. Sizes: sm=3x3, md=6x4, lg=8x6, xl=12x8, full=12x8 single-widget emphasis.",
260261
parameters: DashboardToolSchema,
261262
execute: async (_toolCallId, rawArgs) => {
262263
const params = rawArgs as Record<string, unknown>;

‎ui/src/i18n/locales/en.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3600,6 +3600,7 @@ export const en: TranslationMap = {
36003600
},
36013601
workboard: {
36023602
widget: {
3603+
boardLabel: "Workboard board",
36033604
cardLabel: "Workboard card",
36043605
summaryLabel: "Workboard summary",
36053606
loading: "Loading Workboard…",
@@ -3608,6 +3609,7 @@ export const en: TranslationMap = {
36083609
unassigned: "Unassigned",
36093610
openBoard: "Open board",
36103611
statusCounts: "Cards by status",
3612+
cardCount: "{count} cards",
36113613
noActiveCards: "No ready or running cards.",
36123614
},
36133615
disabledHelpStart: "Workboard is disabled. Enable",

‎ui/src/lib/board/widgets/index.test.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ import {
88

99
describe("plugin board widget registry", () => {
1010
it("resolves only advertised first-party kinds", () => {
11-
const active = [{ pluginId: "workboard", kind: "workboard:card", label: "Workboard card" }];
11+
const active = [
12+
{ pluginId: "workboard", kind: "workboard:board", label: "Workboard board" },
13+
{ pluginId: "workboard", kind: "workboard:card", label: "Workboard card" },
14+
];
15+
expect(getPluginWidgetKindContribution("workboard:board", active)).toMatchObject({
16+
kind: "workboard:board",
17+
label: "Workboard board",
18+
loader: expect.any(Function),
19+
});
1220
expect(getPluginWidgetKindContribution("workboard:card", active)).toMatchObject({
1321
kind: "workboard:card",
1422
label: "Workboard card",

‎ui/src/lib/board/widgets/index.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ type PluginWidgetKindContribution = {
2323
* props, and use the standard gateway client for RPCs owned by their plugin.
2424
*/
2525
const PLUGIN_WIDGET_KIND_CONTRIBUTIONS: Record<string, PluginWidgetKindContribution> = {
26+
"workboard:board": {
27+
kind: "workboard:board",
28+
label: t("workboard.widget.boardLabel"),
29+
loader: async () => (await import("./workboard-board.ts")).renderWorkboardBoardWidget,
30+
},
2631
"workboard:card": {
2732
kind: "workboard:card",
2833
label: t("workboard.widget.cardLabel"),

0 commit comments

Comments
 (0)