Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions apps/ops-console/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
--subtle: #70707b;
--good: #23c483;
--good-dim: rgba(35, 196, 131, 0.11);
--success-dim: var(--good-dim);
--warn: #eab308;
--warn-dim: rgba(234, 179, 8, 0.12);
--danger: #f04444;
Expand Down Expand Up @@ -1009,6 +1010,42 @@ tr[tabindex]:focus-visible,
padding: 0 10px;
}

.detailActions,
.evidenceActions,
.transactionCell {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}

.transactionCell {
display: flex;
}

.inlineIconLink {
display: inline-flex;
align-items: center;
gap: 5px;
min-height: 24px;
border: 1px solid var(--line);
border-radius: var(--r-sm);
padding: 0 7px;
color: var(--text);
font-size: 12px;
font-weight: 650;
}

.inlineIconLink:hover {
border-color: var(--line-strong);
background: var(--surface-hover);
}

.inlineIconLink:focus-visible {
outline: 2px solid var(--focus);
outline-offset: 2px;
}

.smallIconButton {
width: 30px;
height: 30px;
Expand Down Expand Up @@ -1243,6 +1280,19 @@ tr.selectedRow {
border-color: rgba(234, 179, 8, 0.24);
}

.queueWarning {
display: flex;
align-items: center;
gap: 8px;
border: 1px solid rgba(234, 179, 8, 0.28);
border-radius: var(--r-md);
padding: 10px 12px;
background: var(--warn-dim);
color: #fde047;
font-size: 13px;
font-weight: 650;
}

.queueTable {
min-width: 1080px;
}
Expand Down
126 changes: 114 additions & 12 deletions apps/ops-console/components/OpsConsole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,17 @@ export function OpsConsole() {
return undefined;
}, [activeView, authState, refreshReconciliationQueue]);

useEffect(() => {
if (!issuedApiKey) {
return undefined;
}
const timeout = window.setTimeout(() => {
setIssuedApiKey(null);
setCopyStatus("Secret cleared automatically");
}, 120_000);
return () => window.clearTimeout(timeout);
}, [issuedApiKey]);

const providerOptions = useMemo(() => overview?.providers.names ?? [], [overview]);
const networkOptions = useMemo(
() => Array.from(new Set([...(overview?.providers.networks ?? []), ...(overview?.pauseState.networks ?? [])])).sort(),
Expand Down Expand Up @@ -1260,7 +1271,7 @@ function SellerRecentSettlements({
<td className="mono">{record.transaction ? shorten(record.transaction) : record.errorReason || "pending"}</td>
<td>
<button
className="iconButton smallIconButton"
className="secondaryButton compactButton"
type="button"
aria-label={`Open settlement ${record.recordId}`}
onClick={(event) => {
Expand All @@ -1269,6 +1280,7 @@ function SellerRecentSettlements({
}}
>
<Eye size={15} />
Inspect
</button>
</td>
</tr>
Expand Down Expand Up @@ -1770,6 +1782,12 @@ function ReconciliationQueuePanel({
<p>No matching reconciliation records.</p>
</div>
)}
{queue?.truncated ? (
<div className="queueWarning" role="status">
<AlertTriangle size={16} />
<span>Queue is truncated at {formatNumber(queue.filters.limit)} records. Narrow the filters before taking action.</span>
</div>
) : null}
</section>
);
}
Expand Down Expand Up @@ -1917,6 +1935,7 @@ function SettlementPanel({
loading={!overview}
selectedRecordId={selectedSettlementId}
onSelectRecord={onSelectSettlement}
onSelectSeller={onSelectSeller}
/>
</section>
<section className="panel">
Expand Down Expand Up @@ -1957,12 +1976,14 @@ function RecentSettlementsTable({
records,
loading,
selectedRecordId,
onSelectRecord
onSelectRecord,
onSelectSeller
}: {
records: SettlementRecordSummary[];
loading: boolean;
selectedRecordId: number | null;
onSelectRecord: (recordId: number) => Promise<void>;
onSelectSeller: (sellerRef: string) => void;
}) {
if (loading) {
return <SkeletonRows count={6} />;
Expand Down Expand Up @@ -2017,7 +2038,16 @@ function RecentSettlementsTable({
</span>
</td>
<td>
<strong>{record.sellerRef}</strong>
<button
className="linkButton mono"
type="button"
onClick={(event) => {
event.stopPropagation();
onSelectSeller(record.sellerRef);
}}
>
{record.sellerRef}
</button>
<span className="cellMeta mono">{record.paymentProfileId}</span>
</td>
<td>
Expand All @@ -2027,10 +2057,12 @@ function RecentSettlementsTable({
<td className="mono">{record.amountUsdc ? `${record.amountUsdc} USDC` : record.amountAtomic || "unknown"}</td>
<td className="mono">{shorten(record.payer)}</td>
<td className="mono">{shorten(record.payTo)}</td>
<td className="mono">{record.transaction ? shorten(record.transaction) : record.errorReason || "pending"}</td>
<td>
<TransactionCell record={record} />
</td>
<td>
<button
className="iconButton smallIconButton"
className="secondaryButton compactButton"
type="button"
aria-label={`View settlement ${record.recordId}`}
onClick={(event) => {
Expand All @@ -2039,6 +2071,7 @@ function RecentSettlementsTable({
}}
>
<Eye size={15} />
Inspect
</button>
</td>
</tr>
Expand All @@ -2049,6 +2082,20 @@ function RecentSettlementsTable({
);
}

function TransactionCell({ record }: { record: SettlementRecordSummary }) {
if (!record.transaction) {
return <span className="mono">{record.errorReason || "pending"}</span>;
}
return (
<span className="transactionCell">
<span className="mono">{shorten(record.transaction)}</span>
<span className="cellMeta">
{record.provider === "circle_gateway" ? "Gateway reference" : "Evidence in detail"}
</span>
</span>
);
}

function SettlementDetailPanel({
detail,
loadState,
Expand All @@ -2061,6 +2108,8 @@ function SettlementDetailPanel({
onSelectSeller: (sellerRef: string) => void;
}) {
const record = detail?.record;
const [copyStatus, setCopyStatus] = useState<string | null>(null);
const [copyingValue, setCopyingValue] = useState<string | null>(null);
return (
<section className="widePanel settlementDetailPanel">
<div className="panelHeader">
Expand Down Expand Up @@ -2096,19 +2145,72 @@ function SettlementDetailPanel({
<div className="wideDetailBlock">
<div className="detailSectionHeader">
<h3>Transaction Evidence</h3>
{record.explorerUrl ? (
<a className="secondaryButton compactButton" href={record.explorerUrl} target="_blank" rel="noreferrer">
<ExternalLink size={15} />
Open explorer
</a>
) : null}
<div className="detailActions">
{record.transaction ? (
<button
className="secondaryButton compactButton"
type="button"
disabled={copyingValue === record.transaction}
aria-busy={copyingValue === record.transaction}
onClick={() => void copyText(record.transaction, setCopyStatus, setCopyingValue)}
>
<Copy size={15} />
Copy transaction
</button>
) : null}
{record.explorerUrl ? (
<a className="secondaryButton compactButton" href={record.explorerUrl} target="_blank" rel="noreferrer">
<ExternalLink size={15} />
Open explorer
</a>
) : null}
</div>
</div>
<div className="statusList">
<div className="statusRow"><span>{record.transactionKind === "gateway_transfer" ? "Gateway Transfer" : "Transaction Hash"}</span><strong className="mono">{record.transaction || "pending"}</strong></div>
<div className="statusRow"><span>Payer</span><strong className="mono">{record.payer || "unknown"}</strong></div>
<div className="statusRow"><span>Pay To</span><strong className="mono">{record.payTo || "unknown"}</strong></div>
<div className="statusRow"><span>Asset</span><strong className="mono">{assetLabel(record.asset)}</strong></div>
</div>
<div className="evidenceActions">
{record.traceId ? (
<button
className="secondaryButton compactButton"
type="button"
disabled={copyingValue === record.traceId}
aria-busy={copyingValue === record.traceId}
onClick={() => void copyText(record.traceId, setCopyStatus, setCopyingValue)}
>
<Copy size={15} />
Copy trace
</button>
) : null}
{record.payer ? (
<button
className="secondaryButton compactButton"
type="button"
disabled={copyingValue === record.payer}
aria-busy={copyingValue === record.payer}
onClick={() => void copyText(record.payer, setCopyStatus, setCopyingValue)}
>
<Copy size={15} />
Copy payer
</button>
) : null}
{record.payTo ? (
<button
className="secondaryButton compactButton"
type="button"
disabled={copyingValue === record.payTo}
aria-busy={copyingValue === record.payTo}
onClick={() => void copyText(record.payTo, setCopyStatus, setCopyingValue)}
>
<Copy size={15} />
Copy pay to
</button>
) : null}
{copyStatus ? <span className="inlineHint">{copyStatus}</span> : null}
</div>
</div>
<div className="wideDetailBlock">
<div className="detailSectionHeader">
Expand Down Expand Up @@ -2142,7 +2244,7 @@ function SettlementDetailPanel({
<ExternalLink size={15} />
</a>
) : (
<span className="cellMeta">{attempt.transaction ? "reference" : "none"}</span>
<span className="cellMeta">{attempt.transactionKind === "gateway_transfer" ? "Gateway reference" : attempt.transaction ? "Reference" : "none"}</span>
)}
</td>
<td>{attempt.errorReason || "none"}</td>
Expand Down
Loading
Loading