Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

feat(ui): reuse wizard *Config in /settings/platforms with collapse-by-default

cyhebf7f79b075b
diff --git a/ui/src/components/RemoteAccess.tsx b/ui/src/components/RemoteAccess.tsx
index 468c0d42b..e412a779d 100644
--- a/ui/src/components/RemoteAccess.tsx
+++ b/ui/src/components/RemoteAccess.tsx
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { AlertTriangle, CheckCircle2, ExternalLink, KeyRound, Link2, Power, RefreshCcw, ShieldCheck } from 'lucide-react';
-import { useTranslation } from 'react-i18next';
+import { Trans, useTranslation } from 'react-i18next';
import { useApi } from '../context/ApiContext';
import { useToast } from '../context/ToastContext';
@@ -124,9 +124,28 @@ export const RemoteAccess: React.FC<{ embedded?: boolean }> = ({ embedded = fals
return (
<section className="overflow-hidden rounded-md border border-border bg-surface-2/45">
<div className="flex items-start justify-between gap-4 border-b border-border px-4 py-3">
- <div className="min-w-0 space-y-1">
+ <div className="min-w-0 space-y-2">
<h2 className="text-[13px] font-semibold text-foreground">{t('remoteAccess.title')}</h2>
- <p className="max-w-2xl text-[11px] leading-relaxed text-muted">{t('remoteAccess.subtitle')}</p>
+ <p className="max-w-2xl text-[11px] leading-relaxed text-muted">
+ <Trans
+ i18nKey="remoteAccess.subtitleWithLink"
+ components={{
+ cloud: (
+ <a
+ href={VIBE_CLOUD_URL}
+ target="_blank"
+ rel="noreferrer"
+ className="inline-flex items-center gap-0.5 font-medium text-cyan hover:underline"
+ />
+ ),
+ }}
+ />
+ </p>
+ <ol className="ml-4 list-decimal space-y-1 text-[11px] leading-relaxed text-muted">
+ <li>{t('remoteAccess.flowStep1')}</li>
+ <li>{t('remoteAccess.flowStep2')}</li>
+ <li>{t('remoteAccess.flowStep3')}</li>
+ </ol>
</div>
<button
className="inline-flex h-8 shrink-0 items-center gap-2 whitespace-nowrap rounded-md border border-border bg-surface-3 px-3 text-[12px] text-foreground transition hover:border-border-strong"
@@ -199,7 +218,18 @@ export const RemoteAccess: React.FC<{ embedded?: boolean }> = ({ embedded = fals
<CheckCircle2 className="size-3.5" />
{t('remoteAccess.configuredBadge')}
</div>
- {publicUrl && <div className="mt-1 truncate font-mono text-[11px] text-muted">{publicUrl}</div>}
+ {publicUrl && (
+ <a
+ href={publicUrl}
+ target="_blank"
+ rel="noreferrer"
+ className="mt-1 inline-flex max-w-full items-center gap-1 truncate font-mono text-[11px] text-cyan hover:underline"
+ title={publicUrl}
+ >
+ <span className="truncate">{publicUrl}</span>
+ <ExternalLink className="size-3 shrink-0" />
+ </a>
+ )}
</div>
<div className="flex gap-2">
<button
diff --git a/ui/src/components/settings/SettingsPlatformsPage.tsx b/ui/src/components/settings/SettingsPlatformsPage.tsx
index 4b93fcc34..1108ec71e 100644
--- a/ui/src/components/settings/SettingsPlatformsPage.tsx
+++ b/ui/src/components/settings/SettingsPlatformsPage.tsx
@@ -1,38 +1,340 @@
-import React, { useEffect, useState } from 'react';
+import React, { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
+import clsx from 'clsx';
+import { Check, ChevronUp, Pencil, RefreshCw } from 'lucide-react';
-import { PlatformSelection } from '@/components/steps/PlatformSelection';
import { useApi } from '@/context/ApiContext';
import { useToast } from '@/context/ToastContext';
+import { getEnabledPlatforms, getPlatformCatalog, getPrimaryPlatform, platformHasCredentials } from '@/lib/platforms';
+import { PlatformIcon } from '@/components/visual';
+import { SlackConfig } from '@/components/steps/SlackConfig';
+import { DiscordConfig } from '@/components/steps/DiscordConfig';
+import { TelegramConfig } from '@/components/steps/TelegramConfig';
+import { LarkConfig } from '@/components/steps/LarkConfig';
+import { WeChatConfig } from '@/components/steps/WeChatConfig';
import { SettingsPageShell } from './SettingsPageShell';
+const PLATFORM_TILE_STYLES: Record<string, { bg: string; border: string }> = {
+ slack: { bg: 'bg-[#4A154B26]', border: 'border-[#4A154B66]' },
+ discord: { bg: 'bg-[#5865F226]', border: 'border-[#5865F255]' },
+ telegram: { bg: 'bg-[#0088CC26]', border: 'border-[#0088CC55]' },
+ lark: { bg: 'bg-[#06A0FB1F]', border: 'border-[#06A0FB55]' },
+ feishu: { bg: 'bg-[#06A0FB1F]', border: 'border-[#06A0FB55]' },
+ wechat: { bg: 'bg-[#07C16026]', border: 'border-[#07C16055]' },
+};
+
+type ExpandedKey = string | null; // 'enabled' | platform id | null
+
export const SettingsPlatformsPage: React.FC = () => {
const { t } = useTranslation();
const api = useApi();
const { showToast } = useToast();
const [config, setConfig] = useState<any>(null);
+ const [expanded, setExpanded] = useState<ExpandedKey>(null);
+ const [draftEnabled, setDraftEnabled] = useState<string[]>([]);
+ const [draftPrimary, setDraftPrimary] = useState<string>('');
+ const [savingEnabled, setSavingEnabled] = useState(false);
useEffect(() => {
api.getConfig().then(setConfig).catch(() => {});
}, [api]);
- const handleSave = async (nextData: any) => {
+ const platformCatalog = useMemo(() => (config ? getPlatformCatalog(config) : []), [config]);
+ const enabledPlatforms = useMemo(() => (config ? getEnabledPlatforms(config) : []), [config]);
+ const primary = useMemo(() => (config ? getPrimaryPlatform(config) : ''), [config]);
+
+ const toggle = (key: string) => {
+ setExpanded((prev) => (prev === key ? null : key));
+ if (key === 'enabled') {
+ setDraftEnabled(enabledPlatforms);
+ setDraftPrimary(primary);
+ }
+ };
+
+ const closeAll = () => setExpanded(null);
+
+ const handleApplyPlatform = async (nextData: any) => {
await api.saveConfig(nextData);
setConfig((prev: any) => ({ ...(prev || {}), ...nextData }));
showToast(t('common.saved'), 'success');
+ closeAll();
};
+ const toggleDraftPlatform = (id: string) => {
+ setDraftEnabled((prev) => {
+ if (prev.includes(id)) {
+ const next = prev.filter((p) => p !== id);
+ if (next.length && draftPrimary === id) setDraftPrimary(next[0]);
+ return next.length ? next : prev;
+ }
+ const next = [...prev, id];
+ if (!prev.length) setDraftPrimary(id);
+ return next;
+ });
+ };
+
+ const applyEnabled = async () => {
+ if (!draftEnabled.length) return;
+ const resolvedPrimary = draftEnabled.includes(draftPrimary) ? draftPrimary : draftEnabled[0];
+ const nextData = {
+ ...config,
+ platform: resolvedPrimary,
+ platforms: { enabled: draftEnabled, primary: resolvedPrimary },
+ };
+ setSavingEnabled(true);
+ try {
+ await api.saveConfig(nextData);
+ setConfig((prev: any) => ({ ...(prev || {}), ...nextData }));
+ showToast(t('common.saved'), 'success');
+ closeAll();
+ } finally {
+ setSavingEnabled(false);
+ }
+ };
+
+ if (!config) {
+ return (
+ <SettingsPageShell
+ activeTab="platforms"
+ title={t('settings.platformsTitle')}
+ subtitle={t('settings.platformsSubtitle')}
+ >
+ <div className="text-sm text-muted">{t('common.loading')}</div>
+ </SettingsPageShell>
+ );
+ }
+
return (
<SettingsPageShell
activeTab="platforms"
title={t('settings.platformsTitle')}
subtitle={t('settings.platformsSubtitle')}
>
- {config ? (
- <PlatformSelection data={config} onNext={() => {}} isPage onSave={handleSave} />
- ) : (
- <div className="text-sm text-muted">{t('common.loading')}</div>
- )}
+ <div className="mx-auto flex w-full max-w-[920px] flex-col gap-3">
+ {/* Enabled platforms card */}
+ <CollapseCard
+ expanded={expanded === 'enabled'}
+ onToggle={() => toggle('enabled')}
+ header={
+ <div className="flex min-w-0 flex-1 items-center justify-between gap-3">
+ <div className="min-w-0">
+ <div className="text-[14px] font-semibold text-foreground">{t('platform.enabledPlatforms')}</div>
+ <div className="mt-1 flex flex-wrap items-center gap-1.5">
+ {enabledPlatforms.map((id) => {
+ const descriptor = platformCatalog.find((p) => p.id === id);
+ const tile = PLATFORM_TILE_STYLES[id] || { bg: 'bg-white/[0.04]', border: 'border-white/[0.10]' };
+ return (
+ <span
+ key={id}
+ className={clsx(
+ 'inline-flex items-center gap-1.5 rounded-md border px-2 py-0.5 text-[11px] font-medium text-foreground',
+ tile.bg,
+ tile.border
+ )}
+ >
+ <PlatformIcon platform={id as any} size={12} />
+ {t(descriptor?.title_key || `platform.${id}.title`)}
+ {id === primary && (
+ <span className="rounded bg-mint/20 px-1 text-[9px] font-bold uppercase tracking-wide text-mint">
+ {t('platform.primary')}
+ </span>
+ )}
+ </span>
+ );
+ })}
+ </div>
+ </div>
+ </div>
+ }
+ >
+ <div className="space-y-4 px-5 py-4">
+ <p className="text-[12px] leading-relaxed text-muted">{t('platform.subtitle')}</p>
+
+ <div className="grid grid-cols-2 gap-2.5 md:grid-cols-3 lg:grid-cols-5">
+ {platformCatalog.map((platform) => {
+ const id = platform.id;
+ const active = draftEnabled.includes(id);
+ const tile = PLATFORM_TILE_STYLES[id] || { bg: 'bg-white/[0.04]', border: 'border-white/[0.10]' };
+ return (
+ <button
+ key={id}
+ type="button"
+ onClick={() => toggleDraftPlatform(id)}
+ className={clsx(
+ 'flex flex-col items-center gap-2 rounded-xl px-3 py-3.5 transition-colors',
+ active
+ ? 'border-2 border-mint bg-mint/[0.16]'
+ : 'border border-white/[0.08] bg-background hover:border-white/[0.16] hover:bg-white/[0.02]'
+ )}
+ >
+ <span
+ className={clsx(
+ 'inline-flex size-9 items-center justify-center rounded-[10px] border',
+ tile.bg,
+ tile.border
+ )}
+ >
+ <PlatformIcon platform={id as any} size={18} />
+ </span>
+ <span
+ className={clsx(
+ 'text-[12px] leading-tight transition-colors',
+ active ? 'font-bold text-foreground' : 'font-medium text-muted'
+ )}
+ >
+ {t(platform.title_key || `platform.${id}.title`)}
+ </span>
+ </button>
+ );
+ })}
+ </div>
+
+ <div className="flex items-center justify-end gap-2 border-t border-border pt-3">
+ <button
+ type="button"
+ onClick={closeAll}
+ disabled={savingEnabled}
+ className="inline-flex items-center gap-1.5 rounded-lg border border-border bg-white/[0.04] px-3 py-1.5 text-[12px] font-medium text-foreground transition hover:border-border-strong disabled:opacity-50"
+ >
+ {t('common.cancel')}
+ </button>
+ <button
+ type="button"
+ onClick={() => void applyEnabled()}
+ disabled={!draftEnabled.length || savingEnabled}
+ className="inline-flex items-center gap-1.5 rounded-lg bg-mint px-3.5 py-1.5 text-[12px] font-bold text-[#080812] shadow-[0_0_24px_-6px_rgba(91,255,160,0.6)] transition hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-50 disabled:shadow-none"
+ >
+ {savingEnabled ? <RefreshCw size={12} className="animate-spin" /> : <Check size={12} />}
+ {t('platform.apply')}
+ </button>
+ </div>
+ </div>
+ </CollapseCard>
+
+ {/* One card per enabled platform */}
+ {enabledPlatforms.map((id) => {
+ const descriptor = platformCatalog.find((p) => p.id === id);
+ const label = t(descriptor?.title_key || `platform.${id}.title`);
+ const description = t(descriptor?.description_key || `platform.${id}.desc`);
+ const tile = PLATFORM_TILE_STYLES[id] || { bg: 'bg-white/[0.04]', border: 'border-white/[0.10]' };
+ const configured = platformHasCredentials(config, id);
+ return (
+ <CollapseCard
+ key={id}
+ expanded={expanded === id}
+ onToggle={() => toggle(id)}
+ header={
+ <div className="flex min-w-0 flex-1 items-center gap-3">
+ <span
+ className={clsx(
+ 'inline-flex size-9 shrink-0 items-center justify-center rounded-[10px] border',
+ tile.bg,
+ tile.border
+ )}
+ >
+ <PlatformIcon platform={id as any} size={18} />
+ </span>
+ <div className="min-w-0 flex-1">
+ <div className="flex items-center gap-2">
+ <span className="text-[14px] font-semibold text-foreground">{label}</span>
+ {configured ? (
+ <span className="inline-flex items-center gap-1 rounded border border-mint/30 bg-mint/[0.08] px-1.5 py-0.5 text-[10px] font-medium text-mint">
+ <Check size={10} />
+ {t('platform.validationSuccess')}
+ </span>
+ ) : (
+ <span className="inline-flex items-center gap-1 rounded border border-gold/30 bg-gold/10 px-1.5 py-0.5 text-[10px] font-medium text-gold">
+ {t('platform.stepAddBotToken')}
+ </span>
+ )}
+ </div>
+ <p className="mt-0.5 truncate text-[11px] text-muted">{description}</p>
+ </div>
+ </div>
+ }
+ >
+ <div className="px-5 py-4">
+ <PlatformConfigEmbed
+ platform={id}
+ config={config}
+ onApply={handleApplyPlatform}
+ onCancel={closeAll}
+ />
+ </div>
+ </CollapseCard>
+ );
+ })}
+ </div>
</SettingsPageShell>
);
};
+
+const CollapseCard: React.FC<{
+ expanded: boolean;
+ onToggle: () => void;
+ header: React.ReactNode;
+ children: React.ReactNode;
+}> = ({ expanded, onToggle, header, children }) => {
+ const { t } = useTranslation();
+ return (
+ <section
+ className={clsx(
+ 'overflow-hidden rounded-xl border bg-surface-2 transition-colors',
+ expanded ? 'border-mint/35 shadow-[0_8px_32px_-8px_rgba(91,255,160,0.078)]' : 'border-border'
+ )}
+ >
+ <div className="flex items-stretch gap-3 px-5 py-4">
+ {header}
+ <button
+ type="button"
+ onClick={onToggle}
+ className={clsx(
+ 'inline-flex shrink-0 items-center gap-1.5 rounded-lg border px-3 py-1.5 text-[12px] font-medium transition',
+ expanded
+ ? 'border-mint/35 bg-mint/[0.08] text-mint'
+ : 'border-border bg-white/[0.04] text-foreground hover:border-border-strong'
+ )}
+ >
+ {expanded ? (
+ <>
+ <ChevronUp size={14} />
+ {t('common.close')}
+ </>
+ ) : (
+ <>
+ <Pencil size={12} />
+ {t('common.edit')}
+ </>
+ )}
+ </button>
+ </div>
+ {expanded && <div className="border-t border-border bg-background/40">{children}</div>}
+ </section>
+ );
+};
+
+const PlatformConfigEmbed: React.FC<{
+ platform: string;
+ config: any;
+ onApply: (data: any) => Promise<void>;
+ onCancel: () => void;
+}> = ({ platform, config, onApply, onCancel }) => {
+ const noopNext = () => {};
+ if (platform === 'slack') {
+ return <SlackConfig data={config} onNext={noopNext} embedded onApply={onApply} onCancel={onCancel} />;
+ }
+ if (platform === 'discord') {
+ return <DiscordConfig data={config} onNext={noopNext} embedded onApply={onApply} onCancel={onCancel} />;
+ }
+ if (platform === 'telegram') {
+ return <TelegramConfig data={config} onNext={noopNext} embedded onApply={onApply} onCancel={onCancel} />;
+ }
+ if (platform === 'lark') {
+ return <LarkConfig data={config} onNext={noopNext} embedded onApply={onApply} onCancel={onCancel} />;
+ }
+ if (platform === 'wechat') {
+ return <WeChatConfig data={config} onNext={noopNext} embedded onApply={onApply} onCancel={onCancel} />;
+ }
+ return null;
+};
+
diff --git a/ui/src/components/steps/DiscordConfig.tsx b/ui/src/components/steps/DiscordConfig.tsx
index 787363af5..70e8460aa 100644
--- a/ui/src/components/steps/DiscordConfig.tsx
+++ b/ui/src/components/steps/DiscordConfig.tsx
@@ -20,12 +20,15 @@ import clsx from 'clsx';
import { useApi } from '../../context/ApiContext';
import { useToast } from '../../context/ToastContext';
import { copyTextToClipboard } from '../../lib/utils';
-import { EyebrowBadge, WizardCard } from '../visual';
+import { EmbeddedConfigShell, EyebrowBadge, WizardCard } from '../visual';
interface DiscordConfigProps {
data: any;
onNext: (data: any) => void;
- onBack: () => void;
+ onBack?: () => void;
+ embedded?: boolean;
+ onApply?: (data: any) => Promise<void> | void;
+ onCancel?: () => void;
}
const getDiscordGuildAllowlist = (source: any): string[] => {
@@ -35,12 +38,13 @@ const getDiscordGuildAllowlist = (source: any): string[] => {
// Mirrors design.pen XCWAT (Slack creds wizard step) adapted for Discord.
// 920-wide WizardCard, mint eyebrow, accordion rows with mint-bordered active row.
-export const DiscordConfig: React.FC<DiscordConfigProps> = ({ data, onNext, onBack }) => {
+export const DiscordConfig: React.FC<DiscordConfigProps> = ({ data, onNext, onBack, embedded = false, onApply, onCancel }) => {
const { t } = useTranslation();
const api = useApi();
const { showToast } = useToast();
const [botToken, setBotToken] = useState(data.discord?.bot_token || '');
const [checking, setChecking] = useState(false);
+ const [applying, setApplying] = useState(false);
const [authResult, setAuthResult] = useState<any>(null);
const [guilds, setGuilds] = useState<any[]>([]);
const [selectedGuilds, setSelectedGuilds] = useState<string[]>(getDiscordGuildAllowlist(data));
@@ -183,38 +187,28 @@ export const DiscordConfig: React.FC<DiscordConfigProps> = ({ data, onNext, onBa
isValid,
].filter(Boolean).length;
- return (
- <div className="flex w-full justify-center">
- <WizardCard className="gap-6">
- <div className="flex flex-wrap items-center justify-between gap-4">
- <div className="space-y-2">
- <EyebrowBadge tone="mint">Discord</EyebrowBadge>
- <h2 className="text-[28px] font-bold leading-tight tracking-[-0.4px] text-foreground">
- {t('discordConfig.title')}
- </h2>
- <p className="max-w-[560px] text-[14px] leading-[1.55] text-muted">
- {t('discordConfig.subtitle')}
- </p>
- </div>
- <div className="flex items-center gap-2 rounded-full border border-border bg-white/[0.04] px-3 py-1.5">
- <span className="font-mono text-[11px] font-bold uppercase tracking-[0.16em] text-mint">
- {completedCount} / 4
- </span>
- <div className="flex gap-1">
- {[0, 1, 2, 3].map((i) => (
- <span
- key={i}
- className={clsx(
- 'h-1 w-5 rounded-full',
- i < completedCount ? 'bg-mint shadow-[0_0_8px_rgba(91,255,160,0.6)]' : 'bg-white/[0.08]'
- )}
- />
- ))}
- </div>
- </div>
- </div>
+ const buildSubmitData = () => ({
+ platform: 'discord',
+ discord: {
+ ...(data.discord || {}),
+ bot_token: botToken,
+ },
+ discordGuildAllowlist: selectedGuilds,
+ discordGuildAllowlistTouched: guildSelectionTouched,
+ });
+
+ const handleApply = async () => {
+ if (!onApply) return;
+ setApplying(true);
+ try {
+ await onApply(buildSubmitData());
+ } finally {
+ setApplying(false);
+ }
+ };
- <div className="flex flex-col gap-3">
+ const stepShells = (
+ <>
{/* Step 1: Create application */}
<StepShell active={expandedSteps[1]}>
<StepHeader step={1} title={t('discordConfig.step1Title')} icon={<Plus size={16} className="text-cyan" />} />
@@ -439,8 +433,57 @@ export const DiscordConfig: React.FC<DiscordConfigProps> = ({ data, onNext, onBa
</div>
)}
</StepShell>
+ </>
+ );
+
+ if (embedded) {
+ return (
+ <EmbeddedConfigShell
+ total={4}
+ completed={completedCount}
+ canApply={isValid}
+ applying={applying}
+ onApply={() => void handleApply()}
+ onCancel={() => onCancel?.()}
+ >
+ {stepShells}
+ </EmbeddedConfigShell>
+ );
+ }
+
+ return (
+ <div className="flex w-full justify-center">
+ <WizardCard className="gap-6">
+ <div className="flex flex-wrap items-center justify-between gap-4">
+ <div className="space-y-2">
+ <EyebrowBadge tone="mint">Discord</EyebrowBadge>
+ <h2 className="text-[28px] font-bold leading-tight tracking-[-0.4px] text-foreground">
+ {t('discordConfig.title')}
+ </h2>
+ <p className="max-w-[560px] text-[14px] leading-[1.55] text-muted">
+ {t('discordConfig.subtitle')}
+ </p>
+ </div>
+ <div className="flex items-center gap-2 rounded-full border border-border bg-white/[0.04] px-3 py-1.5">
+ <span className="font-mono text-[11px] font-bold uppercase tracking-[0.16em] text-mint">
+ {completedCount} / 4
+ </span>
+ <div className="flex gap-1">
+ {[0, 1, 2, 3].map((i) => (
+ <span
+ key={i}
+ className={clsx(
+ 'h-1 w-5 rounded-full',
+ i < completedCount ? 'bg-mint shadow-[0_0_8px_rgba(91,255,160,0.6)]' : 'bg-white/[0.08]'
+ )}
+ />
+ ))}
+ </div>
+ </div>
</div>
+ <div className="flex flex-col gap-3">{stepShells}</div>
+
<div className="flex items-center justify-between border-t border-border pt-4">
<button
type="button"
@@ -452,17 +495,7 @@ export const DiscordConfig: React.FC<DiscordConfigProps> = ({ data, onNext, onBa
</button>
<button
type="button"
- onClick={() =>
- onNext({
- platform: 'discord',
- discord: {
- ...(data.discord || {}),
- bot_token: botToken,
- },
- discordGuildAllowlist: selectedGuilds,
- discordGuildAllowlistTouched: guildSelectionTouched,
- })
- }
+ onClick={() => onNext(buildSubmitData())}
disabled={!isValid}
className="inline-flex items-center gap-2 rounded-lg bg-mint px-5 py-2.5 text-[13px] font-bold text-[#080812] shadow-[0_0_32px_-6px_rgba(91,255,160,0.6)] transition hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-40 disabled:shadow-none"
>
diff --git a/ui/src/components/steps/LarkConfig.tsx b/ui/src/components/steps/LarkConfig.tsx
index bfc80bb5a..03ae55dfc 100644
--- a/ui/src/components/steps/LarkConfig.tsx
+++ b/ui/src/components/steps/LarkConfig.tsx
@@ -23,7 +23,7 @@ import clsx from 'clsx';
import { useApi } from '../../context/ApiContext';
import { useToast } from '../../context/ToastContext';
import { copyTextToClipboard } from '../../lib/utils';
-import { EyebrowBadge, WizardCard } from '../visual';
+import { EmbeddedConfigShell, EyebrowBadge, WizardCard } from '../visual';
const LARK_PERMISSIONS_JSON = `{
"scopes": {
@@ -51,12 +51,15 @@ const LARK_PERMISSIONS_JSON = `{
interface LarkConfigProps {
data: any;
onNext: (data: any) => void;
- onBack: () => void;
+ onBack?: () => void;
+ embedded?: boolean;
+ onApply?: (data: any) => Promise<void> | void;
+ onCancel?: () => void;
}
// Mirrors design.pen XCWAT (Slack creds wizard step) adapted for Lark/Feishu.
// Adds a domain selector ahead of the 5-step accordion. WizardCard 920, mint eyebrow.
-export const LarkConfig: React.FC<LarkConfigProps> = ({ data, onNext, onBack }) => {
+export const LarkConfig: React.FC<LarkConfigProps> = ({ data, onNext, onBack, embedded = false, onApply, onCancel }) => {
const { t } = useTranslation();
const api = useApi();
const { showToast } = useToast();
@@ -64,6 +67,7 @@ export const LarkConfig: React.FC<LarkConfigProps> = ({ data, onNext, onBack })
const [appId, setAppId] = useState(data.lark?.app_id || '');
const [appSecret, setAppSecret] = useState(data.lark?.app_secret || '');
const [checking, setChecking] = useState(false);
+ const [applying, setApplying] = useState(false);
const [authResult, setAuthResult] = useState<any>(null);
const [wsStatus, setWsStatus] = useState<'idle' | 'connecting' | 'connected' | 'error'>('idle');
const [chats, setChats] = useState<any[]>([]);
@@ -229,37 +233,29 @@ export const LarkConfig: React.FC<LarkConfigProps> = ({ data, onNext, onBack })
expandedSteps[5],
].filter(Boolean).length;
- return (
- <div className="flex w-full justify-center">
- <WizardCard className="gap-6">
- <div className="flex flex-wrap items-center justify-between gap-4">
- <div className="space-y-2">
- <EyebrowBadge tone="mint">Lark / Feishu</EyebrowBadge>
- <h2 className="text-[28px] font-bold leading-tight tracking-[-0.4px] text-foreground">
- {t('larkConfig.title')}
- </h2>
- <p className="max-w-[560px] text-[14px] leading-[1.55] text-muted">
- {t('larkConfig.subtitle')}
- </p>
- </div>
- <div className="flex items-center gap-2 rounded-full border border-border bg-white/[0.04] px-3 py-1.5">
- <span className="font-mono text-[11px] font-bold uppercase tracking-[0.16em] text-mint">
- {completedCount} / 5
- </span>
- <div className="flex gap-1">
- {[0, 1, 2, 3, 4].map((i) => (
- <span
- key={i}
- className={clsx(
- 'h-1 w-4 rounded-full',
- i < completedCount ? 'bg-mint shadow-[0_0_8px_rgba(91,255,160,0.6)]' : 'bg-white/[0.08]'
- )}
- />
- ))}
- </div>
- </div>
- </div>
+ const buildSubmitData = () => ({
+ platform: 'lark',
+ lark: {
+ ...(data.lark || {}),
+ app_id: appId,
+ app_secret: appSecret,
+ domain,
+ },
+ });
+
+ const handleApply = async () => {
+ if (!onApply) return;
+ setApplying(true);
+ try {
+ api.larkTempWsStop().catch(() => {});
+ await onApply(buildSubmitData());
+ } finally {
+ setApplying(false);
+ }
+ };
+ const bodyContent = (
+ <>
{/* Domain selector */}
<div className="space-y-2 rounded-xl border border-border bg-background px-5 py-4">
<label className="flex items-center gap-2 text-[12px] font-medium text-foreground">
@@ -518,6 +514,56 @@ export const LarkConfig: React.FC<LarkConfigProps> = ({ data, onNext, onBack })
)}
</StepShell>
</div>
+ </>
+ );
+
+ if (embedded) {
+ return (
+ <EmbeddedConfigShell
+ total={5}
+ completed={completedCount}
+ canApply={isValid}
+ applying={applying}
+ onApply={() => void handleApply()}
+ onCancel={() => onCancel?.()}
+ >
+ {bodyContent}
+ </EmbeddedConfigShell>
+ );
+ }
+
+ return (
+ <div className="flex w-full justify-center">
+ <WizardCard className="gap-6">
+ <div className="flex flex-wrap items-center justify-between gap-4">
+ <div className="space-y-2">
+ <EyebrowBadge tone="mint">Lark / Feishu</EyebrowBadge>
+ <h2 className="text-[28px] font-bold leading-tight tracking-[-0.4px] text-foreground">
+ {t('larkConfig.title')}
+ </h2>
+ <p className="max-w-[560px] text-[14px] leading-[1.55] text-muted">
+ {t('larkConfig.subtitle')}
+ </p>
+ </div>
+ <div className="flex items-center gap-2 rounded-full border border-border bg-white/[0.04] px-3 py-1.5">
+ <span className="font-mono text-[11px] font-bold uppercase tracking-[0.16em] text-mint">
+ {completedCount} / 5
+ </span>
+ <div className="flex gap-1">
+ {[0, 1, 2, 3, 4].map((i) => (
+ <span
+ key={i}
+ className={clsx(
+ 'h-1 w-4 rounded-full',
+ i < completedCount ? 'bg-mint shadow-[0_0_8px_rgba(91,255,160,0.6)]' : 'bg-white/[0.08]'
+ )}
+ />
+ ))}
+ </div>
+ </div>
+ </div>
+
+ {bodyContent}
<div className="flex items-center justify-between border-t border-border pt-4">
<button
@@ -532,15 +578,7 @@ export const LarkConfig: React.FC<LarkConfigProps> = ({ data, onNext, onBack })
type="button"
onClick={() => {
api.larkTempWsStop().catch(() => {});
- onNext({
- platform: 'lark',
- lark: {
- ...(data.lark || {}),
- app_id: appId,
- app_secret: appSecret,
- domain,
- },
- });
+ onNext(buildSubmitData());
}}
disabled={!isValid}
className="inline-flex items-center gap-2 rounded-lg bg-mint px-5 py-2.5 text-[13px] font-bold text-[#080812] shadow-[0_0_32px_-6px_rgba(91,255,160,0.6)] transition hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-40 disabled:shadow-none"
diff --git a/ui/src/components/steps/SlackConfig.tsx b/ui/src/components/steps/SlackConfig.tsx
index e8aaa983d..be082d3c2 100644
--- a/ui/src/components/steps/SlackConfig.tsx
+++ b/ui/src/components/steps/SlackConfig.tsx
@@ -5,24 +5,28 @@ import clsx from 'clsx';
import { useApi } from '../../context/ApiContext';
import { useToast } from '../../context/ToastContext';
import { copyTextToClipboard } from '../../lib/utils';
-import { EyebrowBadge, WizardCard } from '../visual';
+import { EmbeddedConfigShell, EyebrowBadge, WizardCard } from '../visual';
interface SlackConfigProps {
data: any;
onNext: (data: any) => void;
- onBack: () => void;
+ onBack?: () => void;
+ embedded?: boolean;
+ onApply?: (data: any) => Promise<void> | void;
+ onCancel?: () => void;
}
// Mirrors design.pen XCWAT (Slack creds wizard step): WizardCard 920 wide,
// sStep accordion rows with mint-bordered active row + faint border collapsed
// rows, navigation row with chevron-left back and mint pill next.
-export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }) => {
+export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack, embedded = false, onApply, onCancel }) => {
const { t } = useTranslation();
const api = useApi();
const { showToast } = useToast();
const [botToken, setBotToken] = useState(data.slack?.bot_token || data.slackBotToken || '');
const [appToken, setAppToken] = useState(data.slack?.app_token || data.slackAppToken || '');
const [checking, setChecking] = useState(false);
+ const [applying, setApplying] = useState(false);
const [authResult, setAuthResult] = useState<any>(null);
const [manifest, setManifest] = useState<string>('');
const [manifestCompact, setManifestCompact] = useState<string>('');
@@ -153,38 +157,24 @@ export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }
Boolean(authResult?.ok),
].filter(Boolean).length;
- return (
- <div className="flex w-full justify-center">
- <WizardCard className="gap-6">
- <div className="flex flex-wrap items-center justify-between gap-4">
- <div className="space-y-2">
- <EyebrowBadge tone="mint">04 — Slack</EyebrowBadge>
- <h2 className="text-[28px] font-bold leading-tight tracking-[-0.4px] text-foreground">
- {t('slackConfig.title')}
- </h2>
- <p className="max-w-[560px] text-[14px] leading-[1.55] text-muted">
- {t('slackConfig.selfHostDescription')}
- </p>
- </div>
- <div className="flex items-center gap-2 rounded-full border border-border bg-white/[0.04] px-3 py-1.5">
- <span className="font-mono text-[11px] font-bold uppercase tracking-[0.16em] text-mint">
- {completedCount} / 4
- </span>
- <div className="flex gap-1">
- {[0, 1, 2, 3].map((i) => (
- <span
- key={i}
- className={clsx(
- 'h-1 w-5 rounded-full',
- i < completedCount ? 'bg-mint shadow-[0_0_8px_rgba(91,255,160,0.6)]' : 'bg-white/[0.08]'
- )}
- />
- ))}
- </div>
- </div>
- </div>
+ const buildSubmitData = () => ({
+ slack: { ...data.slack, bot_token: botToken, app_token: appToken },
+ mode: 'self_host',
+ });
+
+ const handleApply = async () => {
+ if (!onApply) return;
+ setApplying(true);
+ try {
+ await onApply(buildSubmitData());
+ } finally {
+ setApplying(false);
+ }
+ };
- <div className="flex flex-col gap-3">
+ const stepShells = (
+ <>
+ {/* steps content */}
{/* Step 1 */}
<StepShell active={expandedSteps[1]}>
<StepHeader step={1} title={t('slackConfig.step1Title')} icon={<Plus size={16} className="text-cyan" />} />
@@ -363,8 +353,57 @@ export const SlackConfig: React.FC<SlackConfigProps> = ({ data, onNext, onBack }
</div>
)}
</StepShell>
+ </>
+ );
+
+ if (embedded) {
+ return (
+ <EmbeddedConfigShell
+ total={4}
+ completed={completedCount}
+ canApply={isValid}
+ applying={applying}
+ onApply={() => void handleApply()}
+ onCancel={() => onCancel?.()}
+ >
+ {stepShells}
+ </EmbeddedConfigShell>
+ );
+ }
+
+ return (
+ <div className="flex w-full justify-center">
+ <WizardCard className="gap-6">
+ <div className="flex flex-wrap items-center justify-between gap-4">
+ <div className="space-y-2">
+ <EyebrowBadge tone="mint">04 — Slack</EyebrowBadge>
+ <h2 className="text-[28px] font-bold leading-tight tracking-[-0.4px] text-foreground">
+ {t('slackConfig.title')}
+ </h2>
+ <p className="max-w-[560px] text-[14px] leading-[1.55] text-muted">
+ {t('slackConfig.selfHostDescription')}
+ </p>
+ </div>
+ <div className="flex items-center gap-2 rounded-full border border-border bg-white/[0.04] px-3 py-1.5">
+ <span className="font-mono text-[11px] font-bold uppercase tracking-[0.16em] text-mint">
+ {completedCount} / 4
+ </span>
+ <div className="flex gap-1">
+ {[0, 1, 2, 3].map((i) => (
+ <span
+ key={i}
+ className={clsx(
+ 'h-1 w-5 rounded-full',
+ i < completedCount ? 'bg-mint shadow-[0_0_8px_rgba(91,255,160,0.6)]' : 'bg-white/[0.08]'
+ )}
+ />
+ ))}
+ </div>
+ </div>
</div>
+ <div className="flex flex-col gap-3">{stepShells}</div>
+
<div className="flex items-center justify-between border-t border-border pt-4">
<button
type="button"
diff --git a/ui/src/components/steps/TelegramConfig.tsx b/ui/src/components/steps/TelegramConfig.tsx
index 3c7af6b3e..d42197703 100644
--- a/ui/src/components/steps/TelegramConfig.tsx
+++ b/ui/src/components/steps/TelegramConfig.tsx
@@ -19,17 +19,20 @@ import clsx from 'clsx';
import { useApi } from '../../context/ApiContext';
import { useToast } from '../../context/ToastContext';
import { copyTextToClipboard } from '../../lib/utils';
-import { EyebrowBadge, WizardCard } from '../visual';
+import { EmbeddedConfigShell, EyebrowBadge, WizardCard } from '../visual';
interface TelegramConfigProps {
data: any;
onNext: (data: any) => void;
- onBack: () => void;
+ onBack?: () => void;
+ embedded?: boolean;
+ onApply?: (data: any) => Promise<void> | void;
+ onCancel?: () => void;
}
// Mirrors design.pen XCWAT (Slack creds wizard step) adapted for Telegram.
// 920-wide WizardCard, mint eyebrow, 5-step accordion with mint accent on active row.
-export const TelegramConfig: React.FC<TelegramConfigProps> = ({ data, onNext, onBack }) => {
+export const TelegramConfig: React.FC<TelegramConfigProps> = ({ data, onNext, onBack, embedded = false, onApply, onCancel }) => {
const { t } = useTranslation();
const api = useApi();
const { showToast } = useToast();
@@ -37,6 +40,7 @@ export const TelegramConfig: React.FC<TelegramConfigProps> = ({ data, onNext, on
const [requireMention, setRequireMention] = useState(data.telegram?.require_mention ?? true);
const [forumAutoTopic, setForumAutoTopic] = useState(data.telegram?.forum_auto_topic ?? true);
const [checking, setChecking] = useState(false);
+ const [applying, setApplying] = useState(false);
const [authResult, setAuthResult] = useState<any>(null);
const [expandedSteps, setExpandedSteps] = useState<Record<number, boolean>>({
1: true,
@@ -162,38 +166,28 @@ export const TelegramConfig: React.FC<TelegramConfigProps> = ({ data, onNext, on
},
];
- return (
- <div className="flex w-full justify-center">
- <WizardCard className="gap-6">
- <div className="flex flex-wrap items-center justify-between gap-4">
- <div className="space-y-2">
- <EyebrowBadge tone="mint">Telegram</EyebrowBadge>
- <h2 className="text-[28px] font-bold leading-tight tracking-[-0.4px] text-foreground">
- {t('telegramConfig.title')}
- </h2>
- <p className="max-w-[560px] text-[14px] leading-[1.55] text-muted">
- {t('telegramConfig.subtitle')}
- </p>
- </div>
- <div className="flex items-center gap-2 rounded-full border border-border bg-white/[0.04] px-3 py-1.5">
- <span className="font-mono text-[11px] font-bold uppercase tracking-[0.16em] text-mint">
- {completedCount} / 5
- </span>
- <div className="flex gap-1">
- {[0, 1, 2, 3, 4].map((i) => (
- <span
- key={i}
- className={clsx(
- 'h-1 w-4 rounded-full',
- i < completedCount ? 'bg-mint shadow-[0_0_8px_rgba(91,255,160,0.6)]' : 'bg-white/[0.08]'
- )}
- />
- ))}
- </div>
- </div>
- </div>
+ const buildSubmitData = () => ({
+ platform: 'telegram',
+ telegram: {
+ ...(data.telegram || {}),
+ bot_token: botToken,
+ require_mention: requireMention,
+ forum_auto_topic: forumAutoTopic,
+ },
+ });
+
+ const handleApply = async () => {
+ if (!onApply) return;
+ setApplying(true);
+ try {
+ await onApply(buildSubmitData());
+ } finally {
+ setApplying(false);
+ }
+ };
- <div className="flex flex-col gap-3">
+ const stepShells = (
+ <>
{/* Step 1: Open BotFather */}
<StepShell active={expandedSteps[1]}>
<StepHeader
@@ -411,8 +405,57 @@ export const TelegramConfig: React.FC<TelegramConfigProps> = ({ data, onNext, on
</div>
)}
</StepShell>
+ </>
+ );
+
+ if (embedded) {
+ return (
+ <EmbeddedConfigShell
+ total={5}
+ completed={completedCount}
+ canApply={isValid}
+ applying={applying}
+ onApply={() => void handleApply()}
+ onCancel={() => onCancel?.()}
+ >
+ {stepShells}
+ </EmbeddedConfigShell>
+ );
+ }
+
+ return (
+ <div className="flex w-full justify-center">
+ <WizardCard className="gap-6">
+ <div className="flex flex-wrap items-center justify-between gap-4">
+ <div className="space-y-2">
+ <EyebrowBadge tone="mint">Telegram</EyebrowBadge>
+ <h2 className="text-[28px] font-bold leading-tight tracking-[-0.4px] text-foreground">
+ {t('telegramConfig.title')}
+ </h2>
+ <p className="max-w-[560px] text-[14px] leading-[1.55] text-muted">
+ {t('telegramConfig.subtitle')}
+ </p>
+ </div>
+ <div className="flex items-center gap-2 rounded-full border border-border bg-white/[0.04] px-3 py-1.5">
+ <span className="font-mono text-[11px] font-bold uppercase tracking-[0.16em] text-mint">
+ {completedCount} / 5
+ </span>
+ <div className="flex gap-1">
+ {[0, 1, 2, 3, 4].map((i) => (
+ <span
+ key={i}
+ className={clsx(
+ 'h-1 w-4 rounded-full',
+ i < completedCount ? 'bg-mint shadow-[0_0_8px_rgba(91,255,160,0.6)]' : 'bg-white/[0.08]'
+ )}
+ />
+ ))}
+ </div>
+ </div>
</div>
+ <div className="flex flex-col gap-3">{stepShells}</div>
+
<div className="flex items-center justify-between border-t border-border pt-4">
<button
type="button"
@@ -424,17 +467,7 @@ export const TelegramConfig: React.FC<TelegramConfigProps> = ({ data, onNext, on
</button>
<button
type="button"
- onClick={() =>
- onNext({
- platform: 'telegram',
- telegram: {
- ...(data.telegram || {}),
- bot_token: botToken,
- require_mention: requireMention,
- forum_auto_topic: forumAutoTopic,
- },
- })
- }
+ onClick={() => onNext(buildSubmitData())}
disabled={!isValid}
className="inline-flex items-center gap-2 rounded-lg bg-mint px-5 py-2.5 text-[13px] font-bold text-[#080812] shadow-[0_0_32px_-6px_rgba(91,255,160,0.6)] transition hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-40 disabled:shadow-none"
>
diff --git a/ui/src/components/steps/UserList.tsx b/ui/src/components/steps/UserList.tsx
index 113e93c7c..184bfe449 100644
--- a/ui/src/components/steps/UserList.tsx
+++ b/ui/src/components/steps/UserList.tsx
@@ -177,7 +177,7 @@ const BindCodeCard: React.FC<BindCodeCardProps> = ({ refreshTrigger, onCodesChan
};
const handleCopy = async (code: string) => {
- const copied = await copyTextToClipboard(code);
+ const copied = await copyTextToClipboard(`bind ${code}`);
if (!copied) {
showToast(t('common.copyFailed'), 'error');
return;
@@ -314,7 +314,7 @@ const BindCodeCard: React.FC<BindCodeCardProps> = ({ refreshTrigger, onCodesChan
return (
<div key={bc.code} className="flex flex-wrap items-center justify-between gap-3 px-3 py-2.5">
<div className="flex flex-wrap items-center gap-2">
- <code className="rounded border border-border bg-surface px-2 py-0.5 font-mono text-[12px] text-foreground">{bc.code}</code>
+ <code className="rounded border border-border bg-surface px-2 py-0.5 font-mono text-[12px] text-foreground">bind {bc.code}</code>
<span
className={clsx(
'rounded-full border px-2 py-0.5 text-[10px] font-mono font-bold tracking-[0.12em]',
@@ -392,7 +392,7 @@ const ActiveCodeBox: React.FC<{
style={{ borderColor: 'rgba(255,200,87,0.33)' }}
title={t('bindCode.copy')}
>
- <span className="font-mono text-[18px] font-bold tracking-[0.12em] text-gold">{code.code}</span>
+ <span className="font-mono text-[18px] font-bold tracking-[0.12em] text-gold">bind {code.code}</span>
{copied ? (
<Check size={14} className="shrink-0 text-mint" />
) : (
diff --git a/ui/src/components/steps/WeChatConfig.tsx b/ui/src/components/steps/WeChatConfig.tsx
index c3467b33b..5a542aad2 100644
--- a/ui/src/components/steps/WeChatConfig.tsx
+++ b/ui/src/components/steps/WeChatConfig.tsx
@@ -14,21 +14,25 @@ import {
import { useTranslation } from 'react-i18next';
import clsx from 'clsx';
import { useApi } from '../../context/ApiContext';
-import { EyebrowBadge, WizardCard } from '../visual';
+import { EmbeddedConfigShell, EyebrowBadge, WizardCard } from '../visual';
interface WeChatConfigProps {
data: Record<string, any>;
onNext: (data: Record<string, any>) => void;
- onBack: () => void;
+ onBack?: () => void;
+ embedded?: boolean;
+ onApply?: (data: Record<string, any>) => Promise<void> | void;
+ onCancel?: () => void;
}
const QR_POLL_INTERVAL_MS = 5000;
// Mirrors design.pen XCWAT visual treatment for the QR-driven WeChat onboarding.
// Three-stop horizontal stepper, mint-bordered QR card, mint primary actions.
-export const WeChatConfig: React.FC<WeChatConfigProps> = ({ data, onNext, onBack }) => {
+export const WeChatConfig: React.FC<WeChatConfigProps> = ({ data, onNext, onBack, embedded = false, onApply, onCancel }) => {
const { t } = useTranslation();
const api = useApi();
+ const [applying, setApplying] = useState(false);
const [loginState, setLoginState] = useState<
'idle' | 'qr_ready' | 'scanning' | 'confirming' | 'connected' | 'error'
@@ -188,37 +192,27 @@ export const WeChatConfig: React.FC<WeChatConfigProps> = ({ data, onNext, onBack
const stepLabels = [t('wechatConfig.stepStart'), t('wechatConfig.stepScan'), t('wechatConfig.stepDone')];
- return (
- <div className="flex w-full justify-center">
- <WizardCard className="gap-6">
- <div className="flex flex-wrap items-center justify-between gap-4">
- <div className="space-y-2">
- <EyebrowBadge tone="mint">WeChat</EyebrowBadge>
- <h2 className="text-[28px] font-bold leading-tight tracking-[-0.4px] text-foreground">
- {t('wechatConfig.title')}
- </h2>
- <p className="max-w-[560px] text-[14px] leading-[1.55] text-muted">
- {t('wechatConfig.subtitle')}
- </p>
- </div>
- <div className="flex items-center gap-2 rounded-full border border-border bg-white/[0.04] px-3 py-1.5">
- <span className="font-mono text-[11px] font-bold uppercase tracking-[0.16em] text-mint">
- {completedDots} / 3
- </span>
- <div className="flex gap-1">
- {[0, 1, 2].map((i) => (
- <span
- key={i}
- className={clsx(
- 'h-1 w-6 rounded-full',
- i < completedDots ? 'bg-mint shadow-[0_0_8px_rgba(91,255,160,0.6)]' : 'bg-white/[0.08]'
- )}
- />
- ))}
- </div>
- </div>
- </div>
+ const buildSubmitData = () => ({
+ platform: 'wechat',
+ wechat: {
+ ...(data.wechat || {}),
+ bot_token: botToken,
+ base_url: baseUrl,
+ },
+ });
+
+ const handleApply = async () => {
+ if (!onApply) return;
+ setApplying(true);
+ try {
+ await onApply(buildSubmitData());
+ } finally {
+ setApplying(false);
+ }
+ };
+ const bodyContent = (
+ <>
{/* Horizontal stepper */}
<div className="rounded-xl border border-border bg-background px-5 py-4">
<div className="flex items-center justify-between gap-3">
@@ -384,6 +378,56 @@ export const WeChatConfig: React.FC<WeChatConfigProps> = ({ data, onNext, onBack
</div>
)}
</div>
+ </>
+ );
+
+ if (embedded) {
+ return (
+ <EmbeddedConfigShell
+ total={3}
+ completed={completedDots}
+ canApply={canProceed}
+ applying={applying}
+ onApply={() => void handleApply()}
+ onCancel={() => onCancel?.()}
+ >
+ {bodyContent}
+ </EmbeddedConfigShell>
+ );
+ }
+
+ return (
+ <div className="flex w-full justify-center">
+ <WizardCard className="gap-6">
+ <div className="flex flex-wrap items-center justify-between gap-4">
+ <div className="space-y-2">
+ <EyebrowBadge tone="mint">WeChat</EyebrowBadge>
+ <h2 className="text-[28px] font-bold leading-tight tracking-[-0.4px] text-foreground">
+ {t('wechatConfig.title')}
+ </h2>
+ <p className="max-w-[560px] text-[14px] leading-[1.55] text-muted">
+ {t('wechatConfig.subtitle')}
+ </p>
+ </div>
+ <div className="flex items-center gap-2 rounded-full border border-border bg-white/[0.04] px-3 py-1.5">
+ <span className="font-mono text-[11px] font-bold uppercase tracking-[0.16em] text-mint">
+ {completedDots} / 3
+ </span>
+ <div className="flex gap-1">
+ {[0, 1, 2].map((i) => (
+ <span
+ key={i}
+ className={clsx(
+ 'h-1 w-6 rounded-full',
+ i < completedDots ? 'bg-mint shadow-[0_0_8px_rgba(91,255,160,0.6)]' : 'bg-white/[0.08]'
+ )}
+ />
+ ))}
+ </div>
+ </div>
+ </div>
+
+ {bodyContent}
<div className="flex items-center justify-between border-t border-border pt-4">
<button
@@ -396,16 +440,7 @@ export const WeChatConfig: React.FC<WeChatConfigProps> = ({ data, onNext, onBack
</button>
<button
type="button"
- onClick={() =>
- onNext({
- platform: 'wechat',
- wechat: {
- ...(data.wechat || {}),
- bot_token: botToken,
- base_url: baseUrl,
- },
- })
- }
+ onClick={() => onNext(buildSubmitData())}
disabled={!canProceed}
className="inline-flex items-center gap-2 rounded-lg bg-mint px-5 py-2.5 text-[13px] font-bold text-[#080812] shadow-[0_0_32px_-6px_rgba(91,255,160,0.6)] transition hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-40 disabled:shadow-none"
>
diff --git a/ui/src/components/visual/EmbeddedConfigShell.tsx b/ui/src/components/visual/EmbeddedConfigShell.tsx
new file mode 100644
index 000000000..91f32c8ac
--- /dev/null
+++ b/ui/src/components/visual/EmbeddedConfigShell.tsx
@@ -0,0 +1,68 @@
+import React from 'react';
+import clsx from 'clsx';
+import { Check, RefreshCw } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
+
+interface EmbeddedConfigShellProps {
+ total: number;
+ completed: number;
+ canApply: boolean;
+ applying?: boolean;
+ onApply: () => void;
+ onCancel: () => void;
+ children: React.ReactNode;
+}
+
+// Wraps a wizard *Config body inside the settings-page collapse card. Drops the
+// wizard's WizardCard chrome and replaces Back/Continue with Cancel/Apply.
+export const EmbeddedConfigShell: React.FC<EmbeddedConfigShellProps> = ({
+ total,
+ completed,
+ canApply,
+ applying,
+ onApply,
+ onCancel,
+ children,
+}) => {
+ const { t } = useTranslation();
+ return (
+ <div className="space-y-4">
+ <div className="flex items-center justify-end gap-2">
+ <span className="font-mono text-[11px] font-bold uppercase tracking-[0.16em] text-mint">
+ {completed} / {total}
+ </span>
+ <div className="flex gap-1">
+ {Array.from({ length: total }, (_, i) => (
+ <span
+ key={i}
+ className={clsx(
+ 'h-1 w-4 rounded-full',
+ i < completed ? 'bg-mint shadow-[0_0_8px_rgba(91,255,160,0.6)]' : 'bg-white/[0.08]'
+ )}
+ />
+ ))}
+ </div>
+ </div>
+ <div className="flex flex-col gap-3">{children}</div>
+ <div className="flex items-center justify-end gap-2 border-t border-border pt-3">
+ <button
+ type="button"
+ onClick={onCancel}
+ disabled={applying}
+ className="inline-flex items-center gap-1.5 rounded-lg border border-border bg-white/[0.04] px-3 py-1.5 text-[12px] font-medium text-foreground transition hover:border-border-strong disabled:opacity-50"
+ >
+ {t('common.cancel')}
+ </button>
+ <button
+ type="button"
+ onClick={onApply}
+ disabled={!canApply || applying}
+ className="inline-flex items-center gap-1.5 rounded-lg bg-mint px-3.5 py-1.5 text-[12px] font-bold text-[#080812] shadow-[0_0_24px_-6px_rgba(91,255,160,0.6)] transition hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-50 disabled:shadow-none"
+ >
+ {applying ? <RefreshCw size={12} className="animate-spin" /> : <Check size={12} />}
+ {t('platform.apply')}
+ </button>
+ </div>
+ </div>
+ );
+};
diff --git a/ui/src/components/visual/index.ts b/ui/src/components/visual/index.ts
index 01cb9f246..f4f5a564a 100644
--- a/ui/src/components/visual/index.ts
+++ b/ui/src/components/visual/index.ts
@@ -10,3 +10,4 @@ export { WizardCard } from './WizardCard';
export { WizardChrome } from './WizardChrome';
export { StatCard } from './StatCard';
export { StepCard } from './StepCard';
+export { EmbeddedConfigShell } from './EmbeddedConfigShell';
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index 8686a566a..bfda355c6 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -108,6 +108,7 @@
"badge": "Vibe Cloud provider",
"title": "Remote Access",
"subtitle": "Open this local Web UI from another device through a private avibe.bot URL. Your code and agents still run on this machine.",
+ "subtitleWithLink": "Open this local Web UI from another device through a private <cloud>avibe.bot</cloud> URL. Your code and agents still run on this machine.",
"connectTitle": "Connect to Vibe Cloud",
"connectDesc": "First create a remote-access bot at avibe.bot and copy its one-time pairing key. Then paste it here to pair this device.",
"configuredTitle": "Vibe Cloud is configured",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index e9eef6725..5a37d44d1 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -108,6 +108,7 @@
"badge": "Vibe Cloud Provider",
"title": "远程访问",
"subtitle": "通过私有 avibe.bot 地址,从另一台设备打开这个本机 Web UI。你的代码和 Agent 仍然运行在这台机器上。",
+ "subtitleWithLink": "通过私有 <cloud>avibe.bot</cloud> 地址,从另一台设备打开这个本机 Web UI。你的代码和 Agent 仍然运行在这台机器上。",
"connectTitle": "连接 Vibe Cloud",
"connectDesc": "先在 avibe.bot 创建 remote-access bot,并复制一次性 pairing key;然后粘贴到这里完成本机配对。",
"configuredTitle": "Vibe Cloud 已配置",