fix(ui): consistent attribute badge colors based on value hash across all views
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 59s
CI / docker (push) Successful in 55s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 35s

This commit is contained in:
hsiegeln
2026-03-28 15:37:49 +01:00
parent 626501cb04
commit 01c6d5c131
4 changed files with 31 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ import {
useSearchExecutions,
} from '../../api/queries/executions'
import type { ExecutionSummary } from '../../api/types'
import { attributeBadgeColor } from '../../utils/attribute-color'
import styles from './Dashboard.module.css'
// Row type extends ExecutionSummary with an `id` field for DataTable
@@ -127,7 +128,7 @@ function buildBaseColumns(): Column<Row>[] {
<div className={styles.attrCell}>
{shown.map(([k, v]) => (
<span key={k} title={k}>
<Badge label={String(v)} color="auto" />
<Badge label={String(v)} color={attributeBadgeColor(String(v))} />
</span>
))}
{overflow > 0 && <span className={styles.attrOverflow}>+{overflow}</span>}

View File

@@ -5,6 +5,7 @@ import { StatusDot, MonoText, Badge } from '@cameleer/design-system';
import { useCorrelationChain } from '../../api/queries/correlation';
import { useAgents } from '../../api/queries/agents';
import type { ExecutionDetail } from '../../components/ExecutionDiagram/types';
import { attributeBadgeColor } from '../../utils/attribute-color';
import styles from './ExchangeHeader.module.css';
interface ExchangeHeaderProps {
@@ -63,7 +64,7 @@ export function ExchangeHeader({ detail, onCorrelatedSelect }: ExchangeHeaderPro
<>
<span className={styles.separator} />
{attrs.map(([k, v]) => (
<Badge key={k} label={`${k}: ${v}`} color="auto" />
<Badge key={k} label={`${k}: ${v}`} color={attributeBadgeColor(String(v))} />
))}
</>
)}