.pds-agent-tree {
--agent-tree-arrival-duration: 800ms;
--agent-tree-card-width: 15rem;
--agent-tree-col: 1;
--agent-tree-gap: var(--pds-spacing-xs);
--agent-tree-message-width: 36rem;
--agent-tree-indent: calc(var(--pds-spacing-xs) * 3);
box-sizing: border-box;
color: var(--pds-color-foreground-default-secondary);
position: relative;
width: 100%;
}
/* ----- Bar: the project switcher ----- */
.pds-agent-tree__bar {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: var(--pds-spacing-2xs);
margin-block-end: var(--pds-spacing-m);
min-width: 0;
}
.pds-agent-tree__projects {
flex: 0 1 auto;
min-width: 0;
}
/* ----- The tree ----- */
.pds-agent-tree__tree {
display: grid;
grid-template-columns: minmax(0, 1fr);
justify-items: center;
position: relative;
}
/* Hidden probe: the script reads the card width, the indent and the gap from
it, so the tokens stay the one source of the sizes. */
.pds-agent-tree__probe {
height: 0;
overflow: hidden;
pointer-events: none;
position: absolute;
visibility: hidden;
width: 0;
}
.pds-agent-tree__probe-card {
display: block;
width: var(--agent-tree-card-width);
}
.pds-agent-tree__probe-indent {
display: block;
width: var(--agent-tree-indent);
}
.pds-agent-tree__probe-gap {
display: block;
width: var(--agent-tree-gap);
}
.pds-agent-tree__links {
left: 0;
overflow: visible;
pointer-events: none;
position: absolute;
top: 0;
}
.pds-agent-tree__dots {
z-index: 2;
}
.pds-agent-tree__link {
animation: agent-tree-draw 520ms ease-out 120ms both;
fill: none;
stroke: var(--pds-color-border-default);
stroke-dasharray: 1 1;
stroke-linecap: round;
stroke-width: var(--pds-border-width-default);
}
.pds-agent-tree__ring {
fill: none;
stroke: var(--pds-color-border-default);
stroke-width: var(--pds-border-width-default);
}
/* The dot's inside hides the connector under it; its ring is drawn separately,
in the border color or, between two working agents, in the gradient. */
.pds-agent-tree__dot {
fill: var(--pds-color-surface-default);
}
/* Between two working agents the connector is the AI gradient, seen through a
mask of just those connectors. Animated, it slides one tile, as the animated
Panel's border does; the gradient ends on its start color, so the loop is
seamless. */
.pds-agent-tree__lines {
animation: agent-tree-fade 520ms ease-out 120ms both;
background: var(--pds-gradient-ai-active);
left: 0;
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
pointer-events: none;
position: absolute;
top: 0;
}
@media (prefers-reduced-motion: no-preference) {
.pds-agent-tree[data-animated] .pds-agent-tree__lines {
animation:
agent-tree-fade 520ms ease-out 120ms both,
agent-tree-slide var(--pds-animation-duration-ai-shimmer) linear infinite;
background-repeat: repeat-x;
background-size: 200% 100%;
}
}
/* A handoff: a short light running along the connector. Each stacked dash is
faint; together they run from nothing at the ends to full in the middle. */
.pds-agent-tree__light path {
fill: none;
filter: drop-shadow(
0 0 var(--pds-spacing-5xs)
color-mix(in srgb, var(--pds-color-interactive-focus) 30%, transparent)
);
opacity: 0;
stroke: var(--pds-color-interactive-focus);
stroke-linecap: butt;
stroke-opacity: 0.2;
stroke-width: var(--pds-border-width-thicker);
}
.pds-agent-tree__root {
position: relative;
z-index: 1;
}
.pds-agent-tree__level {
align-items: flex-start;
display: flex;
gap: var(--agent-tree-gap);
justify-content: center;
margin-block-start: var(--pds-spacing-3xl);
position: relative;
width: 100%;
z-index: 1;
& > .pds-agent-tree__hang {
flex: none;
width: calc(
var(--agent-tree-card-width) + var(--agent-tree-indent) *
var(--agent-tree-col)
);
}
}
.pds-agent-tree__hang {
align-content: start;
display: grid;
gap: var(--agent-tree-gap);
&[data-depth='2'] {
--agent-tree-col: 2;
}
&[data-depth='3'] {
--agent-tree-col: 3;
}
&[data-depth='4'] {
--agent-tree-col: 4;
}
&[data-depth='5'] {
--agent-tree-col: 5;
}
}
.pds-agent-tree__below {
display: grid;
gap: var(--agent-tree-gap);
padding-inline-start: var(--agent-tree-indent);
}
/* Wide: the lead sits over the middle of its sub-agents' columns. */
.pds-agent-tree[data-layout='wide'] .pds-agent-tree__root {
margin-inline-end: var(--agent-tree-indent);
}
/* Narrow: every level indented under its parent, cards as wide as the room. */
.pds-agent-tree[data-layout='narrow'] {
& .pds-agent-tree__tree {
justify-items: stretch;
}
& .pds-agent-tree__level {
display: grid;
gap: var(--agent-tree-gap);
justify-content: stretch;
margin-block-start: var(--agent-tree-gap);
padding-inline-start: var(--agent-tree-indent);
& > .pds-agent-tree__hang {
width: auto;
}
}
& .pds-agent-tree__node {
width: auto;
}
}
/* ----- One agent ----- */
.pds-agent-tree__node {
animation: agent-tree-in 380ms ease-out both;
border-radius: var(--pds-border-radius-card);
position: relative;
width: var(--agent-tree-card-width);
/* The focus ring goes around the whole card, not just the tree item. */
&:has(.pds-agent-tree__item:focus-visible) {
outline: var(--pds-border-width-outline) solid
var(--pds-color-interactive-focus);
outline-offset: var(--pds-border-width-outline);
}
&:hover .pds-agent-tree__card,
&[data-open] .pds-agent-tree__card {
border-color: transparent;
box-shadow: var(--pds-elevation-raised);
}
}
.pds-agent-tree__card {
display: grid;
gap: var(--pds-spacing-2xs);
grid-template-columns: minmax(0, 1fr);
height: 100%;
overflow: hidden;
padding: var(--pds-spacing-xs);
position: relative;
}
/* A handoff arrives: a 1px stroke of the gradient, on the card's own border (the
wrapper sits on the node, outside the clipped Panel), keeps flowing from
the top to the bottom and fades out as it goes, so the connector and the
card read as one stroke. The wrapper is a soft band that sweeps down (a
tall mask image whose position is animated; both ends of the sweep are
fully transparent); the ring inside is the border area of a gradient layer
(a mask removes the middle). */
.pds-agent-tree__arrival {
animation: agent-tree-arrival var(--agent-tree-arrival-duration) linear both;
border-radius: inherit;
inset: 0;
mask-image: linear-gradient(
180deg,
transparent 15%,
var(--pds-color-foreground-default) 28%,
var(--pds-color-foreground-default) 40%,
transparent 53%
);
-webkit-mask-image: linear-gradient(
180deg,
transparent 15%,
var(--pds-color-foreground-default) 28%,
var(--pds-color-foreground-default) 40%,
transparent 53%
);
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-size: 100% 300%;
-webkit-mask-size: 100% 300%;
pointer-events: none;
position: absolute;
z-index: 2;
}
.pds-agent-tree__arrival-ring {
animation: agent-tree-slide var(--agent-tree-arrival-duration) linear both;
background: var(--pds-gradient-ai-active) 0 0 / 200% 100% repeat-x;
border-radius: inherit;
inset: 0;
mask:
linear-gradient(var(--pds-color-foreground-default) 0 0) content-box exclude,
linear-gradient(var(--pds-color-foreground-default) 0 0);
mask-composite: exclude;
-webkit-mask-composite: xor;
padding: var(--pds-border-width-default);
position: absolute;
}
.pds-agent-tree__item {
cursor: pointer;
display: grid;
gap: var(--pds-spacing-2xs);
outline: none;
}
/* The title row and the foot follow the Agent Inbox card: the avatar where the
Inbox has its status icon, the name over a small subtitle, a chevron at the
end, and the status badge with the elapsed time under the text. */
.pds-agent-tree__title-row {
align-items: flex-start;
display: flex;
gap: var(--pds-spacing-2xs);
min-width: 0;
}
/* Centered on the first line of the name, which wraps in a narrow card. */
.pds-agent-tree__avatar,
.pds-agent-tree__chevron {
flex: none;
}
.pds-agent-tree__avatar {
margin-block-start: calc((1lh - var(--pds-spacing-l)) / 2);
}
.pds-agent-tree__chevron {
color: var(--pds-color-foreground-default-secondary);
height: 1em;
margin-block-start: calc((1lh - 1em) / 2);
margin-inline-start: auto;
width: 1em;
}
.pds-agent-tree__node[data-open] .pds-agent-tree__chevron {
transform: rotate(180deg);
}
.pds-agent-tree__heading {
display: grid;
min-width: 0;
}
/* The weight is on an inner element: the copy classes force regular with
!important on the element they sit on. */
.pds-agent-tree__name {
color: var(--pds-color-foreground-default);
font-weight: var(--pds-typography-fw-semibold);
min-width: 0;
overflow-wrap: anywhere;
}
.pds-agent-tree__subtitle {
color: var(--pds-color-foreground-default-secondary);
overflow-wrap: anywhere;
}
/* What it does: two lines, in full when the card is open. While it works it
shimmers. */
.pds-agent-tree__activity {
-webkit-box-orient: vertical;
display: -webkit-box;
-webkit-line-clamp: 2;
margin: 0;
overflow: hidden;
overflow-wrap: anywhere;
}
.pds-agent-tree__node[data-open] .pds-agent-tree__activity {
-webkit-line-clamp: unset;
}
.pds-agent-tree__activity[data-live] {
animation: agent-tree-shimmer 2s linear infinite;
background: linear-gradient(
90deg,
var(--pds-color-foreground-default-secondary) 0 35%,
var(--pds-color-foreground-default) 50%,
var(--pds-color-foreground-default-secondary) 65% 100%
)
100% 0 / 260% 100%;
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}
/* Context window: a thin bar and the tokens. */
.pds-agent-tree__context {
align-items: center;
display: grid;
gap: var(--pds-spacing-2xs);
grid-template-columns: minmax(0, 1fr) auto;
}
.pds-agent-tree__tokens {
font-variant-numeric: tabular-nums;
}
/* The foot: the status badge and the time, and the tools. */
.pds-agent-tree__foot {
align-items: center;
color: var(--pds-color-foreground-default-secondary);
display: flex;
flex-wrap: wrap;
gap: var(--pds-spacing-2xs) var(--pds-spacing-s);
justify-content: space-between;
}
.pds-agent-tree__state {
align-items: center;
display: inline-flex;
gap: var(--pds-spacing-2xs);
}
.pds-agent-tree__time {
font-variant-numeric: tabular-nums;
}
.pds-agent-tree__tools {
align-items: center;
display: inline-flex;
flex: none;
}
.pds-agent-tree__tools-more {
font-variant-numeric: tabular-nums;
padding-inline: var(--pds-spacing-4xs);
}
.pds-agent-tree__last {
align-items: center;
display: flex;
flex: 1;
gap: var(--pds-spacing-4xs);
min-width: 0;
& > svg {
flex: none;
}
/* A long sender gives way too: at most 60% of the line. */
& b {
color: var(--pds-color-foreground-default-secondary);
flex: 0 0 auto;
font-weight: var(--pds-typography-fw-medium);
max-width: 60%;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
& span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
/* An open card shows the full last handoff: it wraps instead of cutting off. */
.pds-agent-tree__node[data-open] {
& .pds-agent-tree__last b,
& .pds-agent-tree__last span {
max-width: none;
overflow: visible;
overflow-wrap: anywhere;
text-overflow: clip;
white-space: normal;
}
& .pds-agent-tree__last {
align-items: flex-start;
}
& .pds-agent-tree__last > svg {
margin-block-start: var(--pds-spacing-5xs);
}
}
/* ----- Details: under a divider inside the open card, as in Agent Inbox ----- */
.pds-agent-tree__details {
border-block-start: var(--pds-border-width-default) solid
var(--pds-color-border-default);
cursor: default;
display: grid;
gap: var(--pds-spacing-2xs);
margin-block-start: var(--pds-spacing-2xs);
min-width: 0;
padding-block-start: var(--pds-spacing-xs);
}
.pds-agent-tree__details-task {
-webkit-box-orient: vertical;
display: -webkit-box;
-webkit-line-clamp: 3;
margin: 0;
overflow: hidden;
overflow-wrap: anywhere;
}
.pds-agent-tree__details-usage {
border-block: var(--pds-border-width-default) solid
var(--pds-color-border-default);
display: grid;
gap: var(--pds-spacing-2xs);
grid-template-columns: repeat(3, minmax(0, 1fr));
margin: 0;
padding-block: var(--pds-spacing-2xs);
& > div {
display: grid;
min-width: 0;
}
& dt {
color: var(--pds-color-foreground-default-secondary);
}
& dd {
color: var(--pds-color-foreground-default);
font-variant-numeric: tabular-nums;
font-weight: var(--pds-typography-fw-medium);
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.pds-agent-tree__details-chips {
display: flex;
flex-wrap: wrap;
gap: var(--pds-spacing-4xs);
}
/* Sits inline before the model name in its badge. */
.pds-agent-tree__details-logo {
display: inline-grid;
margin-inline-end: var(--pds-spacing-4xs);
vertical-align: middle;
& > svg {
height: var(--pds-spacing-s);
width: var(--pds-spacing-s);
}
}
/* Buttons hug their content, at the PDS padding, and sit at the end. */
.pds-agent-tree__details-actions {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: var(--pds-spacing-2xs);
justify-content: flex-end;
}
/* The floating message bar: the compact Composer in a small surface in the
top layer. A popover is centered in the viewport by default (inset 0 and
auto margins); here it sits at the bottom center, one margin up from the
bottom edge. For the screen center, drop `inset-block` and `margin-block`. */
.pds-agent-tree__message {
background: var(--pds-color-surface-default);
border: 0;
border-radius: var(--pds-border-radius-panel);
box-shadow: var(--pds-elevation-overlay);
box-sizing: border-box;
height: fit-content;
inset-block: auto var(--pds-spacing-xl);
margin-block: 0;
overflow: visible;
padding: var(--pds-spacing-2xs);
width: min(
var(--agent-tree-message-width),
calc(100vw - var(--pds-spacing-xl) * 2)
);
&:not(:popover-open) {
display: none;
}
}
/* ----- Motion ----- */
@keyframes agent-tree-in {
from {
opacity: 0;
transform: translateY(var(--pds-spacing-3xs)) scale(0.98);
}
}
@keyframes agent-tree-fade {
from {
opacity: 0;
}
}
@keyframes agent-tree-draw {
from {
stroke-dashoffset: 1;
}
to {
stroke-dashoffset: 0;
}
}
@keyframes agent-tree-slide {
from {
background-position: 0 0;
}
to {
background-position: -200% 0;
}
}
/* The band starts above the card (nothing visible), sweeps down through it, and
ends below it (nothing visible). */
@keyframes agent-tree-arrival {
from {
-webkit-mask-position: 0 100%;
mask-position: 0 100%;
}
to {
-webkit-mask-position: 0 -50%;
mask-position: 0 -50%;
}
}
@keyframes agent-tree-shimmer {
from {
background-position: 100% 0;
}
to {
background-position: 0 0;
}
}
@media (prefers-reduced-motion: reduce) {
.pds-agent-tree *,
.pds-agent-tree *::before,
.pds-agent-tree *::after {
animation: none !important;
transition: none !important;
}
.pds-agent-tree__activity[data-live] {
background: none;
-webkit-text-fill-color: currentcolor;
}
}
Context: AgentTree
A tree of agent cards: the lead on top, its sub-agents side by side below, their helpers under them, joined by thin connectors.
Net-new componentOpen in Storybook