Watch
0
0
Fork
You've already forked hyperhive
0

swarm ui: the messages page's feed is a folded card named message log

The messages page had a card called messages under a nav tab called messages, and its feed was the only part of the page open on arrival. The feed is now the folded message log card, like the broadcast and schedules cards above it. Its header carries the connection badge (live, reconnecting, disconnected) so the state shows while it is folded; the reconnect button moves into the bar inside it. The stream keeps running while the card is folded, and opening it scrolls the list to the newest message.
This commit is contained in:
iris 2026-11-20 01:28:46 +01:00 • committed by mara
commit f29435fcf1
3 changed files with 27 additions and 23 deletions

View file

@ -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

View file

@ -1,7 +1,7 @@
/* <MessagesPage>: 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;

View file

@ -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 (
<div class="ui-messages-page">
@ -99,27 +101,27 @@ export function MessagesPage() {
{composerBuilt ? <BroadcastComposer /> : null}
</Disclosure>
<SchedulesCard />
<Panel
title="messages"
<Disclosure
title="message log"
icon="💬"
actions={
<>
<Badge
tone={CONNECTION_TONE[connection]}
value={CONNECTION_LABEL[connection]}
/>
{connection === "closed" ? (
<Badge
variant="quiet"
value="reconnect"
title="open the message stream again"
onClick={reconnect}
/>
) : null}
</>
hint={
<Badge
tone={CONNECTION_TONE[connection]}
value={CONNECTION_LABEL[connection]}
/>
}
open={logOpen}
onToggle={setLogOpen}
>
<div class="ui-messages-bar">
{connection === "closed" ? (
<Badge
variant="quiet"
value="reconnect"
title="open the message stream again"
onClick={reconnect}
/>
) : null}
<SelectField
id="messages-window"
label="history"
@ -165,7 +167,7 @@ export function MessagesPage() {
an in-turn <code>recv</code> is missing. The history is at most 100
recent messages per agent.
</Hint>
</Panel>
</Disclosure>
</div>
);
}