mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-09 19:27:45 +02:00
[eric] frontend: status chips speak plain english, working / needs your OK / done instead of enum values
This commit is contained in:
@@ -14,6 +14,7 @@ import { setPendingFocusAgentId } from '@/shared/state/tempStateSlice';
|
||||
import { createDashboard } from '@/shared/state/dashboardsSlice';
|
||||
import { openSettingsModal } from '@/shared/state/settingsSlice';
|
||||
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
|
||||
import { friendlyStatusLabel } from '@/shared/statusLabel';
|
||||
|
||||
interface Props {
|
||||
open: boolean;
|
||||
@@ -301,7 +302,7 @@ const GlobalSearchPalette: React.FC<Props> = ({ open, onClose }) => {
|
||||
const dashName = r.dashboardId ? dashboards[r.dashboardId]?.name : null;
|
||||
const subtitle = [
|
||||
dashName && `in ${dashName}`,
|
||||
r.closedAt ? 'closed' : r.status,
|
||||
r.closedAt ? 'closed' : friendlyStatusLabel(r.status),
|
||||
].filter(Boolean).join(' · ');
|
||||
return (
|
||||
<ResultRow
|
||||
|
||||
@@ -17,6 +17,7 @@ import CheckIcon from '@mui/icons-material/Check';
|
||||
import DragIndicatorIcon from '@mui/icons-material/DragIndicator';
|
||||
import RestartAltIcon from '@mui/icons-material/RestartAlt';
|
||||
import { useAppDispatch, useAppSelector } from '@/shared/hooks';
|
||||
import { friendlyStatusLabel } from '@/shared/statusLabel';
|
||||
import { openSettingsModal } from '@/shared/state/settingsSlice';
|
||||
import { API_BASE, getAuthToken } from '@/shared/config';
|
||||
import {
|
||||
@@ -970,7 +971,7 @@ const AgentChat: React.FC<AgentChatProps> = ({ sessionId: sessionIdProp, onClose
|
||||
<Typography noWrap sx={{ color: c.text.primary, fontWeight: 600 }}>{session.name}</Typography>
|
||||
{!isDraft && statusStyle && (
|
||||
<Chip
|
||||
label={session.status.replace('_', ' ')}
|
||||
label={friendlyStatusLabel(session.status)}
|
||||
size="small"
|
||||
sx={{
|
||||
bgcolor: statusStyle.bg,
|
||||
|
||||
@@ -11,6 +11,7 @@ import type { AgentSession } from '@/shared/state/agentsSlice';
|
||||
import type { CardPosition, ViewCardPosition, BrowserCardPosition } from '@/shared/state/dashboardLayoutSlice';
|
||||
import type { Output } from '@/shared/state/outputsSlice';
|
||||
import type { CanvasActions } from '../hooks/interaction/useCanvasControls';
|
||||
import { friendlyStatusLabel } from '@/shared/statusLabel';
|
||||
|
||||
interface DashboardHeaderProps {
|
||||
dashboardName: string | undefined;
|
||||
@@ -199,7 +200,7 @@ const DashboardHeader: React.FC<DashboardHeaderProps> = ({
|
||||
<Typography
|
||||
sx={{ fontSize: '0.7rem', color: c.text.ghost, flexShrink: 0 }}
|
||||
>
|
||||
{item.status.replace('_', ' ')}
|
||||
{friendlyStatusLabel(item.status)}
|
||||
</Typography>
|
||||
</ItemRow>
|
||||
))}
|
||||
|
||||
@@ -37,6 +37,7 @@ import { useOverlayScrollPassthrough } from '../hooks/interaction/useOverlayScro
|
||||
import { useStreamingMessage } from '@/shared/state/streamingSlice';
|
||||
import { isCanvasInteractionActive, onCanvasInteractionEnd } from '@/shared/canvasInteractionState';
|
||||
import { getAgentWorkTime, fmtSeconds } from '@/shared/agentWorkTime';
|
||||
import { friendlyStatusLabel } from '@/shared/statusLabel';
|
||||
|
||||
const GoogleServiceIcon: React.FC<{ service: string; size?: number }> = ({ service, size = 16 }) => {
|
||||
if (service === 'gmail') {
|
||||
@@ -757,7 +758,7 @@ const AgentCard: React.FC<Props> = ({
|
||||
{session.name}
|
||||
</Typography>
|
||||
<Chip
|
||||
label={session.status.replace('_', ' ')}
|
||||
label={friendlyStatusLabel(session.status)}
|
||||
size="small"
|
||||
sx={{
|
||||
bgcolor: statusStyle.bg,
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/** Plain-English session status for user-facing chips; the raw enum values read as dev-speak. */
|
||||
export function friendlyStatusLabel(status: string): string {
|
||||
switch (status) {
|
||||
case 'running': return 'working';
|
||||
case 'waiting_approval': return 'needs your OK';
|
||||
case 'completed': return 'done';
|
||||
case 'error': return 'needs attention';
|
||||
default: return status.replace(/_/g, ' ');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user