fix: hide empty attributes column, standardize status labels, truncate agent names
- Attributes column is now hidden when no exchanges in the current view have attributes; shown conditionally via hasAttributes check on rows - Status labels already standardized via statusLabel() in ExchangeHeader - Agent names truncated to last two hyphen-separated segments via shortAgentName(); full name preserved as tooltip title Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,9 +54,15 @@ function durationClass(ms: number, status: string): string {
|
|||||||
return styles.durBreach
|
return styles.durBreach
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Table columns (base, without inspect action) ────────────────────────────
|
function shortAgentName(name: string): string {
|
||||||
|
const parts = name.split('-')
|
||||||
|
if (parts.length >= 3) return parts.slice(-2).join('-')
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
|
||||||
function buildBaseColumns(): Column<Row>[] {
|
// ─── Table columns ────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
function buildColumns(hasAttributes: boolean): Column<Row>[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
key: 'status',
|
key: 'status',
|
||||||
@@ -87,10 +93,10 @@ function buildBaseColumns(): Column<Row>[] {
|
|||||||
<span className={styles.appName}>{row.applicationId ?? ''}</span>
|
<span className={styles.appName}>{row.applicationId ?? ''}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
...(hasAttributes ? [{
|
||||||
key: 'attributes',
|
key: 'attributes' as const,
|
||||||
header: 'Attributes',
|
header: 'Attributes',
|
||||||
render: (_, row) => {
|
render: (_: unknown, row: Row) => {
|
||||||
const attrs = row.attributes;
|
const attrs = row.attributes;
|
||||||
if (!attrs || Object.keys(attrs).length === 0) return <span className={styles.muted}>—</span>;
|
if (!attrs || Object.keys(attrs).length === 0) return <span className={styles.muted}>—</span>;
|
||||||
const entries = Object.entries(attrs);
|
const entries = Object.entries(attrs);
|
||||||
@@ -107,7 +113,7 @@ function buildBaseColumns(): Column<Row>[] {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
}] : []),
|
||||||
{
|
{
|
||||||
key: 'executionId',
|
key: 'executionId',
|
||||||
header: 'Exchange ID',
|
header: 'Exchange ID',
|
||||||
@@ -150,7 +156,7 @@ function buildBaseColumns(): Column<Row>[] {
|
|||||||
render: (_: unknown, row: Row) => (
|
render: (_: unknown, row: Row) => (
|
||||||
<span className={styles.agentBadge}>
|
<span className={styles.agentBadge}>
|
||||||
<span className={styles.agentDot} />
|
<span className={styles.agentDot} />
|
||||||
{row.instanceId}
|
<span title={row.instanceId}>{shortAgentName(row.instanceId)}</span>
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@@ -223,7 +229,8 @@ export default function Dashboard({ onExchangeSelect, activeExchangeId }: Dashbo
|
|||||||
)
|
)
|
||||||
|
|
||||||
// ─── Table columns ──────────────────────────────────────────────────────
|
// ─── Table columns ──────────────────────────────────────────────────────
|
||||||
const columns: Column<Row>[] = useMemo(() => buildBaseColumns(), [])
|
const hasAttributes = rows.some(r => r.attributes && Object.keys(r.attributes).length > 0)
|
||||||
|
const columns: Column<Row>[] = useMemo(() => buildColumns(hasAttributes), [hasAttributes])
|
||||||
|
|
||||||
// ─── Row click → navigate to diagram view ────────────────────────────────
|
// ─── Row click → navigate to diagram view ────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user