Skip to content

fix(chat): drop the Set up badge and its key check with the new Chat on - #1998

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/chat-nav-badges-at-launch
Nov 2, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/chat-nav-badges-at-launch

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Chat's "Set up" menu badge is for the old Agent Chat. With the new Chat on (CHAT_AGENTIC), the sidebar and the mobile menu stop showing it and stop checking for a key.

The problem

  • The badge came from /api/settings/ai-providers (configured).
  • The new Chat runs on the plan's AI limit, and an own key is Enterprise only (lib/chat/key.ts). So every customer without a key saw "Set up", with nothing to set up.
  • The text was also hard-coded in English.

What changes

  • The sidebar and the mobile menu pass isCloud && !chatAgentic to useAgentKeyStatus. With the new Chat on, the key status request is never sent.
  • dashboardNavBadge takes chatAgentic and the badge's words (chatSetUp). It never shows Set up with the new Chat on.
  • "Set up" moves to nav.chatSetUp in en.json.
  • With the new Chat off, nothing changes: same badge, same request, same text.

The flag reaches the menus the way it already does for Agent Center and the /dashboard/chat link: useChatAgentic(), which the dashboard layout fills on the server.

The demo brand's "Soon (next week)" badge is left as it is; it goes in the next PR, together with the rest of the demo's Chat preview.

No Help article describes this badge, so none changes.

Related issue

None. Chat launch check (2026-11-03).

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

Tests

  • dashboard-navigation.test.ts: no Set up with chatAgentic, and the words come from en.json.
  • sidebar.test.tsx and mobile-nav.test.tsx, on the cloud with no key:
    • with the new Chat off: Chat says "Set up", and useAgentKeyStatus probes;
    • with it on: Chat has no badge, and useAgentKeyStatus is never asked to probe.

Run: yarn vitest run src/lib/dashboard-navigation.test.ts src/components/layout/sidebar.test.tsx src/components/layout/mobile-nav.test.tsx src/hooks src/lib/subscription-guard-coverage.test.ts: 11 files, 100 tests pass.

By hand (web/.env.local: NEXT_PUBLIC_IS_CLOUD=true, a workspace with no AI provider key)

  1. With CHAT_AGENTIC unset: the sidebar's Chat says Set up.
  2. Set CHAT_AGENTIC=true and restart the web server.
    • Chat has no badge.
    • The Network tab shows no request to /api/settings/ai-providers.
  3. Repeat 1 and 2 in the mobile menu (narrow window).

Checklist

  • Branch follows the naming convention
  • Commits follow Conventional Commits
  • yarn lint passes (0 errors; 7 old warnings in files this PR doesn't touch)
  • yarn typecheck passes
  • yarn format:check passes
  • Changes are focused — one concern per PR
  • Help article updated under help/ (or no user-visible change)

CI passed on this branch (aa46655), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41414413339): schema is up to date; web format:check, lint, typecheck, all tests and yarn build pass; server lint, format:check and all tests pass.

🤖 Generated with Claude Code

With CHAT_AGENTIC on, Chat runs on the plan's AI limit and an own key is
Enterprise only, so the sidebar's and mobile menu's "Set up" badge asked
every customer without a key to set up something there is nothing to set
up. The menus no longer ask /api/settings/ai-providers for the key status
with the new Chat on, and dashboardNavBadge never shows Set up then. The
words move to en.json (nav.chatSetUp). With the new Chat off, nothing
changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gkhngyk
gkhngyk merged commit deb286d into ansvisor:main Nov 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants