onboarding

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package onboarding provides the onboarding flow for new users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the onboarding orchestrator.

func New

func New(
	ctx context.Context,
	theme styles.Theme,
	services api.APIServices,
	userPrefs preferences.UserPreferences,
	orgPrefs preferences.OrgPreferences,
	authService iauth.Auth,
	syncer powersync.Syncer,
	scope log.Scope,
) *Model

New creates a new onboarding model.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init starts the onboarding flow with auth check.

func (*Model) SetOrgPreferences added in v1.11.0

func (m *Model) SetOrgPreferences(prefs preferences.OrgPreferences)

SetOrgPreferences replaces the org preferences used by subsequent onboarding steps. Called by the app when switching to a different organization.

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize updates the model's dimensions.

func (*Model) ShortHelp

func (m *Model) ShortHelp() []key.Binding

ShortHelp returns the key bindings for the short help view.

func (*Model) StartFromOrgSelect

func (m *Model) StartFromOrgSelect() tea.Cmd

StartFromOrgSelect starts the onboarding flow at the organization selection step, skipping auth check and role selection. Used when switching orgs or accounts — the caller clears the relevant preferences so onboarding prompts for selection instead of auto-selecting.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) tea.Cmd

Update handles messages and orchestrates step transitions.

func (*Model) View

func (m *Model) View() string

View renders the current step.

type Step

type Step interface {
	// Init returns the initial command for the step.
	Init() tea.Cmd

	// Update handles a message and returns a command.
	// Steps emit completion messages (from msgs package) when done.
	Update(msg tea.Msg) tea.Cmd

	// View renders the step.
	View() string

	// SetSize updates the step's dimensions.
	SetSize(width, height int)

	// ShortHelp returns the key bindings for the short help view.
	ShortHelp() []key.Binding
}

Step represents a single step in the onboarding flow.

Directories

Path Synopsis
Package accounts provides account selection and creation steps.
Package accounts provides account selection and creation steps.
Package auth provides authentication steps for onboarding.
Package auth provides authentication steps for onboarding.
Package datadog provides Datadog configuration steps.
Package datadog provides Datadog configuration steps.
Package msgs defines the messages emitted by onboarding steps.
Package msgs defines the messages emitted by onboarding steps.
Package organizations provides organization selection and creation steps.
Package organizations provides organization selection and creation steps.
Package role provides the role selection step for onboarding.
Package role provides the role selection step for onboarding.
Package sync provides the sync step for onboarding.
Package sync provides the sync step for onboarding.
Package workspaces provides workspace selection steps.
Package workspaces provides workspace selection steps.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL