fix(wizard): remove redundant Space CTA (#2416)

Co-authored-by: Chan <dadachann@users.noreply.github.com>
This commit is contained in:
Hyu
2026-08-12 16:56:25 +08:00
committed by GitHub
parent be8478e940
commit c3299fd1a6
9 changed files with 0 additions and 93 deletions
-47
View File
@@ -16,7 +16,6 @@ import {
import { httpClient } from '@/app/infra/http/HttpClient'; import { httpClient } from '@/app/infra/http/HttpClient';
import { import {
userInfo,
systemInfo, systemInfo,
bootstrapWorkspaceSession, bootstrapWorkspaceSession,
initializeSystemInfo, initializeSystemInfo,
@@ -490,24 +489,6 @@ export default function WizardPage() {
t, t,
]); ]);
// ---- Space auth redirect ----
const handleSpaceAuth = useCallback(async () => {
try {
const callbackUrl = `${window.location.origin}/auth/space/callback`;
const resp = await httpClient.getSpaceAuthorizeUrl(callbackUrl);
window.location.href = resp.authorize_url;
} catch (err) {
console.error('Failed to get space authorize URL', err);
toast.error(t('wizard.spaceAuthError'));
}
}, [t]);
// ---- Check if local account ----
// Re-evaluated after remote data fetch (when userInfo is populated)
const isLocalAccount =
!isLoading && (!userInfo || userInfo.account_type === 'local');
// ---- Skip handler ---- // ---- Skip handler ----
const [showSkipConfirm, setShowSkipConfirm] = useState(false); const [showSkipConfirm, setShowSkipConfirm] = useState(false);
const [isSkipping, setIsSkipping] = useState(false); const [isSkipping, setIsSkipping] = useState(false);
@@ -662,8 +643,6 @@ export default function WizardPage() {
runnerOptions={runnerOptions} runnerOptions={runnerOptions}
selected={selectedRunner} selected={selectedRunner}
onSelect={handleSelectRunner} onSelect={handleSelectRunner}
isLocalAccount={isLocalAccount}
onSpaceAuth={handleSpaceAuth}
runnerConfigItems={selectedRunnerConfigItems} runnerConfigItems={selectedRunnerConfigItems}
runnerConfigValues={runnerConfig} runnerConfigValues={runnerConfig}
onRunnerConfigChange={setRunnerConfig} onRunnerConfigChange={setRunnerConfig}
@@ -1006,8 +985,6 @@ function StepAIEngine({
runnerOptions, runnerOptions,
selected, selected,
onSelect, onSelect,
isLocalAccount,
onSpaceAuth,
runnerConfigItems, runnerConfigItems,
runnerConfigValues, runnerConfigValues,
onRunnerConfigChange, onRunnerConfigChange,
@@ -1015,8 +992,6 @@ function StepAIEngine({
runnerOptions: { name: string; label: { en_US: string; zh_Hans: string } }[]; runnerOptions: { name: string; label: { en_US: string; zh_Hans: string } }[];
selected: string | null; selected: string | null;
onSelect: (name: string) => void; onSelect: (name: string) => void;
isLocalAccount: boolean;
onSpaceAuth: () => void;
runnerConfigItems: IDynamicFormItemSchema[]; runnerConfigItems: IDynamicFormItemSchema[];
runnerConfigValues: Record<string, unknown>; runnerConfigValues: Record<string, unknown>;
onRunnerConfigChange: (v: Record<string, unknown>) => void; onRunnerConfigChange: (v: Record<string, unknown>) => void;
@@ -1127,28 +1102,6 @@ function StepAIEngine({
</Card> </Card>
); );
})} })}
{/* Space promotion banner */}
{selected === 'local-agent' && isLocalAccount && (
<div className="animate-in fade-in slide-in-from-left-2 duration-300">
<div className="relative rounded-lg p-[2px] bg-gradient-to-r from-purple-500 via-pink-500 to-orange-500">
<div className="rounded-[calc(0.5rem-2px)] bg-background p-3 flex flex-col items-center gap-2 text-center">
<Sparkles className="w-6 h-6 text-purple-500 shrink-0" />
<p className="text-xs font-medium">
{t('wizard.spaceBanner.message')}
</p>
<Button
variant="outline"
size="sm"
onClick={onSpaceAuth}
className="w-full"
>
{t('wizard.spaceBanner.action')}
</Button>
</div>
</div>
</div>
)}
</div> </div>
</div> </div>
-6
View File
@@ -1807,7 +1807,6 @@ const enUS = {
botCreateSuccess: 'Bot created successfully!', botCreateSuccess: 'Bot created successfully!',
botSaveSuccess: 'Bot configuration saved and enabled!', botSaveSuccess: 'Bot configuration saved and enabled!',
createError: 'Failed to create resources', createError: 'Failed to create resources',
spaceAuthError: 'Failed to initiate Space authorization',
skipSaveError: 'Failed to save skip status. Please try again.', skipSaveError: 'Failed to save skip status. Please try again.',
completeSaveError: 'Failed to save completion status. Please try again.', completeSaveError: 'Failed to save completion status. Please try again.',
step: { step: {
@@ -1836,11 +1835,6 @@ const enUS = {
description: description:
"Choose the AI engine that will power your bot's intelligence.", "Choose the AI engine that will power your bot's intelligence.",
}, },
spaceBanner: {
message:
'Connect to LangBot Space for free trial model credits and zero-config instant setup!',
action: 'Authorize with Space',
},
config: { config: {
botInfo: 'Bot Information', botInfo: 'Bot Information',
botNamePlaceholder: 'Enter bot name', botNamePlaceholder: 'Enter bot name',
-6
View File
@@ -1672,7 +1672,6 @@ const esES = {
botCreateSuccess: '¡Bot creado correctamente!', botCreateSuccess: '¡Bot creado correctamente!',
botSaveSuccess: '¡Configuración del Bot guardada y activada!', botSaveSuccess: '¡Configuración del Bot guardada y activada!',
createError: 'Error al crear los recursos', createError: 'Error al crear los recursos',
spaceAuthError: 'Error al iniciar la autorización de Space',
skipSaveError: skipSaveError:
'Error al guardar el estado de omisión. Por favor, inténtalo de nuevo.', 'Error al guardar el estado de omisión. Por favor, inténtalo de nuevo.',
completeSaveError: completeSaveError:
@@ -1705,11 +1704,6 @@ const esES = {
description: description:
'Elige el motor de IA que impulsará la inteligencia de tu Bot.', 'Elige el motor de IA que impulsará la inteligencia de tu Bot.',
}, },
spaceBanner: {
message:
'¡Conéctate a LangBot Space para obtener créditos de prueba gratuitos y configuración instantánea sin esfuerzo!',
action: 'Autorizar con Space',
},
config: { config: {
botInfo: 'Información del Bot', botInfo: 'Información del Bot',
botNamePlaceholder: 'Introduce el nombre del Bot', botNamePlaceholder: 'Introduce el nombre del Bot',
-6
View File
@@ -1722,7 +1722,6 @@ const jaJP = {
botCreateSuccess: 'ボットが正常に作成されました!', botCreateSuccess: 'ボットが正常に作成されました!',
botSaveSuccess: 'ボット設定が保存され、有効になりました!', botSaveSuccess: 'ボット設定が保存され、有効になりました!',
createError: 'リソースの作成に失敗しました', createError: 'リソースの作成に失敗しました',
spaceAuthError: 'Space 認証の開始に失敗しました',
skipSaveError: 'スキップ状態の保存に失敗しました。もう一度お試しください。', skipSaveError: 'スキップ状態の保存に失敗しました。もう一度お試しください。',
completeSaveError: '完了状態の保存に失敗しました。もう一度お試しください。', completeSaveError: '完了状態の保存に失敗しました。もう一度お試しください。',
step: { step: {
@@ -1753,11 +1752,6 @@ const jaJP = {
description: description:
'ボットのインテリジェンスを駆動するAIエンジンを選択してください。', 'ボットのインテリジェンスを駆動するAIエンジンを選択してください。',
}, },
spaceBanner: {
message:
'LangBot Spaceに接続して、無料トライアルモデルクレジットとゼロ設定の即時セットアップを入手!',
action: 'Spaceで認証',
},
config: { config: {
botInfo: 'ボット情報', botInfo: 'ボット情報',
botNamePlaceholder: 'ボット名を入力', botNamePlaceholder: 'ボット名を入力',
-6
View File
@@ -1645,7 +1645,6 @@ const ruRU = {
botCreateSuccess: 'Бот успешно создан!', botCreateSuccess: 'Бот успешно создан!',
botSaveSuccess: 'Конфигурация бота сохранена и включена!', botSaveSuccess: 'Конфигурация бота сохранена и включена!',
createError: 'Не удалось создать ресурсы', createError: 'Не удалось создать ресурсы',
spaceAuthError: 'Не удалось инициировать авторизацию через Space',
skipSaveError: 'Не удалось сохранить статус пропуска. Повторите попытку.', skipSaveError: 'Не удалось сохранить статус пропуска. Повторите попытку.',
completeSaveError: completeSaveError:
'Не удалось сохранить статус завершения. Повторите попытку.', 'Не удалось сохранить статус завершения. Повторите попытку.',
@@ -1675,11 +1674,6 @@ const ruRU = {
description: description:
'Выберите ИИ-движок, который будет управлять интеллектом вашего бота.', 'Выберите ИИ-движок, который будет управлять интеллектом вашего бота.',
}, },
spaceBanner: {
message:
'Подключитесь к LangBot Space для бесплатных пробных кредитов и мгновенной настройки!',
action: 'Авторизация через Space',
},
config: { config: {
botInfo: 'Информация о боте', botInfo: 'Информация о боте',
botNamePlaceholder: 'Введите имя бота', botNamePlaceholder: 'Введите имя бота',
-6
View File
@@ -1612,7 +1612,6 @@ const thTH = {
botCreateSuccess: 'สร้าง Bot สำเร็จ!', botCreateSuccess: 'สร้าง Bot สำเร็จ!',
botSaveSuccess: 'บันทึกและเปิดใช้งาน Bot สำเร็จ!', botSaveSuccess: 'บันทึกและเปิดใช้งาน Bot สำเร็จ!',
createError: 'ไม่สามารถสร้างทรัพยากรได้', createError: 'ไม่สามารถสร้างทรัพยากรได้',
spaceAuthError: 'ไม่สามารถเริ่มต้นการยืนยันสิทธิ์ Space ได้',
skipSaveError: 'ไม่สามารถบันทึกสถานะการข้ามได้ กรุณาลองใหม่', skipSaveError: 'ไม่สามารถบันทึกสถานะการข้ามได้ กรุณาลองใหม่',
completeSaveError: 'ไม่สามารถบันทึกสถานะการเสร็จสิ้นได้ กรุณาลองใหม่', completeSaveError: 'ไม่สามารถบันทึกสถานะการเสร็จสิ้นได้ กรุณาลองใหม่',
step: { step: {
@@ -1640,11 +1639,6 @@ const thTH = {
title: 'เลือกเครื่องมือ AI', title: 'เลือกเครื่องมือ AI',
description: 'เลือกเครื่องมือ AI ที่จะขับเคลื่อนความฉลาดของ Bot', description: 'เลือกเครื่องมือ AI ที่จะขับเคลื่อนความฉลาดของ Bot',
}, },
spaceBanner: {
message:
'เชื่อมต่อกับ LangBot Space เพื่อรับเครดิตทดลองใช้โมเดลฟรีและตั้งค่าทันทีโดยไม่ต้องกำหนดค่า!',
action: 'ยืนยันสิทธิ์กับ Space',
},
config: { config: {
botInfo: 'ข้อมูล Bot', botInfo: 'ข้อมูล Bot',
botNamePlaceholder: 'กรอกชื่อ Bot', botNamePlaceholder: 'กรอกชื่อ Bot',
-6
View File
@@ -1638,7 +1638,6 @@ const viVN = {
botCreateSuccess: 'Tạo Bot thành công!', botCreateSuccess: 'Tạo Bot thành công!',
botSaveSuccess: 'Cấu hình Bot đã lưu và bật!', botSaveSuccess: 'Cấu hình Bot đã lưu và bật!',
createError: 'Tạo tài nguyên thất bại', createError: 'Tạo tài nguyên thất bại',
spaceAuthError: 'Khởi tạo ủy quyền Space thất bại',
skipSaveError: 'Lưu trạng thái bỏ qua thất bại. Vui lòng thử lại.', skipSaveError: 'Lưu trạng thái bỏ qua thất bại. Vui lòng thử lại.',
completeSaveError: 'Lưu trạng thái hoàn tất thất bại. Vui lòng thử lại.', completeSaveError: 'Lưu trạng thái hoàn tất thất bại. Vui lòng thử lại.',
step: { step: {
@@ -1666,11 +1665,6 @@ const viVN = {
title: 'Chọn công cụ AI', title: 'Chọn công cụ AI',
description: 'Chọn công cụ AI sẽ cung cấp trí tuệ cho Bot của bạn.', description: 'Chọn công cụ AI sẽ cung cấp trí tuệ cho Bot của bạn.',
}, },
spaceBanner: {
message:
'Kết nối với LangBot Space để nhận tín dụng dùng thử mô hình miễn phí và thiết lập tức thì không cần cấu hình!',
action: 'Ủy quyền với Space',
},
config: { config: {
botInfo: 'Thông tin Bot', botInfo: 'Thông tin Bot',
botNamePlaceholder: 'Nhập tên Bot', botNamePlaceholder: 'Nhập tên Bot',
-5
View File
@@ -1730,7 +1730,6 @@ const zhHans = {
botCreateSuccess: '机器人创建成功!', botCreateSuccess: '机器人创建成功!',
botSaveSuccess: '机器人配置已保存并启用!', botSaveSuccess: '机器人配置已保存并启用!',
createError: '创建资源失败', createError: '创建资源失败',
spaceAuthError: '无法发起 Space 授权',
skipSaveError: '保存跳过状态失败,请重试。', skipSaveError: '保存跳过状态失败,请重试。',
completeSaveError: '保存完成状态失败,请重试。', completeSaveError: '保存完成状态失败,请重试。',
step: { step: {
@@ -1756,10 +1755,6 @@ const zhHans = {
title: '选择 AI 引擎', title: '选择 AI 引擎',
description: '选择驱动机器人智能的 AI 引擎。', description: '选择驱动机器人智能的 AI 引擎。',
}, },
spaceBanner: {
message: '接入 LangBot Space,获取免费试用模型额度,零配置极速开箱!',
action: '前往授权登录',
},
config: { config: {
botInfo: '机器人信息', botInfo: '机器人信息',
botNamePlaceholder: '请输入机器人名称', botNamePlaceholder: '请输入机器人名称',
-5
View File
@@ -1566,7 +1566,6 @@ const zhHant = {
botCreateSuccess: '機器人建立成功!', botCreateSuccess: '機器人建立成功!',
botSaveSuccess: '機器人配置已儲存並啟用!', botSaveSuccess: '機器人配置已儲存並啟用!',
createError: '建立資源失敗', createError: '建立資源失敗',
spaceAuthError: '無法發起 Space 授權',
skipSaveError: '儲存跳過狀態失敗,請重試。', skipSaveError: '儲存跳過狀態失敗,請重試。',
completeSaveError: '儲存完成狀態失敗,請重試。', completeSaveError: '儲存完成狀態失敗,請重試。',
step: { step: {
@@ -1592,10 +1591,6 @@ const zhHant = {
title: '選擇 AI 引擎', title: '選擇 AI 引擎',
description: '選擇驅動機器人智慧的 AI 引擎。', description: '選擇驅動機器人智慧的 AI 引擎。',
}, },
spaceBanner: {
message: '接入 LangBot Space,取得免費試用模型額度,零配置極速開箱!',
action: '前往授權登入',
},
config: { config: {
botInfo: '機器人資訊', botInfo: '機器人資訊',
botNamePlaceholder: '請輸入機器人名稱', botNamePlaceholder: '請輸入機器人名稱',