Workspaces

If you belong to more than one workspace, switch between them using the AccountSwitcher at the top of the sidebar.

A ChatbotGen user can belong to multiple workspaces (accounts). The AccountSwitcher component at the top of the left sidebar is how you see the current one and move to another.

One workspace vs. many

Verified from AccountSwitcher in app-layout.jsx:

  • multi = accounts.length > 1
  • When multi is false, the switcher button is disabled — no dropdown opens, no chevron is shown, and the button's title attribute is the current workspace's name.
  • When multi is true, clicking the button opens a dropdown; the button's title is "Switch workspace".

What the button shows

┌─ Sidebar header ────────────────┐
│  [logo]  Acme Inc.          ⬍   │
│          billing@acme.com       │
└─────────────────────────────────┘

Two lines inside the button:

  1. Primary: current_account.name, or "Workspace" as fallback
  2. Subtitle: current_account.billing_email, falling back to current_user.email, falling back to "Workspace"

A small up/down chevron (two stacked polylines) appears on the right only when you belong to multiple workspaces.

The dropdown

Clicking the switcher (when multi) opens a popover menu:

┌─ WORKSPACES ─────────────────────┐
│  [logo]  Acme Inc.           ✓   │
│          billing@acme.com         │
│                                  │
│  [logo]  Personal projects       │
│          personal@me.com          │
│                                  │
│  [logo]  Other workspace         │
└──────────────────────────────────┘

At the top, a small uppercase header: WORKSPACES. Then one button per account in accounts, each showing:

  • The brand mark
  • account.name
  • account.billing_email (only when present)
  • A green checkmark on the currently-active workspace

Clicking a workspace row that isn't already active fires router.post("/app/current-account", { account_id: id }).

If you click the active one, switchTo returns early — no request is sent.

What switching does

Verified from CurrentAccountController.create/2:

  1. The controller looks up Accounts.get_account_user(account_id, user.id).
  2. If no membership exists, you get flash "Workspace not found." and a redirect to /app.
  3. If membership exists, the controller stores account_id in the session under current_account_id and redirects to /app.

So every successful switch lands you on the dashboard (/app) — not wherever you were before.

Joining a workspace

There's no self-join. You have to be invited — see Members (from the inviter's side) and Invitations (from yours).

Leaving a workspace

The UI has no "leave" button for yourself. Members can be removed by admins via Members; to leave a workspace you're in, ask an admin there to remove you.