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(wizard): persist configured platforms incrementally

cyh42a1764d7483
diff --git a/ui/src/components/Wizard.tsx b/ui/src/components/Wizard.tsx
index 6b6f2e77b..f5e4ed210 100644
--- a/ui/src/components/Wizard.tsx
+++ b/ui/src/components/Wizard.tsx
@@ -13,13 +13,30 @@ import { ChannelList } from './steps/ChannelList';
import { Summary } from './steps/Summary';
import { useApi } from '../context/ApiContext';
import clsx from 'clsx';
-import { getEnabledPlatforms, getPrimaryPlatform, platformSupportsChannels } from '../lib/platforms';
+import {
+ WORKBENCH_PLATFORM_ID,
+ getEnabledPlatforms,
+ getPrimaryPlatform,
+ platformHasRunnableConfig,
+ platformSupportsChannels,
+} from '../lib/platforms';
import { withoutConfiguredSecretMarker, withSecretDraft, withSecretDrafts } from '../lib/secretFields';
import { WizardChrome } from './visual';
-const buildConfigPayload = (data: any) => {
- const enabledPlatforms = getEnabledPlatforms(data);
+const getPrimaryPlatformForEnabledSet = (data: any, enabledPlatforms: string[]) => {
const primaryPlatform = getPrimaryPlatform(data);
+ if (enabledPlatforms.includes(primaryPlatform)) {
+ return primaryPlatform;
+ }
+ return enabledPlatforms[0] || WORKBENCH_PLATFORM_ID;
+};
+
+const getPersistableWizardPlatforms = (data: any) =>
+ getEnabledPlatforms(data).filter((platform) => platformHasRunnableConfig(data, platform));
+
+const buildConfigPayload = (data: any, enabledPlatformOverride?: string[]) => {
+ const enabledPlatforms = enabledPlatformOverride ?? getEnabledPlatforms(data);
+ const primaryPlatform = getPrimaryPlatformForEnabledSet(data, enabledPlatforms);
return {
platform: primaryPlatform,
@@ -259,9 +276,9 @@ export const Wizard: React.FC = () => {
mergedData.platforms ||
mergedData.platform ||
mergedData.channelConfigsByPlatform
- );
+ );
if (shouldPersistConfig) {
- await api.saveConfig(buildConfigPayload(mergedData));
+ await api.saveConfig(buildConfigPayload(mergedData, getPersistableWizardPlatforms(mergedData)));
}
const discordGuildAllowlist = stepData?.discordGuildAllowlist;
if (