Remove legacy dashboard rooms renderer

This commit is contained in:
ejclaw
2026-04-28 12:55:44 +09:00
parent 4deb8b51de
commit 6bfedc28f0
2 changed files with 1 additions and 684 deletions

View File

@@ -2151,319 +2151,6 @@ function RoomMessageForm({
);
}
function RoomActivityPanel({
activity,
loading,
locale,
t,
}: {
activity: DashboardRoomActivity | undefined;
loading: boolean;
locale: Locale;
t: Messages;
}) {
if (!activity) {
return (
<div className="room-activity room-activity-empty">
{loading ? t.rooms.loadingActivity : t.rooms.noActivity}
</div>
);
}
const task = activity.pairedTask;
const turn = task?.currentTurn ?? null;
const outputs = task?.outputs ?? [];
const latestOutput = outputs.at(-1) ?? null;
const progressText = turn
? `${turn.role} · ${turn.intentKind} · ${t.rooms.attempt} ${turn.attemptNo}`
: t.rooms.noTurn;
return (
<div className="room-activity">
<div className="room-progress-strip">
{turn ? (
<span className={`pill pill-${turn.state}`}>
{statusLabel(turn.state, t)}
</span>
) : (
<span className="pill pill-inactive">{t.rooms.noTurn}</span>
)}
<strong>{progressText}</strong>
<span>{task ? `${t.rooms.round} ${task.roundTripCount}` : '-'}</span>
{turn?.executorServiceId ? <span>{turn.executorServiceId}</span> : null}
<time>{formatDate(turn?.updatedAt ?? task?.updatedAt, locale)}</time>
</div>
<section className="room-latest-output">
<header>
<strong>{t.rooms.latestOutput}</strong>
{latestOutput ? (
<span>
#{latestOutput.turnNumber} · {latestOutput.role}
{latestOutput.verdict ? ` · ${latestOutput.verdict}` : ''}
</span>
) : null}
</header>
{latestOutput ? (
<p>{latestOutput.outputText}</p>
) : (
<p className="room-muted">{t.rooms.noOutput}</p>
)}
</section>
<details className="room-activity-details">
<summary>{t.rooms.details}</summary>
<div className="room-detail-grid">
<section>
<strong>{t.rooms.task}</strong>
<p className="room-muted">
{task?.title || task?.id || t.rooms.noTask}
</p>
<div className="room-turn-line">
{turn?.activeRunId ? (
<span className="mono-chip">{turn.activeRunId}</span>
) : null}
{turn?.lastError ? (
<span className="room-activity-error">{turn.lastError}</span>
) : null}
</div>
</section>
<section>
<strong>{t.rooms.outputHistory}</strong>
{outputs.length === 0 ? (
<p className="room-muted">{t.rooms.noOutput}</p>
) : (
<div className="room-output-list">
{[...outputs].reverse().map((output) => (
<article key={output.id} className="room-output-item">
<header>
<span>
#{output.turnNumber} · {output.role}
{output.verdict ? ` · ${output.verdict}` : ''}
</span>
<time>{formatDate(output.createdAt, locale)}</time>
</header>
<p>{output.outputText}</p>
</article>
))}
</div>
)}
</section>
<section>
<strong>{t.rooms.messageHistory}</strong>
{activity.messages.length === 0 ? (
<p className="room-muted">{t.rooms.noMessages}</p>
) : (
<div className="room-message-list">
{activity.messages.map((message) => (
<article
className={`room-message-item ${
message.isBotMessage ? 'room-message-bot' : ''
}`}
key={message.id}
>
<header>
<span>{message.senderName}</span>
<time>{formatDate(message.timestamp, locale)}</time>
</header>
<p>{message.content}</p>
</article>
))}
</div>
)}
</section>
</div>
</details>
</div>
);
}
function RoomComposeDetails({
busy,
onChange,
onSubmit,
t,
value,
}: {
busy: boolean;
onChange: (value: string) => void;
onSubmit: () => void;
t: Messages;
value: string;
}) {
return (
<details className="room-compose-details">
<summary>{t.rooms.message}</summary>
<RoomMessageForm
busy={busy}
onChange={onChange}
onSubmit={onSubmit}
t={t}
value={value}
/>
</details>
);
}
function RoomPanel({
onSendRoomMessage,
roomActivity,
roomActivityLoading,
roomMessageKey,
locale,
snapshots,
t,
}: {
onSendRoomMessage: (
roomJid: string,
text: string,
requestId: string,
) => Promise<boolean>;
roomActivity: RoomActivityMap;
roomActivityLoading: boolean;
roomMessageKey: string | null;
locale: Locale;
snapshots: StatusSnapshot[];
t: Messages;
}) {
const [drafts, setDrafts] = useState<Record<string, string>>({});
const entries = snapshots.flatMap((snapshot) =>
snapshot.entries.map((entry) => ({
...entry,
serviceId: snapshot.serviceId,
})),
);
if (entries.length === 0) {
return <EmptyState>{t.rooms.empty}</EmptyState>;
}
function setDraft(jid: string, value: string) {
setDrafts((previous) => ({ ...previous, [jid]: value }));
}
async function submitRoomMessage(jid: string) {
const text = drafts[jid]?.trim();
if (!text) return;
const success = await onSendRoomMessage(jid, text, makeClientRequestId());
if (success) {
setDraft(jid, '');
}
}
return (
<>
<div className="table-wrap desktop-table">
<table>
<thead>
<tr>
<th>{t.rooms.room}</th>
<th>{t.rooms.status}</th>
<th>{t.rooms.queue}</th>
<th>{t.rooms.elapsed}</th>
<th>{t.rooms.activity}</th>
<th>{t.rooms.message}</th>
</tr>
</thead>
<tbody>
{entries.map((entry) => (
<tr key={`${entry.serviceId}:${entry.jid}`}>
<td>
<strong>{entry.name}</strong>
<details className="record-details">
<summary>{t.rooms.details}</summary>
<span>
{entry.folder} · {entry.jid} · {entry.serviceId} ·{' '}
{entry.agentType}
</span>
</details>
</td>
<td>
<span className={`pill pill-${entry.status}`}>
{statusLabel(entry.status, t)}
</span>
</td>
<td>
{queueLabel(entry.pendingTasks, entry.pendingMessages, t)}
</td>
<td>{formatDuration(entry.elapsedMs, t)}</td>
<td className="room-activity-cell">
<RoomActivityPanel
activity={roomActivity[entry.jid]}
loading={roomActivityLoading}
locale={locale}
t={t}
/>
</td>
<td className="room-message-cell">
<RoomComposeDetails
busy={roomMessageKey === entry.jid}
onChange={(value) => setDraft(entry.jid, value)}
onSubmit={() => void submitRoomMessage(entry.jid)}
t={t}
value={drafts[entry.jid] ?? ''}
/>
</td>
</tr>
))}
</tbody>
</table>
</div>
<div className="mobile-record-list" aria-label={t.rooms.cardsAria}>
{entries.map((entry) => (
<article
className="record-card"
key={`${entry.serviceId}:${entry.jid}`}
>
<div className="record-card-head">
<div>
<strong>{entry.name}</strong>
<span className="mono-chip">{entry.folder}</span>
</div>
<span className={`pill pill-${entry.status}`}>
{statusLabel(entry.status, t)}
</span>
</div>
<div className="record-card-grid">
<span>
<small>{t.rooms.queue}</small>
<strong>
{queueLabel(entry.pendingTasks, entry.pendingMessages, t)}
</strong>
</span>
<span>
<small>{t.rooms.elapsed}</small>
<strong>{formatDuration(entry.elapsedMs, t)}</strong>
</span>
</div>
<RoomActivityPanel
activity={roomActivity[entry.jid]}
loading={roomActivityLoading}
locale={locale}
t={t}
/>
<RoomComposeDetails
busy={roomMessageKey === entry.jid}
onChange={(value) => setDraft(entry.jid, value)}
onSubmit={() => void submitRoomMessage(entry.jid)}
t={t}
value={drafts[entry.jid] ?? ''}
/>
<details className="record-details">
<summary>{t.rooms.details}</summary>
<p className="record-id">
{entry.folder} · {entry.jid} · {entry.serviceId} ·{' '}
{entry.agentType}
</p>
</details>
</article>
))}
</div>
</>
);
}
type RoomFilter = 'all' | 'processing' | 'waiting' | 'inactive';
type RoomSort = 'recent' | 'name' | 'queue';

View File

@@ -1338,59 +1338,6 @@ dd,
letter-spacing: 0.06em;
}
.table-wrap {
overflow: auto;
border: 1px solid var(--panel-border);
border-radius: 10px;
background: rgba(255, 255, 255, 0.03);
}
.mobile-record-list {
display: none;
}
table {
width: 100%;
border-collapse: collapse;
min-width: 860px;
}
th,
td {
padding: 16px;
border-bottom: 1px solid rgba(43, 55, 38, 0.1);
text-align: left;
vertical-align: top;
}
th {
color: var(--muted);
font-size: 12px;
letter-spacing: 0.1em;
text-transform: uppercase;
background: rgba(255, 255, 255, 0.04);
}
tr:last-child td {
border-bottom: 0;
}
td strong,
td span,
td small {
display: block;
}
td strong {
margin-bottom: 4px;
}
td small {
margin-top: 4px;
max-width: 480px;
overflow-wrap: anywhere;
}
.pill {
display: inline-flex;
width: fit-content;
@@ -2080,23 +2027,6 @@ progress::-moz-progress-bar {
font-style: normal;
}
.record-details {
margin-top: 4px;
}
.record-details summary {
display: inline-flex;
cursor: pointer;
color: var(--muted);
font-size: 12px;
font-weight: 700;
list-style: none;
}
.record-details summary::-webkit-details-marker {
display: none;
}
.room-compose {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
@@ -2192,215 +2122,6 @@ progress::-moz-progress-bar {
background: var(--panel);
}
.room-activity-cell {
min-width: 300px;
}
.room-activity {
display: grid;
min-width: min(300px, 100%);
gap: 7px;
padding: 8px;
border: 1px solid var(--panel-border);
border-radius: 15px;
background: rgba(255, 255, 255, 0.03);
}
.room-activity-empty,
.room-muted {
color: var(--muted);
font-size: 12px;
font-weight: 800;
}
.room-progress-strip {
display: grid;
grid-template-columns: auto minmax(96px, 1fr) auto auto auto;
gap: 6px;
align-items: center;
min-width: 0;
color: var(--muted);
font-size: 11px;
font-weight: 700;
}
.room-progress-strip strong,
.room-progress-strip span,
.room-progress-strip time {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.room-progress-strip strong {
color: var(--ink);
font-size: 12px;
}
.room-turn-line {
display: flex;
flex-wrap: wrap;
gap: 6px;
align-items: center;
color: var(--muted);
font-size: 12px;
font-weight: 800;
}
.room-turn-line .mono-chip {
margin-top: 0;
}
.room-activity-error {
color: #7c2518;
font-size: 12px;
font-weight: 700;
overflow-wrap: anywhere;
}
.room-latest-output {
display: grid;
gap: 4px;
min-width: 0;
padding: 8px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.025);
}
.room-latest-output header {
display: flex;
gap: 8px;
align-items: baseline;
justify-content: space-between;
color: var(--muted);
font-size: 11px;
font-weight: 700;
}
.room-latest-output strong,
.room-detail-grid > section > strong {
color: var(--bg-ink);
font-size: 12px;
letter-spacing: 0.06em;
text-transform: uppercase;
}
.room-latest-output header span,
.room-latest-output p {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
.room-latest-output p {
display: -webkit-box;
margin: 0;
color: var(--ink);
font-size: 12px;
line-height: 1.32;
overflow-wrap: anywhere;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.room-activity-details,
.room-compose-details {
min-width: 0;
}
.room-activity-details > summary,
.room-compose-details > summary {
min-height: 32px;
color: var(--accent);
font-size: 12px;
font-weight: 800;
cursor: pointer;
}
.room-detail-grid {
display: grid;
gap: 8px;
min-width: 0;
padding-top: 6px;
}
.room-detail-grid > section {
display: grid;
min-width: 0;
align-content: start;
gap: 7px;
}
.room-output-list,
.room-message-list {
display: grid;
gap: 7px;
}
.room-output-item,
.room-message-item {
min-width: 0;
padding: 8px;
border-radius: 13px;
background: rgba(255, 255, 255, 0.025);
}
.room-message-bot {
background: rgba(191, 95, 44, 0.08);
}
.room-output-item header,
.room-message-item header {
display: flex;
gap: 8px;
align-items: baseline;
justify-content: space-between;
color: var(--muted);
font-size: 11px;
font-weight: 700;
}
.room-output-item header span,
.room-message-item header span {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.room-output-item time,
.room-message-item time {
flex: none;
}
.room-output-item p,
.room-message-item p,
.room-muted {
margin: 0;
}
.room-output-item p,
.room-message-item p {
display: -webkit-box;
overflow: hidden;
margin-top: 5px;
color: var(--ink);
font-size: 12px;
line-height: 1.35;
overflow-wrap: anywhere;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4;
}
.room-message-cell {
width: 150px;
}
.room-compose-details .room-compose {
margin-top: 6px;
}
.task-board {
display: grid;
gap: 12px;
@@ -2795,61 +2516,11 @@ progress::-moz-progress-bar {
background: rgba(109, 115, 95, 0.16);
}
.record-card {
display: grid;
gap: 14px;
padding: 16px;
border: 1px solid var(--panel-border-strong);
border-radius: 22px;
background: rgba(255, 255, 255, 0.03);
}
.record-card-head {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: 12px;
align-items: start;
}
.record-card-head strong,
.task-card > p {
overflow-wrap: anywhere;
}
.record-card-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}
.record-card-grid > span {
min-width: 0;
padding: 11px;
border: 1px solid var(--panel-border);
border-radius: 16px;
background: rgba(255, 255, 255, 0.025);
}
.record-card-grid small,
.record-id {
color: var(--muted);
}
.record-card-grid small,
.record-card-grid strong {
display: block;
}
.record-card-grid strong {
min-width: 0;
overflow: hidden;
margin-top: 3px;
text-overflow: ellipsis;
white-space: nowrap;
}
.mono-chip,
.record-id {
.mono-chip {
font-family:
'SF Mono', 'Cascadia Code', 'Roboto Mono', ui-monospace, monospace;
font-size: 12px;
@@ -2870,14 +2541,6 @@ progress::-moz-progress-bar {
white-space: nowrap;
}
.record-id {
min-width: 0;
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.skeleton-line,
.skeleton-button {
display: block;
@@ -2954,17 +2617,6 @@ progress::-moz-progress-bar {
}
}
@media (max-width: 760px) {
.desktop-table {
display: none;
}
.mobile-record-list {
display: grid;
gap: 12px;
}
}
@media (max-width: 640px) {
html {
scroll-padding-top: 18px;
@@ -3145,24 +2797,6 @@ progress::-moz-progress-bar {
display: none;
}
.record-card-grid {
grid-template-columns: 1fr 1fr;
}
.room-activity,
.room-activity-cell {
min-width: 0;
}
.room-progress-strip {
grid-template-columns: auto minmax(0, 1fr) auto;
}
.room-progress-strip span:nth-of-type(n + 3),
.room-progress-strip time {
display: none;
}
.inbox-summary,
.health-signals {
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -3307,10 +2941,6 @@ progress::-moz-progress-bar {
gap: 8px;
}
.record-card-grid {
grid-template-columns: 1fr;
}
.inbox-meta,
.health-signals {
grid-template-columns: 1fr;