Skip to main content

Setup Wizard Design

Date: 2026-05-21 Status: Updated during implementation

Summary

Add a dedicated setup wizard for Volvox.Bot at /dashboard/setup. It launches after the bot is added to a server, remains reachable later, and guides admins through the first settings without blocking access to the dashboard. The root route is a start page with the shared workspace selector; every step has a route at /dashboard/setup/{step} and requires a locked ?guildId=.... The wizard uses a free-jump section checklist:
  1. Welcome
  2. Content safety
  3. Protected roles
  4. Warning rules
  5. Tickets
  6. Reputation
  7. Starboard
  8. Commands
  9. TL;DR
  10. Dashboard roles
  11. AI
  12. Review
Each feature section has an enable/disable control. Disabled sections do not block progress. Enabled sections validate only the choices they need. The AI step is always present and can be completed even when no configured provider is available. Admins can click any step in the rail at any time; validation runs when advancing or saving enabled sections.

Goals

  • Give new admins a polished first-run setup after the Discord invite flow returns them to the dashboard.
  • Let admins configure each setup area directly instead of choosing a broad server preset.
  • Save setup state in guild config so completion follows the server across browsers and admins.
  • Reuse the existing config fetch/save path instead of adding a parallel settings API.
  • Always include AI provider/model selection while allowing completion if no provider is available.
  • Keep the wizard accessible after first run from dashboard chrome.

Non-Goals

  • Do not require setup completion before the dashboard opens.
  • Do not add provider secret entry to this wizard.
  • Do not replace the existing full settings workspace.
  • Do not add a separate database table for setup state.

Entry Points

First Run

The Discord invite callback returns users to /dashboard/welcome, optionally with guildId. After the bot is detected in that guild and the guild is selectable, the welcome flow selects the guild and routes to /dashboard/setup?guildId=<id>. The setup start page explains the flow and lets the admin confirm or change the server before starting /dashboard/setup/welcome?guildId=<id>. If bot detection is delayed, /dashboard/welcome keeps the current server picker and refresh behavior. Do not claim setup is ready before the bot is actually present.

Later Access

Admins can reopen setup from a visible dashboard action:
  • Settings sidebar action named Setup wizard linking to /dashboard/setup.
If setup.completed === true, the route still opens and allows rerunning the wizard. Rerunning saves a new completed state only after the review step succeeds. The setup start page uses the same ServerSelector as the dashboard. Switching servers must use the shared guild-selection bus so the dashboard config context reloads the selected guild before the wizard starts. Step pages do not expose a workspace selector; the selected guild is locked through ?guildId=... so channel and role selectors stay scoped to one server. Step pages include a back-to-server-selection link, but they do not show the header-level server refresh action. Draft state persists in session storage per guild so moving between step pages does not discard previous choices.

Config Model

Add a guild-scoped setup config section:
interface SetupConfig {
  completed: boolean;
  completedAt: string | null;
  presetId: 'community' | 'support' | 'creator' | 'locked-down' | null;
  skippedAt: string | null;
  updatedAt: string | null;
}
presetId remains nullable legacy metadata for compatibility. The section-based wizard writes setup.presetId = null. Required config surfaces:
  • Add setup defaults to config.json.
  • Add setup to SAFE_CONFIG_KEYS and READABLE_CONFIG_KEYS.
  • Add validation schema for all fields.
  • Add setup to BotConfig, ConfigSection, and isGuildConfig().
  • Ensure masked config reads return setup state.
Completion semantics:
  • setup.completed = true only after all required wizard fields validate and the review save succeeds.
  • setup.skippedAt records when the user chooses Set up later.
  • Skipping must not set completed or completedAt.
  • A later successful completion clears skippedAt.

Section Patch Builder

Section definitions live in web/src/lib/setup-sections.ts. The module is pure and testable: given enabled sections, selected channels, selected roles, and selected AI model availability, it returns the config patches to save.
  • Welcome enabled: set welcome.enabled, welcome.channelId, welcome.rulesChannel, welcome message, and rules message.
  • Welcome disabled: set welcome.enabled = false.
  • Content safety enabled: set aiAutoMod.enabled, one default threshold across all safety categories, per-category default safety actions, moderation log routing, spam checks, link filtering, and auditLog.enabled.
  • Content safety disabled: disable AI auto-mod, spam, link filtering, moderation logs, and audit log defaults written by setup.
  • Protected roles enabled: write owner/admin/mod protected-role behavior and selected role IDs.
  • Protected roles disabled: clear setup-managed protected-role defaults.
  • Warning rules enabled: write warning expiry and low/medium/high severity points. Setup clears legacy escalation thresholds instead of asking for them.
  • Warning rules disabled: clear setup-managed warning escalation behavior.
  • Tickets enabled: set tickets.enabled, tickets.panelChannel, tickets.mode, tickets.category, tickets.supportRoles, and legacy tickets.supportRole.
  • Tickets disabled: disable tickets and clear support role routing.
  • Reputation enabled: enable engagement, reputation, XP, XP min/max, and XP cooldown.
  • Reputation disabled: disable engagement, reputation, and XP.
  • Starboard enabled: set starboard.enabled, starboard.channelId, starboard.threshold, starboard.emoji, and starboard.selfStarAllowed.
  • Starboard disabled: disable starboard.
  • Commands enabled: write the command prefix and whether custom prefixes are enabled.
  • Commands disabled: disable setup-managed custom prefix behavior.
  • TL;DR enabled: write tldr.enabled, analysis window (tldr.defaultMessages), max message count, cooldown, and model.
  • TL;DR disabled: disable TL;DR.
  • Roles always write the dashboard permission model.
  • AI writes the selected provider:model to AI chat defaults, triage classify/respond models, TL;DR, and AI auto-mod/content-safety routing when a configured provider/model exists; otherwise AI-backed setup features are disabled.
  • Completion writes setup.completed, setup.completedAt, setup.presetId = null, setup.skippedAt = null, and setup.updatedAt.

Wizard Steps

Welcome

Show a toggle for welcome setup. When enabled, require a welcome channel and allow an optional rules channel.

Content safety

Show a toggle for AI/content safety setup. When enabled, require a moderation log channel, set one threshold across all safety categories, and allow per-category default safety actions.

Protected roles

Show protected role selectors plus owner/admin/mod protection toggles.

Warning rules

Show warning expiry plus low, medium, and high severity point controls. Do not show escalation threshold controls in setup.

Tickets

Show a toggle for ticket setup. When enabled, require a ticket panel channel and allow ticket workflow, support staff roles, and root category selection.

Reputation

Show a toggle for reputation setup. When enabled, turn on engagement, reputation, and XP. Include XP min/max and cooldown controls.

Starboard

Show a toggle for starboard setup. When enabled, require a target channel and allow star threshold, watch emoji (including * for all), and self-star controls.

Commands

Show the custom command prefix and common prefix choices.

TL;DR

Show TL;DR analysis window, max messages, cooldown, and the shared AI model routing note.

Roles

Show role selectors for admin and moderator roles. Also provide a clear path to use Discord’s native owner/admin permission checks without selecting roles.

AI

The AI step is always present. Behavior:
  • Fetch configured providers via the existing configured providers API.
  • Filter models by configured provider and guild tier using the existing provider catalog helpers.
  • Default to the first available model.
  • If no configured provider/model exists, show an unavailable state, disable AI-backed features, and allow completion.
  • Provider API failures behave like no configured provider: AI is unavailable and setup can continue with AI off.
The wizard never asks for provider API keys. Provider secret management belongs outside this flow.

Review

Show a grouped review of the section choices before saving:
  • Feature sections enabled or skipped.
  • Channels and roles selected.
  • AI provider/model selected or AI unavailable state.
  • Setup completion metadata.
Saving uses the existing PUT /api/guilds/{guildId}/config route with a patch array. On success, refetch config, mark setup complete in the UI, and show a clear Open dashboard action.

UX Rules

  • Use the existing dashboard visual system: Button, ChannelSelector, RoleSelector, ServerSelector, AiModelSelect, dashboard cards, and Tailwind tokens.
  • Keep it skippable. Set up later saves skipped metadata but does not mark setup complete.
  • Do not hide the AI step even when no providers are configured.
  • Keep section copy short and operational.
  • Validate on next/save, not on every field focus.
  • Allow jumping to any step from the sidebar at any time.
  • Keep the mobile layout usable with the footer controls visible and no overlapping text.

Tests

  • Config allowlist and validation for setup.
  • Web config type guard for setup.
  • Provider/model filtering by configured provider and guild tier.
  • Section-to-patch mapping for enabled and disabled sections.
  • Step validation only for enabled sections.
  • Setup start page uses the shared dashboard ServerSelector.
  • Setup step pages lock the selected server and do not expose workspace switching.
  • Step rail allows jumping to any step.
  • AI selection uses the shared dashboard model selector and fans out to AI chat, triage, content safety, and TL;DR model routing.
  • Wizard path with AI unavailable still reaches review and saves.
  • Skip path does not mark setup complete.
  • Welcome invite callback routes installed guilds to setup.
  • Settings exposes Setup wizard without adding a persistent dashboard setup prompt.
Last modified on May 27, 2026