diff --git a/docs/superpowers/specs/2026-06-17-onboarding-channel-config-style.md b/docs/superpowers/specs/2026-06-17-onboarding-channel-config-style.md new file mode 100644 index 00000000..0ca7c839 --- /dev/null +++ b/docs/superpowers/specs/2026-06-17-onboarding-channel-config-style.md @@ -0,0 +1,134 @@ +# Onboarding Channel Config + Style Refactor + +**Date:** 2026-06-17 +**Branch:** poc/onboarding-setup +**Scope:** Two concerns: +1. Notifier/storage steps gain a real two-phase configuration flow (fake data, stored in flowData) +2. All onboarding step cards, toggles, and inputs adopt the org-combobox design language + +--- + +## 1. Configuration Flow — Notifier & Storage Steps + +### Goal + +When a user clicks a provider in the notifier or storage step, they should be able to configure it (Slack webhook URL, S3 credentials, etc.) before it is added to their list. Data is stored in `flowData` only — no server actions are called during onboarding. + +### Phase Machine + +Each step manages a local phase: + +```ts +type Phase = + | { kind: "grid" } + | { kind: "configuring"; provider: string } +``` + +**Phase "grid"** +- Shows the provider selection grid (style: see Section 2) +- Already-configured providers show at top with check badge and remove button +- Unconfigured providers are clickable → transition to `configuring` +- "Continue" button visible if at least 0 channels configured (step is optional) +- "Add another" link/button visible when at least 1 configured + +**Phase "configuring"** +- Header: provider icon + name + "Back" button (returns to grid, no save) +- Channel name `Input` (required, min 5 chars per existing schema) +- `renderChannelForm(provider, form)` renders the provider-specific fields +- `useZodForm` with `NotificationChannelFormSchema` (notifier) or `StorageChannelFormSchema` (storage) +- Submit validates → appends `{ id: crypto.randomUUID(), provider, label, name, config }` to local channels list → returns to grid phase +- No server action called + +### Updated `OnboardingChannel` type + +```ts +export type OnboardingChannel = { + id: string; + provider: string; + label: string; + name: string; + config: Record; +}; +``` + +`step-defaults.tsx` reads `id` and `label` from notifiers/storages — unchanged, continues to work. + +### Files + +- `src/features/onboarding/onboarding.types.ts` — extend `OnboardingChannel` +- `src/features/onboarding/steps/step-notifier.tsx` — full rewrite +- `src/features/onboarding/steps/step-storage.tsx` — full rewrite + +### Dependencies reused + +- `renderChannelForm` from `@/features/channel/channels-helpers` +- `NotificationChannelFormSchema` / `StorageChannelFormSchema` from `@/features/channel/channel-form.schema` +- `useZodForm`, `Form`, `FormField`, `FormItem`, `FormLabel`, `FormControl`, `FormMessage` from `@/components/ui/form` +- `notificationProviders` / `storageProviders` from their respective helpers + +--- + +## 2. Style Refactor — All Onboarding Steps + +### Goal + +Replace hardcoded dark colors and inconsistent `