Skip to content

feat(ui): add the shared agent pieces: avatar, status pill, list dot, New pill and badge - #1760

Merged
gkhngyk merged 8 commits into
ansvisor:mainfrom
cihan-gyk:feature/chat-agentic-ui
Oct 29, 2026
Merged

gkhngyk merged 8 commits into
ansvisor:mainfrom
cihan-gyk:feature/chat-agentic-ui

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Chat P0, part D1: the agent's shared pieces that Chat, the runs tray and agent tasks reuse, plus a preview page for design sign-off. The design was approved by the product owner on 2026-10-29, from the local preview in light and dark mode at 1024 px. Every piece follows the approved Chat v2 mockup (CHAT-mockup-v2.html, and CHAT-mockup-v2-governance.html for the Agents list).

web/src/components/agentic/

Piece States
AgentAvatar (30/26/22 px) idle, working, waiting ("needs you"), done, failed. tone="muted" is the Agents list's look: still, grey when idle, paused or stopped, with a steady amber ring when it needs you. In chat it stays black and alive.
StatusPill Working, Answering, Needs you, Done, Answered, Ready, Plan ready, Draft, Failed
ApprovalPill Auto, Asks you, Auto · logged, Needs your click (the one dark pill), Done
StepMarker not started, running, needs you, failed, done
ListDot, ListProgress running, needs you, done, failed, idle, paused; the thin progress line
DotLegend "What the dots mean" popover: Esc closes it and focus returns to its button
NewPill, AttentionDot, AttentionCount, DoneTick the grey-bordered New, the amber dot on a menu icon, its count, the green tick
  • Screen readers: each piece says its state ("Agent · working", "Step 2 · Running"). A piece can be hidden from them where text beside it says the same.
  • Click targets: each clickable control has a data-action id (CHAT-23).
  • Motion: everything stops under prefers-reduced-motion.
  • Colours: greens, ambers and reds are the exact DESIGN-POLISH values (Tailwind green, amber, red), each with a dark: pair. Greys use theme tokens. The spark's gold is --color-agent-spark.
  • Text: in web/messages/en.json › agentic.

Preview: /dashboard/chat/preview shows every piece in every state.

  • It is server-side gated by CHAT_AGENTIC, and by CHAT_AGENTIC_ORGS when that is set.
  • With the flag off, or for an organization not on the list, it is a 404. It has no menu link.

Related issue

None (Chat P0, Drive › Chat).

Stacked on #1758 (Chat A1, for the flag). Independent of #1759. The diff against #1758 holds only this change.

Type of change

  • feat — New feature (behind CHAT_AGENTIC)

How to test

  1. In web/.env.local set CHAT_AGENTIC=true and restart yarn dev.
  2. Open /dashboard/chat/preview.
  3. Check light and dark mode, and turn on Reduce motion: nothing moves.
  4. Click "?" by the list dots: the legend opens, and Esc closes it.

Screenshots

Light and dark at 1024 px were checked in the browser; screenshots are available on request.

Checklist

  • Branch follows the naming convention
  • Commits follow Conventional Commits
  • Web: format, lint (0 errors, 7 warnings), typecheck and build pass. Tests: 560 of 561 files. content/editor/[draftId]/_before-publish.test.tsx failed on the focus race that test(content): wait for the dialog's first focus before opening the JSON-LD code #1753 fixes; this branch doesn't touch it.
  • Browser check: light, dark, 1024 px, legend, no horizontal scroll
  • Design approved by the product owner

🤖 Generated with Claude Code

cihan-gyk and others added 7 commits October 29, 2026 12:51
…eams

The first part of the new Chat (Drive Chat specs, P0 part A1). Nothing
uses it yet, and with the flag off nothing changes: today's
/dashboard/agent keeps its own tables and code.

- CHAT_AGENTIC turns the new Chat on, read on the server at request time
  (web lib/chat/flag.ts, server lib/chat-flag.js), so the same build runs
  with it on or off. CHAT_AGENTIC_ORGS narrows it to listed workspaces.
  Off unless "true", so a self-hosted install sees nothing new.
- 00400 adds chat_conversations, chat_messages, chat_runs, chat_run_steps
  and chat_user_prefs. A chat is private to its author (CHAT-20 §16c):
  only they read it, admins included, and messages, runs and steps follow
  their chat's policies, so sharing with the team can be one more policy
  later. The server writes them; a person writes only their own Chat
  settings (menu, where pages open, focus areas, model, effort), kept on
  the server so they follow them across devices (DECISIONS N3).
- A step's tool and debug record stay with the server: members are
  granted every other column. Step kinds live in chat_step_kinds, so a
  new kind is an inserted row, not a rewritten check.
- web lib/chat/events.ts types every event a run streams (CHAT-00, with
  room for CHAT-25's), names steps by their place in the run, and
  chatEvent() refuses a tool's name, a debug record, an id or a dollar
  amount before an event reaches the browser.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A deleted brand now leaves its chats with their author, as about the
workspace, the way agent_conversations does (00009), rather than
deleting a person's private history with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd add app links and the step converter

A uuid in an event's text (a page path, a link the person pasted) no
longer stops the run: chatEvent() shows it as "…". The answer's own text
is still sent as it is, and forbidden keys still throw.

- Forbidden keys are patterns now, in the type (ChatForbiddenKey) and at
  run time alike: any tool key (toolInput, toolResult…) and params; debug,
  tokens and latency; money (usd, price, amount, spend, cost, cents). A
  cost multiplier, a percent and a tooltip still pass.
- Deliverable cards and page.opened get an optional href for their Open
  (CHAT-06, CHAT-25): a path under /dashboard/ only, with no host, query,
  fragment, "//" or ".." part, kept whole by the masking.
- steps.ts holds chat_run_steps' member columns (every one but tool and
  debug_json, checked against the migration's grant) and toClientStep(),
  the one way a stored step reaches the browser: built field by field, so
  a row read with the service role gives up its tool and debug record too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ch new message

- chat_user_prefs.focus holds at most the 8 areas, each once
  (chat_text_array_distinct: a check can't hold a subquery); the model
  column says the server checks it against the catalog before a run.
- A trigger on chat_messages sets its chat's last_message_at (security
  definer, so it reaches the chat whoever writes the message; it never
  moves back).
- The step kinds comment no longer says a kind can be removed: steps
  keep theirs, and there is no index on kind to find out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y be read

A change applies when the app starts again: a restart when self-hosted,
a new deployment on Vercel. The web flag is for dynamic server code only;
a page rendered at build time would keep the build's value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… New pill and badge

Chat P0, part D1: the pieces Chat and Content Editor share (Chat agentic
plan §2), copied from the approved Chat v2 mockups, and a page to sign
them off. Nothing uses them yet.

- components/agentic: the agent avatar (idle, working, waiting, done; it
  breathes, bobs and sweeps while working, an amber ring grows out of it
  while it waits, no spinning ring), the status pill beside a title, the
  approval pills of a step (Auto, Asks you, Auto · logged, Needs your
  click, Done), the step marker (not started, running, needs you,
  failed, done), the list dot with its progress line and the "What the
  dots mean" legend (chatMenu.dotLegend), the outlined New pill, the
  attention dot and count, and the done tick.
- Each says its state to a screen reader, or hides when the words beside
  it already do; coloured states have their dark-theme colours; every
  motion stops with reduced motion.
- /dashboard/chat/preview shows every piece in every state, only with
  CHAT_AGENTIC on for the workspace (not found otherwise), and is not in
  the menu.

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

The owner's sign-off on the shared agent pieces (Chat P0, D1):

- The avatar turns soft red when a run stops on a failed step, as the
  Chat v2 mockup's failed run shows it; the failure card (D2) uses it.
- tone="muted" is the Agents list look from the governance mockup: the
  avatar sits still, with no spark; an idle, paused or stopped agent is a
  grey tile, and one waiting for the person wears a fixed amber ring.
  Chat keeps the dark, moving avatar by default.
- The legend's "?" button says "What the dots mean", as the legend it
  opens does, not "What the colors mean".
- The preview page shows the failed state and the Agents list avatars.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the needs-migration Adds or edits a migration — apply it to the hosted database label Oct 29, 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.

Looks good.

What I checked

  • Flag off changes nothing. The one new route is /dashboard/chat/preview, a server component.
    • It reads the user from the session and their profiles.organization_id, then calls chatAgenticEnabled(orgId).
    • Anything but on for that workspace is notFound(), and so is a signed-out visitor.
    • The read uses cookies, so the page is rendered per request, and the flag isn't frozen at build time.
    • It isn't linked from the menu.
    • The tests cover CHAT_AGENTIC unset, '' and 'false', a workspace not in CHAT_AGENTIC_ORGS (and the list's case and spaces), and signed out.
  • Components (components/agentic).
    • They are presentational. The only client component is DotLegend (a Popover), and there's no data fetching, effect, storage or dangerouslySetInnerHTML.
    • Every animation also has motion-reduce:animate-none.
    • The status pills and dots carry text labels, not colour alone.
    • The legend's trigger has an aria-label.
    • The only control on the page has a data-action id (chatMenu.dotLegend), and the test checks for it.
  • CSS. globals.css adds a @theme block of keyframes, one colour token and the animate-* utilities. Nothing existing is redefined.
  • Copy. The agentic.* strings in en.json are plain English. On main merged with #1759, en.json conflicts only because both add a top-level block at the same place, so keep both.
  • No PostgREST embeds. No migration.
  • Tests: components/agentic and the preview page test pass. tsc, eslint and the format check pass on the stack merged with main.

Follow-ups

  1. When Chat ships, the preview page can go, or stay staff-only. As it is, any member of a workspace with Chat on can open it, which is harmless (it shows only static samples).

@gkhngyk
gkhngyk merged commit a8697ae into ansvisor:main Oct 29, 2026
4 of 5 checks passed
@github-actions github-actions Bot removed the needs-migration Adds or edits a migration — apply it to the hosted database label Oct 29, 2026
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