Files
openclaw/scripts/control-ui-mock-plugins.ts
Peter Steinberger e3c5821d98 feat(ui): redesign Channels page with guided channel setup wizard (#106469)
* feat(ui): redesign Channels page with guided channel setup wizard

Adds wizard.start flow=channels gateway RPC (additive protocol change) that
drives the shared channel-setup wizard (openclaw channels add) over the
session step protocol. Control UI Channels page becomes a card hub with
plugin-art covers, guided per-channel setup modal (WhatsApp QR pairing via
web.login.*, BotFather/Slack/Discord helper links), and a detail overlay
hosting the full schema config form.

* test(ui): cover channel wizard controller; refresh channels view test props

* chore(mock): use non-token-shaped wizard placeholder

* test(gateway): scanner-safe auth local in channels wizard test

* fix(ui): cancel gateway wizard session on channels page disconnect

* fix(ui): adopt browse-all channel pick and guard dirty config before setup

* fix(ui): cancel gateway session created by a stale wizard.start

* fix(ui): adopt multiselect channel picks; drop redundant String()

* fix(ui): track all wizard-adopted channels so WhatsApp QR runs regardless of pick order

* feat(gateway): report configured channels on terminal channel-wizard result

Replaces the Control UI's channel-adoption heuristic with the authoritative
outcome: the channels flow reports its actual selection after config commit,
the wizard session surfaces it as an additive channels field on the terminal
wizard.next result, and the UI keys WhatsApp QR linking off that.

* refactor(ui): align channels hub with the unified settings design language

Hub becomes settings-language rows (44px art tiles, status dots, uppercase
section headings, hairline groups) instead of a card gallery; the detail
overlay hosts the migrated per-channel settings sections with Run setup in
the header. Wizard dialog and tile/cover styles move to spacing tokens.

* chore(i18n): translate channels hub/setup strings; refresh raw-copy baseline

* refactor: satisfy LOC ratchet and dead-export gates

Split mock-dev channel/plugin fixtures into their own modules, move wizard
runner types/defaults to server-methods/wizard.ts, extract the channels page
wizard host and nostr profile HTTP ops, and unexport internal-only types
(incl. the unused config-form SECTION_META barrel re-export).

* chore(i18n): retranslate channels strings on rebased locale bundles

* fix(test): drop redundant String() in channels wizard e2e

* fix: address channel-wizard review findings

- lock wizard cancellation before durable installs/config writes
- report configured channel accounts on the terminal wizard result and
  start WhatsApp QR pairing for that account (web.login accountId)
- forward request options through the browser gateway client so wizard
  RPC timeouts apply
- render skipped setup as a no-change completion
- keep detail/advanced config reachable for unconfigured channels
- surface the dirty-config warning inside the detail overlay
- adopt the picked channel for wizard title/links in browse-all flows

* fix(ui): local wizard RPC timeout; translate no-change completion strings
2026-07-13 11:49:42 -07:00

68 lines
1.8 KiB
TypeScript

// Plugin-catalog fixtures for the Control UI mock dev harness.
export function buildPluginCatalogMock() {
const entry = (params: {
id: string;
name: string;
description: string;
category: string;
installed: boolean;
enabled?: boolean;
featured?: boolean;
}) => ({
id: params.id,
name: params.name,
description: params.description,
version: "1.4.0",
installed: params.installed,
enabled: params.installed && (params.enabled ?? true),
state: params.installed ? ((params.enabled ?? true) ? "enabled" : "disabled") : "not-installed",
category: params.category,
featured: params.featured ?? false,
removable: params.installed,
});
return {
plugins: [
entry({
id: "telegram",
name: "Telegram",
description: "Chat with your agent from Telegram DMs and groups.",
category: "channel",
installed: true,
}),
entry({
id: "discord",
name: "Discord",
description: "Bridge agents into Discord servers and DMs.",
category: "channel",
installed: true,
enabled: false,
}),
entry({
id: "memory-wiki",
name: "Memory Wiki",
description: "Long-term wiki-style memory for people and projects.",
category: "memory",
installed: true,
}),
entry({
id: "browser",
name: "Browser",
description: "Drive a managed browser profile for research and automation.",
category: "tool",
installed: false,
featured: true,
}),
entry({
id: "canvas",
name: "Canvas",
description: "Generate and preview visual artifacts from sessions.",
category: "tool",
installed: false,
}),
],
diagnostics: [],
mutationAllowed: true,
};
}