Skip to content

fix(chat): show the demo brand the real Chat, locked, instead of a Soon preview - #1999

Merged
gkhngyk merged 4 commits into
ansvisor:mainfrom
cihan-gyk:fix/demo-real-chat
Nov 2, 2026
Merged

gkhngyk merged 4 commits into
ansvisor:mainfrom
cihan-gyk:fix/demo-real-chat

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #1998.

On the demo brand, Chat is now the real Chat, locked like the rest of the demo. The "Soon (next week)" preview is gone. This is the owner's decision for the Chat launch (2026-11-03): sending already opens the upgrade dialog there, so nothing runs and no AI is used.

Removed

  • The menu badge: chatSoon in the sidebar and the mobile menu, and its branch in dashboardNavBadge.
  • The old Agent Chat page's demo branch, which showed the preview in place of the page (agent/page.tsx).
  • components/demo/chat-soon-preview.tsx and its test.
  • The Chat v2 mockups the preview framed: web/public/demo/chat/*.html. git grep finds no other use of them in the repo: no link, doc or test.
  • demo.chat.soon, demo.chat.note and demo.chat.frameTitle in en.json.

On the demo brand now

  • New Chat on (CHAT_AGENTIC): Chat opens /dashboard/chat as on any brand. Sending is stopped by useUpgradeGate (isLocked), which opens the upgrade dialog.
  • New Chat off: Chat opens the old Agent Chat page as on any brand. It lists the person's conversations; New chat and sending open the upgrade dialog, as on a read-only workspace. Without a provider key it shows the key step, and the menu says "Set up", as for anyone. Self-hosted installs have no demo brand, so nothing changes for them.

Docs: docs/guides/demo-brand.mdx now says Chat opens as on any brand but locked, and sending a message opens the plans. No Help article mentioned the demo's Chat.

Related issue

None. Chat launch (2026-11-03), owner decision on the demo brand's Chat.

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

  • sidebar.test.tsx and mobile-nav.test.tsx: on the demo brand, Chat is the item any brand has:
    • new Chat off: /dashboard/agent, with "Set up" when there's no key on the cloud;
    • new Chat on: /dashboard/chat;
    • no "Soon" either way.
  • agent/page.test.tsx: on the demo brand, the old Agent Chat lists the conversations and shows no preview frame. New chat and sending open the upgrade dialog and send nothing.
  • dashboard-navigation.test.ts: the badge cases without chatSoon, and demo.chat is gone from en.json.

Run: yarn vitest run src/lib/dashboard-navigation.test.ts src/components/layout src/app/[locale]/(dashboard)/dashboard/agent src/components/demo src/lib/help src/lib/subscription-guard-coverage.test.ts: 14 files, 124 tests pass.

By hand (NEXT_PUBLIC_IS_CLOUD=true, a workspace with the demo brand)

  1. With CHAT_AGENTIC=true, switch to the demo brand.
    • Chat has no badge and opens Chat Home.
    • Typing a message and sending it opens the plan dialog.
  2. With CHAT_AGENTIC unset, restart the web server and switch to the demo brand.
    • Chat opens the Agent Chat page, not a preview.
    • New chat opens the plan dialog.
  3. /demo/chat/CHAT-mockup-v2.html now answers 404.

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 (a71ec45), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41414754898): 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

cihan-gyk and others added 2 commits November 2, 2026 11:26
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]>
…on preview

Owner decision for the Chat launch: on the demo brand, Chat is the real
one, locked as the rest of the demo (useUpgradeGate's isLocked already
opens the upgrade dialog on sending, so nothing runs and no AI is used).
The "Soon (next week)" badge (chatSoon in the sidebar, the mobile menu
and dashboardNavBadge), the old Agent Chat page's demo branch, the
ChatSoonPreview component, the Chat v2 mockups it framed under
web/public/demo/chat and the demo.chat words go. With the new Chat off,
the demo brand gets the Agent Chat page as any brand does, locked as a
read-only workspace. docs/guides/demo-brand.mdx says Chat opens locked.

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

mintlify Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 0d57988.

Approve preview

gkhngyk
gkhngyk previously approved these changes Nov 2, 2026

@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

# Conflicts:
#	web/src/components/layout/mobile-nav.test.tsx
#	web/src/components/layout/mobile-nav.tsx
#	web/src/components/layout/sidebar.test.tsx
#	web/src/components/layout/sidebar.tsx
#	web/src/lib/dashboard-navigation.test.ts
#	web/src/lib/dashboard-navigation.ts

@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 9f7702f into ansvisor:main Nov 2, 2026
6 checks passed
gkhngyk pushed a commit that referenced this pull request Nov 3, 2026
… from the demo's data (#2098)

* feat(demo): show sample chats in the demo brand's Chat

The demo brand showed the real Chat, locked and empty (#1999). A new demo
module (lib/demo/chat.js, DEMO_VERSION 4) now gives each person of the
organization five chats on the demo brand, as if they had asked them: the
questions, the reads Chat made as steps, the "Data used" chips, next moves
under the latest answer, and answers whose figures are counted from the
demo's own answers (stats.js) and link to its Action Center actions and
Content Editor drafts. A chat is its author's, so each person gets their
own copy; someone who joins later gets theirs at the next rebuild.

Sending in one, or starting a chat on the demo brand, is refused with the
server's demo_brand 402 before anything is kept or run (POST
/api/chat/runs), and the page opens the plans, as for a read-only
workspace: an answer on the demo brand would still use the workspace's AI.

Hiding the demo brand (the brand menu, or the purchase) deletes its chats,
since Chat's menu lists a person's chats of every brand; showing it again
marks it stale, so the next visit rebuilds it with them.

chat_conversations is now built by the demo; agent_conversations (the old
Agent chat) is skipped with its reason.

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

* fix(demo): mark the demo's sample chats read, so they list as chats, not Inbox news

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

* fix(demo): name the sites Perplexity cites for the prompts it misses, from the demo's data

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

* fix(demo): open the plans when a skill runs on the demo brand

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

---------

Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
gkhngyk pushed a commit that referenced this pull request Nov 5, 2026
…agents never count (#2102)

* feat(demo): show sample chats in the demo brand's Chat

The demo brand showed the real Chat, locked and empty (#1999). A new demo
module (lib/demo/chat.js, DEMO_VERSION 4) now gives each person of the
organization five chats on the demo brand, as if they had asked them: the
questions, the reads Chat made as steps, the "Data used" chips, next moves
under the latest answer, and answers whose figures are counted from the
demo's own answers (stats.js) and link to its Action Center actions and
Content Editor drafts. A chat is its author's, so each person gets their
own copy; someone who joins later gets theirs at the next rebuild.

Sending in one, or starting a chat on the demo brand, is refused with the
server's demo_brand 402 before anything is kept or run (POST
/api/chat/runs), and the page opens the plans, as for a read-only
workspace: an answer on the demo brand would still use the workspace's AI.

Hiding the demo brand (the brand menu, or the purchase) deletes its chats,
since Chat's menu lists a person's chats of every brand; showing it again
marks it stale, so the next visit rebuilds it with them.

chat_conversations is now built by the demo; agent_conversations (the old
Agent chat) is skipped with its reason.

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

* feat(demo): show sample agents at work in the demo brand's Agent Center

Stacked on the demo's sample chats. The demo brand's Agent Center now has
four agents made from the ready-to-use ones (visibility watch, citation
win-back, competitor watch and a paused weekly report), with their
versions, triggers and run history, each run with its chat (Open run).
Schedules run at their own slots, worded from the demo's own answers; one
win-back run waits on its owner's OK to save a draft, so the Inbox has
something under Needs you.

An agent belongs to the workspace, not to a brand, so 00475 marks the
demo's agents with the demo brand they show (chat_agents.demo_brand_id,
on delete cascade, a partial index, and a trigger that only takes a demo
brand of the agent's own workspace). Nothing runs, counts or pauses them:

- agentForAct refuses every act on one with demo_brand (402: the plans);
- the triggers' active agents, the sweep's failures, the own key's
  resume, the plan's active-agent counts and limit, and what may run
  (Run agent, an action's agents) leave them out;
- settleAgentRun leaves a demo brand's runs as built (the waiting run has
  no Chat run state, so the engine's sweep never sees it either);
- Approve, Skip and an answer on a demo brand's card answer the
  server's demo_brand 402 before anything resumes.

Hiding the demo brand deletes its agents with its chats; showing it again
rebuilds them (DEMO_VERSION 5). chat_agent_runs is now built by the demo.

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

* fix(demo): mark the demo's sample chats read, so they list as chats, not Inbox news

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

* fix(demo): name the sites Perplexity cites for the prompts it misses, from the demo's data

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

* fix(demo): give the demo agent's waiting run its run state, so its card shows, never expired

The events route reads whose run it is from chat_run_state: without it the
waiting run's card never showed (404). Its state has no waiting_since, so
the engine's sweep, which stops a card a week after it was shown, never
picks it up; Approve, Skip and an answer stay refused with demo_brand.

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

* fix(demo): hide Agent Center's active count on the demo brand, whose agents never count

Beside the demo brand's four sample agents the count of active agents (the
plan's, 00475 leaves them out) read 0. On the demo brand there is none; the
plan's count and limit still leave the demo's agents out.

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

* fix(demo): open the plans when a skill runs on the demo brand

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

* fix(demo): delete the sample agents' runs when the demo is hidden, and keep them out of the sweep's settle pass

Review on #2102: a deleted agent's runs stay (agent_id set null), so the
demo's waiting run outlived a hide as a permanent needs_you row, and the
settle pass, reading the 500 oldest open runs, could fill up with them.

- Both hide paths (server hideDemoAgents, web hideDemoBrandAfterPurchase)
  delete the demo brand's chat_agent_runs before its agents.
- The settle pass reads open runs a page at a time and leaves out those
  on a demo brand, so a real run is settled however many demos wait.

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

* fix(demo): keep the demo brand's sample agents out of Can call and run_agent

Main's run_agent (#2052) read an agent's Can call without leaving out the
demo brand's sample agents (00475), so a saved list naming one let another
agent run it. Saving a Can call that names one is now refused (demo_agent,
with its own words), and callableAgentsOf leaves them out, as Run agent's
picker does, so a run never offers or runs one, even one stored before.
Help: the agents article says other agents can't call them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMenyNyxsr2Doq4CaQ3

---------

Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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