diff --git a/src/operator-dashboard/static/components/StatusBar.jsx b/src/operator-dashboard/static/components/StatusBar.jsx index 787ca45..0ff1894 100644 --- a/src/operator-dashboard/static/components/StatusBar.jsx +++ b/src/operator-dashboard/static/components/StatusBar.jsx @@ -1,4 +1,5 @@ import { formatAge, formatBoolean, formatEur, formatTimestamp, signedClass, truncateMiddle } from '../lib/format.js'; +import { SUBMISSION_COPY } from '../lib/submissionCopy.js'; function statusSubtitle(label, status, websocketState) { switch (label) { @@ -8,8 +9,8 @@ function statusSubtitle(label, status, websocketState) { return formatTimestamp(status.market_observed_at); case 'Inventory Freshness': return formatTimestamp(status.inventory_observed_at); - case 'Trading': - return 'Successful submissions from durable history'; + case SUBMISSION_COPY.statusTileLabel: + return SUBMISSION_COPY.statusTileSubtitle; default: return ''; } @@ -25,8 +26,8 @@ export default function StatusBar({ status, websocketState }) { ['Alerts', `${status.active_alert_count || 0} ${status.highest_alert_severity ? `(${status.highest_alert_severity})` : ''}`.trim()], ['Strategy Armed', formatBoolean(status.strategy_armed)], ['Executor Armed', formatBoolean(status.executor_armed)], - ['Trading', `${status.recent_trade_count || 0} trades`], - ['Last Trade', formatTimestamp(status.last_successful_trade_at)], + [SUBMISSION_COPY.statusTileLabel, `${status.recent_trade_count || 0} ${SUBMISSION_COPY.statusTileValueSuffix}`], + [SUBMISSION_COPY.lastStatusTileLabel, formatTimestamp(status.last_successful_trade_at)], ]; return ( diff --git a/src/operator-dashboard/static/lib/submissionCopy.js b/src/operator-dashboard/static/lib/submissionCopy.js new file mode 100644 index 0000000..b566723 --- /dev/null +++ b/src/operator-dashboard/static/lib/submissionCopy.js @@ -0,0 +1,15 @@ +export const SUBMISSION_COPY = { + statusTileLabel: 'Submissions', + statusTileSubtitle: 'Successful quote-response submissions from durable history', + statusTileValueSuffix: 'submissions', + lastStatusTileLabel: 'Last Submission', + recentMetricLabel: 'Recent submissions', + recentMetricValueSuffix: 'submissions', + termsEyebrow: 'Submission activity', + termsTitle: 'Recent submitted quote terms', + termsEmpty: 'No submitted quote responses are available yet.', + ledgerTitle: 'Submitted quote responses', + ledgerSubtitle: 'PostgreSQL-backed pagination of executor submissions', + ledgerEmpty: 'No submitted quote responses are stored yet.', + ledgerCountLabel: (page, totalPages, total) => `Page ${page} of ${totalPages} - ${total} submitted quote responses`, +}; diff --git a/src/operator-dashboard/static/pages/FundsPage.jsx b/src/operator-dashboard/static/pages/FundsPage.jsx index 88c204a..9743602 100644 --- a/src/operator-dashboard/static/pages/FundsPage.jsx +++ b/src/operator-dashboard/static/pages/FundsPage.jsx @@ -5,6 +5,7 @@ import MetricCard from '../components/MetricCard.jsx'; import Pill from '../components/Pill.jsx'; import TableFrame from '../components/TableFrame.jsx'; import { formatEur, formatTimestamp, stringifyJson, truncateMiddle } from '../lib/format.js'; +import { SUBMISSION_COPY } from '../lib/submissionCopy.js'; function buildInitialEstimateForm(balances, withdrawalDefaults) { const firstAssetId = balances?.[0]?.asset_id || ''; @@ -204,7 +205,7 @@ function QuotesTable({ items }) { } function AssetChangeTable({ items }) { - if (!items?.length) return No successful trades are available yet.; + if (!items?.length) return {SUBMISSION_COPY.termsEmpty}; return ( @@ -213,8 +214,8 @@ function AssetChangeTable({ items }) { Observed Quote - Spend - Receive + Input + Output @@ -233,7 +234,7 @@ function AssetChangeTable({ items }) { } function TradesTable({ items }) { - if (!items?.length) return No successful trades are stored yet.; + if (!items?.length) return {SUBMISSION_COPY.ledgerEmpty}; return ( @@ -446,9 +447,9 @@ export default function FundsPage({ value={formatEur(profitability.trading_contribution_eure)} /> @@ -568,8 +569,8 @@ export default function FundsPage({ - Trade-driven changes - Recent asset deltas + {SUBMISSION_COPY.termsEyebrow} + {SUBMISSION_COPY.termsTitle} @@ -580,13 +581,13 @@ export default function FundsPage({ Durable ledger - Successful trades + {SUBMISSION_COPY.ledgerTitle} - PostgreSQL-backed pagination + {SUBMISSION_COPY.ledgerSubtitle} - {`Page ${trades.page} of ${trades.total_pages} - ${trades.total} successful trades`} + {SUBMISSION_COPY.ledgerCountLabel(trades.page, trades.total_pages, trades.total)} { + const text = [ + SUBMISSION_COPY.statusTileLabel, + SUBMISSION_COPY.statusTileSubtitle, + SUBMISSION_COPY.recentMetricLabel, + SUBMISSION_COPY.termsEyebrow, + SUBMISSION_COPY.termsTitle, + SUBMISSION_COPY.termsEmpty, + SUBMISSION_COPY.ledgerTitle, + SUBMISSION_COPY.ledgerSubtitle, + SUBMISSION_COPY.ledgerEmpty, + SUBMISSION_COPY.ledgerCountLabel(1, 2, 3), + ].join(' ').toLowerCase(); + + assert.ok(text.includes('submission')); + assert.ok(!text.includes('successful trades')); + assert.ok(!text.includes('asset deltas')); + assert.ok(!text.includes('trade-driven')); +});