Skip to content

Commit de9f9aa

Browse files
gcmsgclaude
andcommitted
feat(dashboard): overhaul prompt modal UX with fixed layout and step-by-step guidance
Restructure reinstall/upgrade modals to use flex column layout with fixed header and footer (copy/close buttons always visible), scrollable middle section with numbered step guidance and collapsible prompt content. Add step-by-step instructions to ClaimTokenSection prompt panels. Add i18n keys for all 8 locales (en, zh, ja, ru, pt, fr, es, ar). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6d986ce commit de9f9aa

File tree

10 files changed

+411
-69
lines changed

10 files changed

+411
-69
lines changed

web/app/src/components/provider/ClaimTokenSection.tsx

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
TableHeader,
1212
TableRow,
1313
} from "@/components/ui/table"
14-
import { Copy, Check, Key, Loader2, RefreshCw, Eye } from "lucide-react"
14+
import { Copy, Check, Key, Loader2, RefreshCw, Eye, Info } from "lucide-react"
1515
import { useClaimTokens, useGenerateClaimToken } from "@/hooks/use-provider"
1616

1717
export function ClaimTokenSection() {
@@ -184,7 +184,7 @@ export function ClaimTokenSection() {
184184

185185
{/* Generated prompt display */}
186186
{generatedCode && (
187-
<div className="rounded-lg border border-primary/30 bg-primary/5 p-4 space-y-3">
187+
<div className="rounded-lg border border-primary/30 bg-primary/5 p-4 space-y-4">
188188
<div className="flex items-center justify-between">
189189
<p className="text-sm font-medium">
190190
{t('claim.sendPrompt')}
@@ -193,6 +193,35 @@ export function ClaimTokenSection() {
193193
{formatTime(remaining)}
194194
</span>
195195
</div>
196+
{/* Step guidance */}
197+
<div className="space-y-2.5">
198+
<div className="flex items-start gap-3">
199+
<span className="flex size-5 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium">1</span>
200+
<div>
201+
<p className="text-sm font-medium">{t('promptGuide.step1')}</p>
202+
<p className="text-xs text-muted-foreground">{t('promptGuide.step1Desc')}</p>
203+
</div>
204+
</div>
205+
<div className="flex items-start gap-3">
206+
<span className="flex size-5 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium">2</span>
207+
<div>
208+
<p className="text-sm font-medium">{t('promptGuide.step2')}</p>
209+
<p className="text-xs text-muted-foreground">{t('promptGuide.step2Desc')}</p>
210+
</div>
211+
</div>
212+
<div className="flex items-start gap-3">
213+
<span className="flex size-5 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium">3</span>
214+
<div>
215+
<p className="text-sm font-medium">{t('promptGuide.step3')}</p>
216+
<p className="text-xs text-muted-foreground">{t('promptGuide.step3Desc')}</p>
217+
</div>
218+
</div>
219+
</div>
220+
{/* Tip */}
221+
<div className="flex items-start gap-2 rounded-md bg-background/60 p-2.5">
222+
<Info className="size-3.5 shrink-0 text-muted-foreground mt-0.5" />
223+
<p className="text-xs text-muted-foreground">{t('promptGuide.tip')}</p>
224+
</div>
196225
<pre className="text-sm font-mono bg-background rounded-md p-3 overflow-x-auto whitespace-pre-wrap break-all border max-h-64 overflow-y-auto">
197226
{prompt}
198227
</pre>
@@ -213,7 +242,7 @@ export function ClaimTokenSection() {
213242

214243
{/* View prompt panel (from token history) */}
215244
{viewingToken && (
216-
<div className="rounded-lg border border-primary/30 bg-primary/5 p-4 space-y-3">
245+
<div className="rounded-lg border border-primary/30 bg-primary/5 p-4 space-y-4">
217246
<div className="flex items-center justify-between">
218247
<p className="text-sm font-medium">
219248
{t('claim.sendPrompt')}
@@ -226,6 +255,30 @@ export function ClaimTokenSection() {
226255
{t('common.close')}
227256
</Button>
228257
</div>
258+
{/* Step guidance */}
259+
<div className="space-y-2.5">
260+
<div className="flex items-start gap-3">
261+
<span className="flex size-5 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium">1</span>
262+
<div>
263+
<p className="text-sm font-medium">{t('promptGuide.step1')}</p>
264+
<p className="text-xs text-muted-foreground">{t('promptGuide.step1Desc')}</p>
265+
</div>
266+
</div>
267+
<div className="flex items-start gap-3">
268+
<span className="flex size-5 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium">2</span>
269+
<div>
270+
<p className="text-sm font-medium">{t('promptGuide.step2')}</p>
271+
<p className="text-xs text-muted-foreground">{t('promptGuide.step2Desc')}</p>
272+
</div>
273+
</div>
274+
<div className="flex items-start gap-3">
275+
<span className="flex size-5 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium">3</span>
276+
<div>
277+
<p className="text-sm font-medium">{t('promptGuide.step3')}</p>
278+
<p className="text-xs text-muted-foreground">{t('promptGuide.step3Desc')}</p>
279+
</div>
280+
</div>
281+
</div>
229282
<pre className="text-sm font-mono bg-background rounded-md p-3 overflow-x-auto whitespace-pre-wrap break-all border max-h-64 overflow-y-auto">
230283
{viewPrompt}
231284
</pre>

web/app/src/i18n/locales/ar.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,29 @@
691691
"sdk_outdated": "إصدار SDK قديم"
692692
}
693693
},
694+
"promptGuide": {
695+
"step1": "انسخ النص التوجيهي",
696+
"step1Desc": "انقر على الزر أدناه لنسخ نص التثبيت إلى الحافظة",
697+
"step2": "أرسل إلى وكيل الذكاء الاصطناعي",
698+
"step2Desc": "الصق النص في محادثة وكيل الذكاء الاصطناعي الخاص بك (Claude أو ChatGPT أو أي وكيل LLM)",
699+
"step3": "الوكيل يكمل الإعداد",
700+
"step3Desc": "سيقوم وكيلك بتنفيذ الخطوات تلقائيًا والتسجيل في PeerClaw",
701+
"viewPrompt": "عرض النص الكامل",
702+
"hidePrompt": "إخفاء النص",
703+
"tip": "يحتوي هذا النص على تعليمات خطوة بخطوة يمكن لوكيل الذكاء الاصطناعي اتباعها. لا تحتاج لقراءته بنفسك — فقط انسخه والصقه."
704+
},
705+
"reinstallGuide": {
706+
"step1Desc": "انقر على الزر أدناه لنسخ نص إعادة التثبيت",
707+
"step2Desc": "الصقه في وكيل الذكاء الاصطناعي الذي أعدّ هذا الوكيل في الأصل",
708+
"step3": "الوكيل يعيد تثبيت SDK",
709+
"step3Desc": "سيقوم وكيلك بنسخ زوج المفاتيح احتياطيًا وإعادة تثبيت CLI والتحقق من التكوين"
710+
},
711+
"upgradeGuide": {
712+
"step1Desc": "انقر على الزر أدناه لنسخ نص الترقية",
713+
"step2Desc": "الصقه في وكيل الذكاء الاصطناعي الذي يشغّل وكيل PeerClaw هذا",
714+
"step3": "الوكيل يرقّي CLI",
715+
"step3Desc": "سيقوم وكيلك بتحديث CLI وإرسال نبضة قلب لتأكيد الإصدار الجديد"
716+
},
694717
"reinstall": {
695718
"title": "إعادة تثبيت Agent SDK",
696719
"button": "إعادة تثبيت Agent",

web/app/src/i18n/locales/en.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,29 @@
652652
"footer": {
653653
"copyright": "PeerClaw {{year}}. Open Source."
654654
},
655+
"promptGuide": {
656+
"step1": "Copy the prompt",
657+
"step1Desc": "Click the button below to copy the installation prompt to your clipboard",
658+
"step2": "Send to your AI Agent",
659+
"step2Desc": "Paste the prompt into your AI agent's chat (Claude, ChatGPT, or any LLM-powered agent)",
660+
"step3": "Agent completes setup",
661+
"step3Desc": "Your agent will execute the steps automatically and register with PeerClaw",
662+
"viewPrompt": "View full prompt",
663+
"hidePrompt": "Hide prompt",
664+
"tip": "This prompt contains step-by-step instructions that your AI agent can follow. You don't need to read it yourself — just copy and paste."
665+
},
666+
"reinstallGuide": {
667+
"step1Desc": "Click the button below to copy the reinstallation prompt",
668+
"step2Desc": "Paste it into the same AI agent that originally set up this agent",
669+
"step3": "Agent reinstalls SDK",
670+
"step3Desc": "Your agent will back up the keypair, reinstall the CLI, and verify the configuration"
671+
},
672+
"upgradeGuide": {
673+
"step1Desc": "Click the button below to copy the upgrade prompt",
674+
"step2Desc": "Paste it into the AI agent running this PeerClaw agent",
675+
"step3": "Agent upgrades CLI",
676+
"step3Desc": "Your agent will update the CLI and send a heartbeat to confirm the new version"
677+
},
655678
"reinstall": {
656679
"title": "Reinstall Agent SDK",
657680
"button": "Reinstall Agent",

web/app/src/i18n/locales/es.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,29 @@
691691
"sdk_outdated": "SDK desactualizado"
692692
}
693693
},
694+
"promptGuide": {
695+
"step1": "Copie el prompt",
696+
"step1Desc": "Haga clic en el botón de abajo para copiar el prompt de instalación al portapapeles",
697+
"step2": "Envíe a su AI Agent",
698+
"step2Desc": "Pegue el prompt en el chat de su agente de IA (Claude, ChatGPT o cualquier agente LLM)",
699+
"step3": "El Agent completa la configuración",
700+
"step3Desc": "Su Agent ejecutará los pasos automáticamente y se registrará en PeerClaw",
701+
"viewPrompt": "Ver prompt completo",
702+
"hidePrompt": "Ocultar prompt",
703+
"tip": "Este prompt contiene instrucciones paso a paso que su agente de IA puede seguir. No necesita leerlo usted mismo — simplemente copie y pegue."
704+
},
705+
"reinstallGuide": {
706+
"step1Desc": "Haga clic en el botón de abajo para copiar el prompt de reinstalación",
707+
"step2Desc": "Péguelo en el mismo agente de IA que configuró originalmente este Agent",
708+
"step3": "El Agent reinstala el SDK",
709+
"step3Desc": "Su Agent respaldará el par de claves, reinstalará el CLI y verificará la configuración"
710+
},
711+
"upgradeGuide": {
712+
"step1Desc": "Haga clic en el botón de abajo para copiar el prompt de actualización",
713+
"step2Desc": "Péguelo en el agente de IA que ejecuta este Agent de PeerClaw",
714+
"step3": "El Agent actualiza el CLI",
715+
"step3Desc": "Su Agent actualizará el CLI y enviará un heartbeat para confirmar la nueva versión"
716+
},
694717
"reinstall": {
695718
"title": "Reinstalar Agent SDK",
696719
"button": "Reinstalar Agent",

web/app/src/i18n/locales/fr.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,29 @@
691691
"sdk_outdated": "SDK obsolète"
692692
}
693693
},
694+
"promptGuide": {
695+
"step1": "Copiez le prompt",
696+
"step1Desc": "Cliquez sur le bouton ci-dessous pour copier le prompt d'installation dans le presse-papiers",
697+
"step2": "Envoyez à votre AI Agent",
698+
"step2Desc": "Collez le prompt dans le chat de votre agent IA (Claude, ChatGPT ou tout agent LLM)",
699+
"step3": "L'Agent termine la configuration",
700+
"step3Desc": "Votre Agent exécutera automatiquement les étapes et s'inscrira sur PeerClaw",
701+
"viewPrompt": "Voir le prompt complet",
702+
"hidePrompt": "Masquer le prompt",
703+
"tip": "Ce prompt contient des instructions étape par étape que votre agent IA peut suivre. Vous n'avez pas besoin de le lire — copiez et collez simplement."
704+
},
705+
"reinstallGuide": {
706+
"step1Desc": "Cliquez sur le bouton ci-dessous pour copier le prompt de réinstallation",
707+
"step2Desc": "Collez-le dans l'agent IA qui a initialement configuré cet Agent",
708+
"step3": "L'Agent réinstalle le SDK",
709+
"step3Desc": "Votre Agent sauvegardera la paire de clés, réinstallera le CLI et vérifiera la configuration"
710+
},
711+
"upgradeGuide": {
712+
"step1Desc": "Cliquez sur le bouton ci-dessous pour copier le prompt de mise à jour",
713+
"step2Desc": "Collez-le dans l'agent IA qui exécute cet Agent PeerClaw",
714+
"step3": "L'Agent met à jour le CLI",
715+
"step3Desc": "Votre Agent mettra à jour le CLI et enverra un heartbeat pour confirmer la nouvelle version"
716+
},
694717
"reinstall": {
695718
"title": "Réinstaller Agent SDK",
696719
"button": "Réinstaller Agent",

web/app/src/i18n/locales/ja.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,29 @@
691691
"sdk_outdated": "SDKが古いバージョン"
692692
}
693693
},
694+
"promptGuide": {
695+
"step1": "プロンプトをコピー",
696+
"step1Desc": "下のボタンをクリックしてインストールプロンプトをクリップボードにコピー",
697+
"step2": "AI Agent に送信",
698+
"step2Desc": "AI Agent のチャットにプロンプトを貼り付けてください(Claude、ChatGPT、その他の LLM Agent)",
699+
"step3": "Agent がセットアップを完了",
700+
"step3Desc": "Agent が自動的に手順を実行し、PeerClaw に登録します",
701+
"viewPrompt": "プロンプト全文を表示",
702+
"hidePrompt": "プロンプトを非表示",
703+
"tip": "このプロンプトには AI Agent が従うステップバイステップの指示が含まれています。自分で読む必要はありません — コピーして貼り付けるだけです。"
704+
},
705+
"reinstallGuide": {
706+
"step1Desc": "下のボタンをクリックして再インストールプロンプトをコピー",
707+
"step2Desc": "この Agent を最初にセットアップした AI Agent に貼り付けてください",
708+
"step3": "Agent が SDK を再インストール",
709+
"step3Desc": "Agent がキーペアをバックアップし、CLI を再インストールして構成を確認します"
710+
},
711+
"upgradeGuide": {
712+
"step1Desc": "下のボタンをクリックしてアップグレードプロンプトをコピー",
713+
"step2Desc": "この PeerClaw Agent を実行している AI Agent に貼り付けてください",
714+
"step3": "Agent が CLI をアップグレード",
715+
"step3Desc": "Agent が CLI を更新し、新バージョンを確認するハートビートを送信します"
716+
},
694717
"reinstall": {
695718
"title": "Agent SDK の再インストール",
696719
"button": "Agent を再インストール",

web/app/src/i18n/locales/pt.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,29 @@
691691
"sdk_outdated": "SDK desatualizado"
692692
}
693693
},
694+
"promptGuide": {
695+
"step1": "Copie o prompt",
696+
"step1Desc": "Clique no botão abaixo para copiar o prompt de instalação para a área de transferência",
697+
"step2": "Envie para seu AI Agent",
698+
"step2Desc": "Cole o prompt no chat do seu agente de IA (Claude, ChatGPT ou qualquer agente LLM)",
699+
"step3": "Agent conclui a configuração",
700+
"step3Desc": "Seu Agent executará as etapas automaticamente e se registrará no PeerClaw",
701+
"viewPrompt": "Ver prompt completo",
702+
"hidePrompt": "Ocultar prompt",
703+
"tip": "Este prompt contém instruções passo a passo que seu agente de IA pode seguir. Você não precisa lê-lo — apenas copie e cole."
704+
},
705+
"reinstallGuide": {
706+
"step1Desc": "Clique no botão abaixo para copiar o prompt de reinstalação",
707+
"step2Desc": "Cole no mesmo agente de IA que configurou este Agent originalmente",
708+
"step3": "Agent reinstala o SDK",
709+
"step3Desc": "Seu Agent fará backup do par de chaves, reinstalará o CLI e verificará a configuração"
710+
},
711+
"upgradeGuide": {
712+
"step1Desc": "Clique no botão abaixo para copiar o prompt de atualização",
713+
"step2Desc": "Cole no agente de IA que executa este PeerClaw Agent",
714+
"step3": "Agent atualiza o CLI",
715+
"step3Desc": "Seu Agent atualizará o CLI e enviará um heartbeat para confirmar a nova versão"
716+
},
694717
"reinstall": {
695718
"title": "Reinstalar Agent SDK",
696719
"button": "Reinstalar Agent",

web/app/src/i18n/locales/ru.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,29 @@
691691
"sdk_outdated": "SDK устарел"
692692
}
693693
},
694+
"promptGuide": {
695+
"step1": "Скопируйте промпт",
696+
"step1Desc": "Нажмите кнопку ниже, чтобы скопировать промпт установки в буфер обмена",
697+
"step2": "Отправьте вашему AI Agent",
698+
"step2Desc": "Вставьте промпт в чат вашего AI-агента (Claude, ChatGPT или любой LLM-агент)",
699+
"step3": "Agent завершает настройку",
700+
"step3Desc": "Ваш Agent автоматически выполнит шаги и зарегистрируется в PeerClaw",
701+
"viewPrompt": "Показать полный промпт",
702+
"hidePrompt": "Скрыть промпт",
703+
"tip": "Этот промпт содержит пошаговые инструкции для вашего AI-агента. Вам не нужно читать его самим — просто скопируйте и вставьте."
704+
},
705+
"reinstallGuide": {
706+
"step1Desc": "Нажмите кнопку ниже, чтобы скопировать промпт переустановки",
707+
"step2Desc": "Вставьте его в AI-агент, который изначально настроил этого Agent",
708+
"step3": "Agent переустанавливает SDK",
709+
"step3Desc": "Ваш Agent создаст резервную копию ключей, переустановит CLI и проверит конфигурацию"
710+
},
711+
"upgradeGuide": {
712+
"step1Desc": "Нажмите кнопку ниже, чтобы скопировать промпт обновления",
713+
"step2Desc": "Вставьте его в AI-агент, запускающий этого PeerClaw Agent",
714+
"step3": "Agent обновляет CLI",
715+
"step3Desc": "Ваш Agent обновит CLI и отправит heartbeat для подтверждения новой версии"
716+
},
694717
"reinstall": {
695718
"title": "Переустановить Agent SDK",
696719
"button": "Переустановить Agent",

web/app/src/i18n/locales/zh.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,29 @@
695695
"sdk_outdated": "SDK 版本过旧"
696696
}
697697
},
698+
"promptGuide": {
699+
"step1": "复制提示词",
700+
"step1Desc": "点击下方按钮将安装提示词复制到剪贴板",
701+
"step2": "发送给你的 AI Agent",
702+
"step2Desc": "将提示词粘贴到你的 AI Agent 对话中(Claude、ChatGPT 或任何 LLM 驱动的 Agent)",
703+
"step3": "Agent 完成设置",
704+
"step3Desc": "你的 Agent 将自动执行步骤并注册到 PeerClaw",
705+
"viewPrompt": "查看完整提示词",
706+
"hidePrompt": "隐藏提示词",
707+
"tip": "此提示词包含你的 AI Agent 可以遵循的分步指引。你无需自己阅读——只需复制粘贴即可。"
708+
},
709+
"reinstallGuide": {
710+
"step1Desc": "点击下方按钮复制重装提示词",
711+
"step2Desc": "粘贴到最初设置此 Agent 的 AI Agent 对话中",
712+
"step3": "Agent 重装 SDK",
713+
"step3Desc": "你的 Agent 将备份密钥对、重装 CLI 并验证配置"
714+
},
715+
"upgradeGuide": {
716+
"step1Desc": "点击下方按钮复制升级提示词",
717+
"step2Desc": "粘贴到运行此 PeerClaw Agent 的 AI Agent 对话中",
718+
"step3": "Agent 升级 CLI",
719+
"step3Desc": "你的 Agent 将更新 CLI 并发送心跳以确认新版本"
720+
},
698721
"reinstall": {
699722
"title": "重装 Agent SDK",
700723
"button": "重装 Agent",

0 commit comments

Comments
 (0)