mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
feat(web): redesign install-progress dialog for MCP/skill
The progress dialog showed plugin-only stages (download + dependency install) for every type. MCP/skill have no such steps, so show a single "installing → done/failed" row for them (MCP: adding & connecting the server; skill: installing the package) while keeping the detailed download/deps stages for plugins. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,8 @@ import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
Download,
|
||||
Package,
|
||||
Server,
|
||||
BookOpen,
|
||||
CheckCircle2,
|
||||
XCircle,
|
||||
Loader2,
|
||||
@@ -171,6 +173,15 @@ function TaskProgressContent({ task }: { task: PluginInstallTask }) {
|
||||
const isDone = task.stage === InstallStage.DONE;
|
||||
const isError = task.stage === InstallStage.ERROR;
|
||||
|
||||
// MCP / Skill don't have the plugin's download + dependency-install stages;
|
||||
// show a single "installing → done/failed" row instead of plugin steps.
|
||||
const isPlugin = task.extensionType === 'plugin';
|
||||
const simpleIcon = task.extensionType === 'mcp' ? Server : BookOpen;
|
||||
const simpleInstallingLabel =
|
||||
task.extensionType === 'mcp'
|
||||
? t('addExtension.installStage.mcpInstalling')
|
||||
: t('addExtension.installStage.skillInstalling');
|
||||
|
||||
/** Build detail node for a stage */
|
||||
const getStageDetail = (
|
||||
stageKey: InstallStage,
|
||||
@@ -307,8 +318,24 @@ function TaskProgressContent({ task }: { task: PluginInstallTask }) {
|
||||
|
||||
{/* Stage display */}
|
||||
<div className="space-y-1.5">
|
||||
{isDone
|
||||
? /* When done: show all stages with completed style */
|
||||
{!isPlugin ? (
|
||||
/* MCP / Skill: single installing → done/failed row */
|
||||
<StageRow
|
||||
icon={simpleIcon}
|
||||
label={
|
||||
isDone
|
||||
? t('addExtension.installStage.installed')
|
||||
: isError
|
||||
? t('plugins.installProgress.failed')
|
||||
: simpleInstallingLabel
|
||||
}
|
||||
isActive={!isDone}
|
||||
isCompleted={isDone}
|
||||
isError={isError}
|
||||
detail={isError ? task.error : undefined}
|
||||
/>
|
||||
) : isDone ? (
|
||||
/* When done: show all stages with completed style */
|
||||
STAGES.map((stageConfig) => (
|
||||
<StageRow
|
||||
key={stageConfig.key}
|
||||
@@ -320,8 +347,8 @@ function TaskProgressContent({ task }: { task: PluginInstallTask }) {
|
||||
detail={getStageDetail(stageConfig.key, true)}
|
||||
/>
|
||||
))
|
||||
: isError
|
||||
? /* Error: show the failed stage */
|
||||
) : isError ? (
|
||||
/* Error: show the failed stage */
|
||||
currentStageIndex >= 0 && (
|
||||
<StageRow
|
||||
icon={STAGES[currentStageIndex].icon}
|
||||
@@ -332,7 +359,8 @@ function TaskProgressContent({ task }: { task: PluginInstallTask }) {
|
||||
detail={task.error}
|
||||
/>
|
||||
)
|
||||
: /* In progress: only show the current active stage */
|
||||
) : (
|
||||
/* In progress: only show the current active stage */
|
||||
currentStageIndex >= 0 && (
|
||||
<StageRow
|
||||
icon={STAGES[currentStageIndex].icon}
|
||||
@@ -342,6 +370,7 @@ function TaskProgressContent({ task }: { task: PluginInstallTask }) {
|
||||
isError={false}
|
||||
detail={getStageDetail(STAGES[currentStageIndex].key, false)}
|
||||
/>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1537,6 +1537,11 @@ const enUS = {
|
||||
installInfoId: 'ID',
|
||||
installInfoVersion: 'Version',
|
||||
installSuccess: 'Installed successfully',
|
||||
installStage: {
|
||||
mcpInstalling: 'Adding and connecting the MCP server…',
|
||||
skillInstalling: 'Installing the skill…',
|
||||
installed: 'Done',
|
||||
},
|
||||
manualAdd: 'Manual Add',
|
||||
uploadExtension: 'Drag & drop or click to upload',
|
||||
uploadHint: 'Supports .zip (skills) and .lbpkg (plugins) files',
|
||||
|
||||
@@ -1473,6 +1473,11 @@ const zhHans = {
|
||||
installInfoId: '标识',
|
||||
installInfoVersion: '版本',
|
||||
installSuccess: '安装成功',
|
||||
installStage: {
|
||||
mcpInstalling: '正在添加并连接 MCP 服务器…',
|
||||
skillInstalling: '正在安装技能…',
|
||||
installed: '已完成',
|
||||
},
|
||||
manualAdd: '手动添加',
|
||||
uploadExtension: '拖拽或点击上传扩展包',
|
||||
uploadHint: '支持 .zip(技能)和 .lbpkg(插件)文件',
|
||||
|
||||
Reference in New Issue
Block a user