Files
zeekay 1b367e2b62 chore: rebase the tree onto upstream master
The tree was a debranded snapshot of upstream taken around 2026-02-20, and
upstream has moved about five months since. This replaces it with upstream
master, mechanically re-derived: bin/debrand does the rename, and the
pipeline and squashed migrations are restored from the shipped tree.

Not a merge. The previous import replaced the tree wholesale in a single
commit, so there is no shared content history to merge against. Reproducing
the rename on the new tree is what actually converges.

What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints,
compose files, LLM.md, and insights/migrations. The squashed initial
migration is load-bearing — the live database records it by name, so
upstream's ~918 individual migrations cannot come back.

Nine products are dropped as unreferenced. Twenty-one more that we do not run
are kept anyway because the core app still imports them; unpicking those is a
refactor and does not belong in a rebase.

This base does not build yet, and the reasons are not in the rename:
upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against
our 4.2, and the dependency manifests still name upstream packages that we
republish under our own names. Those are decisions, not renames.
2026-08-01 15:44:40 -07:00

104 lines
4.4 KiB
TypeScript

import type { ReactElement } from 'react'
import { DataTable, type DataTableColumn, DescriptionList, formatDate } from '@hanzo/mcp-ui'
import { Badge, Card, CardContent } from '@hanzo/quill'
import { ExperimentData, ExperimentVariant, getConclusion, getStatus } from './utils'
export interface ExperimentViewProps {
experiment: ExperimentData
}
export function ExperimentView({ experiment }: ExperimentViewProps): ReactElement {
const status = getStatus(experiment)
const variants = experiment.feature_flag?.filters?.multivariate?.variants ?? []
const variantColumns: DataTableColumn<ExperimentVariant>[] = [
{ key: 'key', header: 'Key', sortable: true },
{ key: 'name', header: 'Name' },
{
key: 'rollout_percentage',
header: 'Split %',
align: 'right',
render: (row) => {
const pct = row.rollout_percentage
return pct != null ? `${pct}%` : '\u2014'
},
},
]
return (
<div className="p-4">
<div className="flex flex-col gap-3">
<div className="flex flex-col gap-1">
<div className="flex items-center gap-2 flex-wrap">
<span className="text-lg font-semibold">{experiment.name}</span>
<Badge variant={status.variant}>{status.label}</Badge>
{experiment.type && <Badge>{experiment.type}</Badge>}
</div>
{experiment.description && (
<span className="text-sm text-muted-foreground">{experiment.description}</span>
)}
</div>
<Card>
<CardContent>
<DescriptionList
columns={2}
items={[
...(experiment.feature_flag_key
? [{ label: 'Feature flag', value: experiment.feature_flag_key }]
: []),
...(experiment.start_date
? [{ label: 'Started', value: formatDate(experiment.start_date) }]
: []),
...(experiment.end_date
? [{ label: 'Ended', value: formatDate(experiment.end_date) }]
: []),
...(experiment.created_at
? [{ label: 'Created', value: formatDate(experiment.created_at) }]
: []),
]}
/>
</CardContent>
</Card>
{variants.length > 0 && (
<Card>
<CardContent>
<div className="flex flex-col gap-2">
<span className="text-sm font-semibold">Variants</span>
<DataTable<ExperimentVariant>
columns={variantColumns}
data={variants}
emptyMessage="No variants"
/>
</div>
</CardContent>
</Card>
)}
{experiment.conclusion && (
<Card>
<CardContent>
<div className="flex flex-col gap-2">
<div className="flex items-center gap-2">
<span className="text-sm font-semibold">Conclusion</span>
<Badge variant={getConclusion(experiment).variant}>
{getConclusion(experiment).label}
</Badge>
</div>
{experiment.conclusion_comment && (
<span className="text-sm text-muted-foreground">
{experiment.conclusion_comment}
</span>
)}
</div>
</CardContent>
</Card>
)}
</div>
</div>
)
}