Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: split pages/agents into two pages and the agent components

pages/agents held the roster page, the terminal page and every component under them. It keeps the two pages; the components move to src/agent, by concern: roster (card, wanted menu, actions), detail (panel body, dialog, inference, linked accounts, link menu) and terminal (preview, input, subagents, stream hooks, favicon), with the shared row type and icon at the top. Moves and import rewrites only.
This commit is contained in:
iris 2026-10-12 00:02:15 +02:00
commit 74e588415b
27 changed files with 28 additions and 25 deletions

View file

@ -9,14 +9,14 @@
import { ApiErrorPanel } from "@hive/shared/api-error-panel.js"; import { ApiErrorPanel } from "@hive/shared/api-error-panel.js";
import { Badge } from "@hive/shared/badge.js"; import { Badge } from "@hive/shared/badge.js";
import { RelativeTime } from "../../ui/relative-time/RelativeTime.js"; import { RelativeTime } from "../../ui/relative-time/RelativeTime.js";
import type { AgentActions } from "./AgentActions.js"; import type { AgentActions } from "../roster/AgentActions.js";
import { AgentInference } from "./AgentInference.js"; import { AgentInference } from "./AgentInference.js";
import { AgentTermPreview } from "./AgentTermPreview.js"; import { AgentTermPreview } from "../terminal/AgentTermPreview.js";
import { FRESHNESS, type AgentRow } from "./AgentTypes.js"; import { FRESHNESS, type AgentRow } from "../AgentTypes.js";
import { LinkAccountMenu } from "./LinkAccountMenu.js"; import { LinkAccountMenu } from "./LinkAccountMenu.js";
import { LinkedAccounts } from "./LinkedAccounts.js"; import { LinkedAccounts } from "./LinkedAccounts.js";
import { SubagentTerms } from "./SubagentTerms.js"; import { SubagentTerms } from "../terminal/SubagentTerms.js";
import { WantedMenu } from "./WantedMenu.js"; import { WantedMenu } from "../roster/WantedMenu.js";
import "./AgentDetail.css"; import "./AgentDetail.css";
export function AgentDetail({ export function AgentDetail({

View file

@ -12,9 +12,9 @@ import { ApiErrorPanel } from "@hive/shared/api-error-panel.js";
import { readApiError, type ProblemDetails } from "@hive/shared/api-error.js"; import { readApiError, type ProblemDetails } from "@hive/shared/api-error.js";
import { Dialog } from "../../ui/dialog/Dialog.js"; import { Dialog } from "../../ui/dialog/Dialog.js";
import { Panel } from "../../ui/panel/Panel.js"; import { Panel } from "../../ui/panel/Panel.js";
import { useAgentActions } from "./AgentActions.js"; import { useAgentActions } from "../roster/AgentActions.js";
import { AgentDetail } from "./AgentDetail.js"; import { AgentDetail } from "./AgentDetail.js";
import type { AgentRow } from "./AgentTypes.js"; import type { AgentRow } from "../AgentTypes.js";
export function AgentDetailDialog({ export function AgentDetailDialog({
agent, agent,

View file

@ -15,11 +15,11 @@ import type { ComponentChildren } from "preact";
import { readApiError, type ProblemDetails } from "@hive/shared/api-error.js"; import { readApiError, type ProblemDetails } from "@hive/shared/api-error.js";
import { ConfirmDialog } from "../../ui/confirm-dialog/ConfirmDialog.js"; import { ConfirmDialog } from "../../ui/confirm-dialog/ConfirmDialog.js";
import { Dialog } from "../../ui/dialog/Dialog.js"; import { Dialog } from "../../ui/dialog/Dialog.js";
import { LinkMatrixAccountForm } from "../LinkMatrixAccountForm.js"; import { LinkMatrixAccountForm } from "../../pages/LinkMatrixAccountForm.js";
import { LinkForgeAccountForm } from "../LinkForgeAccountForm.js"; import { LinkForgeAccountForm } from "../../pages/LinkForgeAccountForm.js";
import { LinkGithubAccountForm } from "../LinkGithubAccountForm.js"; import { LinkGithubAccountForm } from "../../pages/LinkGithubAccountForm.js";
import type { AgentRow } from "./AgentTypes.js"; import type { AgentRow } from "../AgentTypes.js";
import type { LinkKind } from "./LinkAccountMenu.js"; import type { LinkKind } from "../detail/LinkAccountMenu.js";
// The one thing that differs between the "offline" and "paused" confirm // The one thing that differs between the "offline" and "paused" confirm
// dialogs `confirmTarget` drives — everything else (button row, open/close // dialogs `confirmTarget` drives — everything else (button row, open/close

View file

@ -16,8 +16,8 @@ import { Badge } from "@hive/shared/badge.js";
import type { ProblemDetails } from "@hive/shared/api-error.js"; import type { ProblemDetails } from "@hive/shared/api-error.js";
import { Card } from "../../ui/card/Card.js"; import { Card } from "../../ui/card/Card.js";
import { RelativeTime } from "../../ui/relative-time/RelativeTime.js"; import { RelativeTime } from "../../ui/relative-time/RelativeTime.js";
import { AgentIcon } from "./AgentIcon.js"; import { AgentIcon } from "../AgentIcon.js";
import { FRESHNESS, type AgentRow } from "./AgentTypes.js"; import { FRESHNESS, type AgentRow } from "../AgentTypes.js";
import { WantedMenu } from "./WantedMenu.js"; import { WantedMenu } from "./WantedMenu.js";
import "./AgentCard.css"; import "./AgentCard.css";

View file

@ -20,7 +20,7 @@
import { useRef, useState } from "preact/hooks"; import { useRef, useState } from "preact/hooks";
import { Badge, type BadgeTone } from "@hive/shared/badge.js"; import { Badge, type BadgeTone } from "@hive/shared/badge.js";
import { Dropdown, type DropdownOption } from "@hive/shared/dropdown.js"; import { Dropdown, type DropdownOption } from "@hive/shared/dropdown.js";
import type { AgentRow } from "./AgentTypes.js"; import type { AgentRow } from "../AgentTypes.js";
export function WantedMenu({ export function WantedMenu({
row, row,

View file

@ -12,10 +12,13 @@
import { useEffect, useState } from "preact/hooks"; import { useEffect, useState } from "preact/hooks";
import type { RouteComponentProps } from "wouter-preact"; import type { RouteComponentProps } from "wouter-preact";
import { Badge } from "@hive/shared/badge.js"; import { Badge } from "@hive/shared/badge.js";
import { AgentDetailDialog } from "./AgentDetailDialog.js"; import { AgentDetailDialog } from "../../agent/detail/AgentDetailDialog.js";
import { AgentIcon } from "./AgentIcon.js"; import { AgentIcon } from "../../agent/AgentIcon.js";
import { AgentTermPreview, termPaths } from "./AgentTermPreview.js"; import {
import { useAgentFavicon } from "../../shell/useAgentFavicon.js"; AgentTermPreview,
termPaths,
} from "../../agent/terminal/AgentTermPreview.js";
import { useAgentFavicon } from "../../agent/terminal/useAgentFavicon.js";
import { useDynamicTabs } from "../../shell/useDynamicTabs.js"; import { useDynamicTabs } from "../../shell/useDynamicTabs.js";
import "./AgentTerminalPage.css"; import "./AgentTerminalPage.css";

View file

@ -31,10 +31,10 @@ import { ApiErrorPanel } from "@hive/shared/api-error-panel.js";
import { readApiError, type ProblemDetails } from "@hive/shared/api-error.js"; import { readApiError, type ProblemDetails } from "@hive/shared/api-error.js";
import { Badge } from "@hive/shared/badge.js"; import { Badge } from "@hive/shared/badge.js";
import { LinkIcon } from "@hive/shared/icons.js"; import { LinkIcon } from "@hive/shared/icons.js";
import { useAgentActions } from "./AgentActions.js"; import { useAgentActions } from "../../agent/roster/AgentActions.js";
import { AgentCard } from "./AgentCard.js"; import { AgentCard } from "../../agent/roster/AgentCard.js";
import { AgentDetail } from "./AgentDetail.js"; import { AgentDetail } from "../../agent/detail/AgentDetail.js";
import { FRESHNESS, type AgentRow } from "./AgentTypes.js"; import { FRESHNESS, type AgentRow } from "../../agent/AgentTypes.js";
import { Button } from "../../ui/button/Button.js"; import { Button } from "../../ui/button/Button.js";
import { Dialog } from "../../ui/dialog/Dialog.js"; import { Dialog } from "../../ui/dialog/Dialog.js";
import { FilterableView } from "../../ui/filterable-view/FilterableView.js"; import { FilterableView } from "../../ui/filterable-view/FilterableView.js";
@ -48,7 +48,7 @@ import {
import { SplitView } from "../../ui/split-view/SplitView.js"; import { SplitView } from "../../ui/split-view/SplitView.js";
import { type TableColumn } from "../../ui/table/Table.js"; import { type TableColumn } from "../../ui/table/Table.js";
import { CreateAgentForm } from "../CreateAgentForm.js"; import { CreateAgentForm } from "../CreateAgentForm.js";
import { WantedMenu } from "./WantedMenu.js"; import { WantedMenu } from "../../agent/roster/WantedMenu.js";
import "./AgentsPage.css"; import "./AgentsPage.css";
// Same 30s default + same reasoning as HivesPage: no inputs on this page // Same 30s default + same reasoning as HivesPage: no inputs on this page

View file

@ -22,7 +22,7 @@ import {
type RefreshIntervalMs, type RefreshIntervalMs,
} from "../../ui/refresh-interval/RefreshInterval.js"; } from "../../ui/refresh-interval/RefreshInterval.js";
import type { TableColumn } from "../../ui/table/Table.js"; import type { TableColumn } from "../../ui/table/Table.js";
import type { AgentRow } from "../agents/AgentTypes.js"; import type { AgentRow } from "../../agent/AgentTypes.js";
import { ScheduleCard } from "./ScheduleCard.js"; import { ScheduleCard } from "./ScheduleCard.js";
import { ScheduleForm } from "./ScheduleForm.js"; import { ScheduleForm } from "./ScheduleForm.js";
import { scheduleState, type Schedule } from "./ScheduleTypes.js"; import { scheduleState, type Schedule } from "./ScheduleTypes.js";