AI-powered virtual executive team — a single coherent executive persona backed by 8 specialist agents (FastAPI + Next.js).
feat(ui): play the Council Consult animation while the Executive works (#368)
Rufus639f968d2eaa
diff --git a/packages/ui/src/app/globals.css b/packages/ui/src/app/globals.cssindex 1ed9ee85..a3e91115 100644--- a/packages/ui/src/app/globals.css+++ b/packages/ui/src/app/globals.css@@ -103,6 +103,51 @@}}+/* Consult: the Council mark while the Executive works on a reply (CouncilMark+ * with `consulting`). A line reaches from the Executive to each specialist in+ * turn and lights it up, then lets go; the loop starts again from the still+ * mark. The base styles below are that still mark, so with reduced motion+ * (animation: none) nothing is dimmed and no line shows. */+.council-consult circle {+ transform-box: fill-box;+ transform-origin: center;+}+.council-consult .council-spoke {+ stroke-width: 2.5;+ stroke-linecap: round;+ stroke-dasharray: 18;+ stroke-dashoffset: 18;+ opacity: 0;+ animation: council-spoke 3.6s ease-out infinite both;+}+.council-consult .council-seat {+ animation: council-seat 3.6s ease-out infinite both;+}+.council-consult .council-core {+ animation: council-core 3.6s ease-in-out infinite both;+}+@keyframes council-spoke {+ 0% { stroke-dashoffset: 18; opacity: 0.85; }+ 14%, 62% { stroke-dashoffset: 0; opacity: 0.85; }+ 80%, 100% { stroke-dashoffset: 0; opacity: 0; }+}+@keyframes council-seat {+ 0% { opacity: 0.45; transform: scale(1); }+ 8% { opacity: 1; transform: scale(1.28); }+ 20%, 62% { opacity: 1; transform: scale(1); }+ 80%, 100% { opacity: 0.45; transform: scale(1); }+}+@keyframes council-core {+ 0%, 100% { transform: scale(1); }+ 70% { transform: scale(1.14); }+ 78% { transform: scale(1); }+}+@media (prefers-reduced-motion: reduce) {+ .council-consult * {+ animation: none !important;+ }+}+/* Respect user motion preferences. */@media (prefers-reduced-motion: reduce) {*,diff --git a/packages/ui/src/components/BrandMark.tsx b/packages/ui/src/components/BrandMark.tsxindex 78642734..1f161552 100644--- a/packages/ui/src/components/BrandMark.tsx+++ b/packages/ui/src/components/BrandMark.tsx@@ -12,28 +12,75 @@ const MARK_CLASSES: Record<BrandMarkSize, string> = {lg: "w-8 h-8 text-white",};-/** The Council mark alone: the Executive in the middle, five specialists around it. */-export function CouncilMark({ className = "" }: { className?: string }) {+// The five specialists' seats around the Executive at (24, 24).+const SEATS: ReadonlyArray<readonly [number, number]> = [+ [24, 6.5],+ [40.6, 18.6],+ [34.3, 38.2],+ [13.7, 38.2],+ [7.4, 18.6],+];++/**+ * The Council mark alone: the Executive in the middle, five specialists around it.+ *+ * `consulting` plays the Consult animation (globals.css): a line reaches from+ * the Executive to each specialist in turn and lights it up, then lets go.+ * Used while the Executive is working on a reply; with reduced motion it is+ * the still mark.+ */+export function CouncilMark({+ className = "",+ consulting = false,+}: {+ className?: string;+ consulting?: boolean;+}) {return (- <svg viewBox="0 0 48 48" fill="currentColor" className={className} aria-hidden>- <circle cx="24" cy="24" r="7.5" />- <circle cx="24" cy="6.5" r="4" />- <circle cx="40.6" cy="18.6" r="4" />- <circle cx="34.3" cy="38.2" r="4" />- <circle cx="13.7" cy="38.2" r="4" />- <circle cx="7.4" cy="18.6" r="4" />+ <svg+ viewBox="0 0 48 48"+ fill="currentColor"+ className={`${consulting ? "council-consult overflow-visible " : ""}${className}`}+ aria-hidden+ >+ {consulting &&+ SEATS.map(([x, y], i) => (+ <line+ key={`l${i}`}+ className="council-spoke"+ x1="24"+ y1="24"+ x2={x}+ y2={y}+ stroke="currentColor"+ style={{ animationDelay: `${i * 0.18}s` }}+ />+ ))}+ {SEATS.map(([x, y], i) => (+ <circle+ key={`s${i}`}+ className={consulting ? "council-seat" : undefined}+ cx={x}+ cy={y}+ r="4"+ style={consulting ? { animationDelay: `${i * 0.18 + 0.25}s` } : undefined}+ />+ ))}+ <circle className={consulting ? "council-core" : undefined} cx="24" cy="24" r="7.5" /></svg>);}interface BrandMarkProps {size?: BrandMarkSize;+ /** Play the Consult animation, while the Executive is working on a reply. */+ consulting?: boolean;}-export default function BrandMark({ size = "sm" }: BrandMarkProps) {+export default function BrandMark({ size = "sm", consulting = false }: BrandMarkProps) {return (<div className={BOX_CLASSES[size]} aria-hidden>- <CouncilMark className={MARK_CLASSES[size]} />+ <CouncilMark className={MARK_CLASSES[size]} consulting={consulting} /></div>);}diff --git a/packages/ui/src/components/Chat.tsx b/packages/ui/src/components/Chat.tsxindex cc1b334a..ade50959 100644--- a/packages/ui/src/components/Chat.tsx+++ b/packages/ui/src/components/Chat.tsx@@ -667,11 +667,11 @@ export default function Chat({ onDebugEvent, initialMessages, initialSessionId,{status.show && !streamingContent && (<div className="flex gap-4 mb-8"><div className="flex-shrink-0 mt-1">- <BrandMark size="md" />+ <BrandMark size="md" consulting /></div><div className="flex-1 pt-1.5"><div className="text-xs text-fg-muted mb-3 font-medium tracking-wide uppercase">Executive</div>- <TurnStatusRow status={status} committeePhase={committeePhase} />+ <TurnStatusRow status={status} committeePhase={committeePhase} showMark={false} /></div></div>)}diff --git a/packages/ui/src/components/TurnStatusRow.tsx b/packages/ui/src/components/TurnStatusRow.tsxindex 99414132..1933ed7c 100644--- a/packages/ui/src/components/TurnStatusRow.tsx+++ b/packages/ui/src/components/TurnStatusRow.tsx@@ -1,6 +1,7 @@"use client";import { useEffect, useState } from "react";+import { CouncilMark } from "./BrandMark";import CommitteePhaseIndicator from "./CommitteePhaseIndicator";import type { CommitteePhase } from "@/lib/api";import type { TurnStatus } from "@/lib/turnStatus";@@ -39,24 +40,20 @@ export function useTurnClock(isLoading: boolean) {};}+// `showMark` is off where the Executive's avatar beside the row already plays+// the Consult animation, so the turn doesn't show it twice.export default function TurnStatusRow({status,committeePhase,+ showMark = true,}: {status: TurnStatus;committeePhase: CommitteePhase | null;+ showMark?: boolean;}) {return (- <div className="flex items-center gap-2 flex-wrap">- <div className="flex gap-1.5" aria-label="Thinking">- {[0, 1, 2].map((i) => (- <div- key={i}- className="w-1.5 h-1.5 bg-fg-muted rounded-full animate-bounce motion-reduce:animate-none"- style={{ animationDelay: `${i * 0.15}s` }}- />- ))}- </div>+ <div className="flex items-center gap-2 flex-wrap" aria-label="Thinking">+ {showMark && <CouncilMark consulting className="w-4 h-4 text-accent" />}{committeePhase ? (<CommitteePhaseIndicator phase={committeePhase} />) : status.label ? (