diff --git a/docs/4-implementation/web-ui/swarm-ui.md b/docs/4-implementation/web-ui/swarm-ui.md index ee086ded7..6a5ba8c63 100644 --- a/docs/4-implementation/web-ui/swarm-ui.md +++ b/docs/4-implementation/web-ui/swarm-ui.md @@ -596,8 +596,10 @@ since that agent's `send` row already did. The query `since_minutes` (default read from each agent's newest 100 rows. A message an agent drained with an in-turn `recv` starts no turn and so is missing. -The **messages** page (`/messages`) reads that feed. A **history** select picks -the window, from live only up to 24 hours, and a filter keeps the messages whose +The **messages** page (`/messages`) reads that feed. The feed is the **message +log** card, folded like the broadcast and schedules cards above it; a badge in its +header says whether the stream is live. Open it, and a **history** select picks the +window, from live only up to 24 hours, and a filter keeps the messages whose sender or recipient contains the text you type. Each message is one row of the same list an agent's terminal uses, a summary line with the time, the two parties and the start of the body, and the whole body under it. The list diff --git a/frontend/packages/swarm-ui/src/pages/messages/MessagesPage.css b/frontend/packages/swarm-ui/src/pages/messages/MessagesPage.css index 7082f160d..c5e061acb 100644 --- a/frontend/packages/swarm-ui/src/pages/messages/MessagesPage.css +++ b/frontend/packages/swarm-ui/src/pages/messages/MessagesPage.css @@ -1,7 +1,7 @@ /* : the filter bar over the terminal-style message list. */ @import "@hive/shared/terminal.css"; -/* The broadcast card, folded by default, over the messages card. */ +/* The broadcast and schedules cards, folded by default, over the message log. */ .ui-messages-page { display: flex; flex-direction: column; diff --git a/frontend/packages/swarm-ui/src/pages/messages/MessagesPage.tsx b/frontend/packages/swarm-ui/src/pages/messages/MessagesPage.tsx index e1458db00..79979905c 100644 --- a/frontend/packages/swarm-ui/src/pages/messages/MessagesPage.tsx +++ b/frontend/packages/swarm-ui/src/pages/messages/MessagesPage.tsx @@ -3,6 +3,7 @@ // streams them (`GET /api/messages/stream`), across all hives. Above the // list, a folded **broadcast** card holds the composer that sends one message // to several agents, and a folded **schedules** card holds the scheduled prompts. +// The list itself is the folded **message log** card. // // The stream sends the chosen window of history first, then the live tail. A // message an agent drained with an in-turn `recv` is missing, because it starts @@ -17,7 +18,6 @@ import { BroadcastComposer } from "../broadcast/BroadcastComposer.js"; import { SchedulesCard } from "../schedules/SchedulesPage.js"; import { Disclosure } from "../../ui/disclosure/Disclosure.js"; import { Hint } from "../../ui/hint/Hint.js"; -import { Panel } from "../../ui/panel/Panel.js"; import { SelectField } from "../../ui/select-field/SelectField.js"; import { TextField } from "../../ui/text-field/TextField.js"; import { @@ -57,6 +57,8 @@ export function MessagesPage() { const [sinceMinutes, setSinceMinutes] = useState(DEFAULT_WINDOW_MINUTES); const [query, setQuery] = useState(""); const [composing, setComposing] = useState(false); + // The log starts folded, as the cards above it do. + const [logOpen, setLogOpen] = useState(false); // The composer is built on the first open and kept after, so what was typed // and ticked stays through a fold, and a page where it is never opened does // not poll the agent list. @@ -82,7 +84,7 @@ export function MessagesPage() { useLayoutEffect(() => { const el = logRef.current; if (el && stickToBottom) el.scrollTop = el.scrollHeight - el.clientHeight; - }, [newestId, shown.length, stickToBottom]); + }, [newestId, shown.length, stickToBottom, logOpen]); return (
@@ -99,27 +101,27 @@ export function MessagesPage() { {composerBuilt ? : null} - - - {connection === "closed" ? ( - - ) : null} - + hint={ + } + open={logOpen} + onToggle={setLogOpen} >
+ {connection === "closed" ? ( + + ) : null} recv is missing. The history is at most 100 recent messages per agent. - +
); }