A clean, simple React table component that displays span data through message-based communication. The component listens for postMessage events and displays span data in a table format matching the provided design.
postMessage events with span dataThe component accepts data messages in this format:
{
type: 'data',
data: {
span_id: string,
input: unknown, // Any data type
output: unknown, // Any data type
expected: unknown, // Any data type
metadata: unknown | null // Any data type or null
}
}
The component automatically starts listening for messages when mounted. To send data:
// Send span data
window.postMessage({
type: 'data',
data: {
span_id: 'd42cbeb6-aaff-43d6-8517-99bbbd82b941',
input: "Some input text",
output: "Some output text",
expected: 1,
metadata: { some: "additional info" }
}
}, '*');
/): Clean table with sample data/demo): Interactive demo with buttons to test different data├── backend/
│ └── index.ts # Hono server for serving files
├── frontend/
│ ├── components/
│ │ └── SpanTable.tsx # Main table component
│ ├── index.html # Clean table display
│ ├── demo.html # Interactive demo
│ └── test-messages.js # Test utilities
└── README.md
The table displays data in this column order: