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.

fix(ui): auto-detect agents on enter and replace checkbox with switch toggle

cyhhao617170c6fbbe
diff --git a/ui/src/components/steps/AgentDetection.tsx b/ui/src/components/steps/AgentDetection.tsx
index 04c001869..31163919b 100644
--- a/ui/src/components/steps/AgentDetection.tsx
+++ b/ui/src/components/steps/AgentDetection.tsx
@@ -42,9 +42,7 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on
const isAnyInstalling = Object.values(installingAgents).some(Boolean);
useEffect(() => {
- if (!data.agents) {
- detectAll();
- }
+ detectAll();
}, []);
const detect = async (name: string) => {
@@ -169,14 +167,24 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on
</div>
<div className="flex flex-col gap-4">
- <label className="flex items-center gap-2 text-sm text-text font-medium cursor-pointer w-fit">
- <input
- type="checkbox"
- checked={agent.enabled}
- onChange={(e) => toggle(name, e.target.checked)}
- className="w-4 h-4 text-accent rounded focus:ring-accent border-gray-300"
- />
- {t('common.enabled')}
+ <label className="flex items-center gap-2.5 text-sm text-text font-medium cursor-pointer w-fit select-none">
+ <button
+ role="switch"
+ aria-checked={agent.enabled}
+ onClick={() => toggle(name, !agent.enabled)}
+ className={clsx(
+ 'relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-accent/40',
+ agent.enabled ? 'bg-accent' : 'bg-neutral-300'
+ )}
+ >
+ <span
+ className={clsx(
+ 'inline-block h-3.5 w-3.5 rounded-full bg-white shadow transition-transform',
+ agent.enabled ? 'translate-x-[18px]' : 'translate-x-[3px]'
+ )}
+ />
+ </button>
+ {t('common.enable')}
</label>
<div className="flex-1">
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index 971082fe7..a21bb1977 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -9,6 +9,7 @@
"saved": "Saved",
"saveFailed": "Save failed",
"enabled": "Enabled",
+ "enable": "Enable",
"disabled": "Disabled",
"default": "Default",
"running": "Running",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index 34a51eed2..7f9278c09 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -9,6 +9,7 @@
"saved": "已保存",
"saveFailed": "保存失败",
"enabled": "已启用",
+ "enable": "启用",
"disabled": "已禁用",
"default": "默认",
"running": "运行中",