Skip to content

Sidebar: show a "Set up" badge on the Agent item while the API key isn't configured #456

Closed

Description

@gkhngyk

Problem

The Agent sits in the sidebar's top group, but on cloud it only works after an admin saves the org's Anthropic API key in Settings. Until then, clicking it lands on the "Add your Anthropic API key" CTA — from internal feedback, the item reads as a broken/dead entry rather than a feature awaiting one-time setup.

Moving the item to another group was considered and rejected: the agent's toolset spans the whole product (visibility summaries, trends, competitor SoV, citations, prompts — not just optimization), so its placement is right; what's missing is a signal that setup is pending.

Fix

Show a small "Set up" badge on the Agent nav item while the org has no Anthropic key configured (cloud only — self-host uses an env key and doesn't need this).

Pointers:

  • NavItem already supports a badge?: string field (web/src/config/dashboard.ts) and the sidebar renders it (web/src/components/layout/sidebar.tsx) — but that config is static; this badge is conditional, so it needs a dynamic override where the sidebar maps items (e.g. if (item.href === '/dashboard/agent' && agentKeyMissing) badge = 'Set up').
  • Key status is already exposed by GET /api/settings/anthropic-key (returns { configured }) — the same probe the agent page's cloud wrapper uses (web/src/app/[locale]/(dashboard)/dashboard/agent/page.tsx, see CloudAgentGate). Probe once per session (e.g. in the sidebar with a module-level cache, or alongside an existing provider) — do not re-fetch on every navigation.
  • Gate on cloud with process.env.NEXT_PUBLIC_IS_CLOUD === 'true', mirroring the agent page.
  • Mobile nav (web/src/components/layout/mobile-nav.tsx) should show the same badge if it renders badges.

Acceptance criteria

  • Cloud org without a saved Anthropic key: the Agent sidebar item shows a "Set up" badge; clicking still lands on the existing Settings CTA.
  • After the key is saved, the badge disappears (on next load is fine — no realtime requirement).
  • Self-host: no badge, no new network calls.
  • No layout shift for other nav items; collapsed-sidebar mode stays intact.

Getting started

See CONTRIBUTING.md for setup. From web/, yarn lint, yarn typecheck and yarn format:check must pass. Comment here to claim the issue before opening a PR.

Activity

  1. added
    enhancement
    good first issue
    on Jul 17, 2026
  2. added a commit that references this issue on Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions