diff --git a/docs/4-implementation/web-ui/swarm-ui.md b/docs/4-implementation/web-ui/swarm-ui.md index 2df2cb45c..583b8690e 100644 --- a/docs/4-implementation/web-ui/swarm-ui.md +++ b/docs/4-implementation/web-ui/swarm-ui.md @@ -136,22 +136,24 @@ paused, destroy), a **paused by hive** badge when the agent's own harness paused its turn loop (hover for the reason; set the agent **up** to resume it), and a **login needed** badge with a **log in** button when its claude has no session. -Select a card to open the agent's details. The address becomes -`/agents/`, so a link or a reload lands on the same agent, and the -browser's back and forward buttons walk through the selections. Until you select -an agent the list takes the whole width. Selecting one narrows the list to a -third of the page and slides the details in on the right, which scroll on their -own while the list stays in view, and the selected card gets a purple border and fill. The widths animate, -and stand still where motion is off. A screen narrower than 60em has room for one -column, so the details replace the list. At any width, the **← agents** button above -the details shuts them and the list takes the width again, and focus returns to -the agent's card. A name the roster doesn't have, from a stale link, shows -"no agent named …" and the same button. The -filter card, which also holds the **+ agent** button and the refresh picker, -filters by name, hive, status, message, wanted state -and config PR. While the agent list loads for the first time, the page shows grey -placeholder cards with the same layout as the real ones, so the cards don't jump -when the data arrives. The placeholders stand still where motion is off. +Select a card to open the agent's details. The address becomes `/agents/`, +so a link or a reload lands on the same agent, and the browser's back and +forward buttons walk through the selections. Until you select an agent the list +takes the whole width, in the shell's 90em column. Selecting one narrows the +list to a quarter of the page (never under 24em) and slides the details in on +the right, which scroll on their own while the list stays in view, and the +selected card gets a purple border and fill. The page spreads to 160em for the +two columns, so a wide screen shows more of the details. The widths animate, and +stand still where motion is off. A screen narrower than 60em has room for one +column, so the details replace the list. At any width, the **← agents** button +above the details shuts them and the list takes the width again, and focus +returns to the agent's card. A name the roster doesn't have, from a stale link, +shows "no agent named …" and the same button. The filter card, which also holds +the **+ agent** button and the refresh picker, filters by name, hive, status, +message, wanted state and config PR. While the agent list loads for the first +time, the page shows grey placeholder cards with the same layout as the real +ones, so the cards don't jump when the data arrives. The placeholders stand +still where motion is off. To act on several agents at once, press the **select** button in the filter card, select an agent's icon, or press and hold a card (half a second; moving diff --git a/frontend/packages/swarm-ui/src/pages/agents/AgentsLayout.css b/frontend/packages/swarm-ui/src/pages/agents/AgentsLayout.css index 8869db61b..b9b23593c 100644 --- a/frontend/packages/swarm-ui/src/pages/agents/AgentsLayout.css +++ b/frontend/packages/swarm-ui/src/pages/agents/AgentsLayout.css @@ -1,10 +1,11 @@ /* : the list and the details of the selected agent. Two columns, always, so the widths can animate: the details' column goes from - `0fr` to twice the list's, and the gap opens with it. A grid animates between - two track lists of the same shape, and `minmax(0, …)` keeps a long line from - stretching a column. The list is a third of the page (about 28em at the - widest), enough for a card's badges and menu; a card's message is one line. */ + `0fr` to three times the list's share, and the gap opens with it. A grid + animates between two track lists of the same shape, and `minmax(…, …fr)` + keeps a long line from stretching a column. The list never gets narrower than + 24em, enough for a card's badges and menu; a card's message is one line, and + on a wide screen the details take the rest. */ .agents-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0fr); @@ -15,9 +16,20 @@ column-gap 320ms cubic-bezier(0.3, 0.7, 0.2, 1); } .agents-layout-selected { - grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); + grid-template-columns: minmax(24em, 1fr) minmax(0, 3fr); column-gap: 1.25em; } + +/* The list alone keeps the shell's 90em column. With an agent selected the page + has two columns to fill, so the cap goes up to 160em and the page spreads over + a wide screen instead of leaving it empty at the sides. The cap moves with the + same easing as the columns. */ +.shell-body:has(.agents-layout) { + transition: max-width 320ms cubic-bezier(0.3, 0.7, 0.2, 1); +} +.shell-body:has(.agents-layout-selected) { + max-width: 160em; +} .agents-layout-list { min-width: 0; } @@ -81,18 +93,23 @@ preference, the explicit "reduce", then the explicit "allow" over an OS "reduce". */ @media (prefers-reduced-motion: reduce) { + .shell-body:has(.agents-layout), .agents-layout, .agents-layout-details, .agents-layout-selected .agents-layout-details { transition: none; } } +:root[data-motion="reduce"] .shell-body:has(.agents-layout), :root[data-motion="reduce"] .agents-layout, :root[data-motion="reduce"] .agents-layout-details, :root[data-motion="reduce"] .agents-layout-selected .agents-layout-details { transition: none; } @media (min-width: 60.01em) { + :root[data-motion="allow"] .shell-body:has(.agents-layout) { + transition: max-width 320ms cubic-bezier(0.3, 0.7, 0.2, 1); + } :root[data-motion="allow"] .agents-layout { transition: grid-template-columns 320ms cubic-bezier(0.3, 0.7, 0.2, 1),