Files
insights/products/mcp_analytics/frontend/MCPAnalyticsDashboardOverview.tsx
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

129 lines
5.4 KiB
TypeScript

import { useActions, useValues } from 'kea'
import { useChartTheme } from 'lib/charts/hooks'
import { FilterBar } from 'lib/components/FilterBar'
import { PropertyFilters } from 'lib/components/PropertyFilters/PropertyFilters'
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { TestAccountFilterSwitch } from 'lib/components/TestAccountFiltersSwitch'
import { teamLogic } from 'scenes/teamLogic'
import { McpDateFilter } from './components/McpDateFilter'
import { ActivityChart } from './dashboard/ActivityChart'
import { HarnessDonut } from './dashboard/HarnessDonut'
import { KpiTiles } from './dashboard/KpiTiles'
import { NotableSessionsTable } from './dashboard/NotableSessionsTable'
import { ToolErrorRateChart } from './dashboard/ToolErrorRateChart'
import { ToolUsageChart } from './dashboard/ToolUsageChart'
import { MCPAnalyticsFirstLook } from './firstLook/MCPAnalyticsFirstLook'
import { mcpDashboardOverviewLogic } from './mcpDashboardOverviewLogic'
export function MCPAnalyticsDashboardOverview(): JSX.Element {
const {
kpis,
kpisLoading,
users,
usersLoading,
intentClusterCount,
notableSessions,
sessionRowsLoading,
harnessRows,
harnessRowsLoading,
dailyActivity,
activityRowsLoading,
activityIncompleteTail,
kpiIncompleteTail,
toolDailySeries,
toolDailyRowsLoading,
toolRows,
toolRowsLoading,
dateFilter,
interval,
filterTestAccounts,
propertyFilters,
} = useValues(mcpDashboardOverviewLogic)
const { setDateFilter, setFilterTestAccounts, setPropertyFilters } = useActions(mcpDashboardOverviewLogic)
const { timezone } = useValues(teamLogic)
const theme = useChartTheme()
return (
<div className="flex flex-col gap-4">
<FilterBar
left={
<>
<McpDateFilter
dateFrom={dateFilter.dateFrom}
dateTo={dateFilter.dateTo}
onChange={(dateFrom, dateTo) => setDateFilter(dateFrom, dateTo)}
dataAttr="mcp-dashboard-date-filter"
/>
<div data-attr="mcp-dashboard-property-filter">
<PropertyFilters
pageKey="mcp-dashboard-overview"
propertyFilters={propertyFilters}
onChange={setPropertyFilters}
taxonomicGroupTypes={[
TaxonomicFilterGroupType.MCPProperties,
TaxonomicFilterGroupType.EventProperties,
TaxonomicFilterGroupType.EventFeatureFlags,
]}
eventNames={['$mcp_tool_call']}
buttonText="Add filter"
/>
</div>
</>
}
right={
<TestAccountFilterSwitch
checked={filterTestAccounts}
onChange={setFilterTestAccounts}
data-attr="mcp-dashboard-test-account-filter"
/>
}
/>
<MCPAnalyticsFirstLook />
<section data-quill>
<h2 className="mb-4 text-xl font-semibold text-primary">Key metrics</h2>
<KpiTiles
kpis={kpis}
users={users}
intentClusterCount={intentClusterCount}
kpisLoading={kpisLoading}
usersLoading={usersLoading}
theme={theme}
incompleteTail={kpiIncompleteTail}
/>
</section>
<section data-quill>
<h2 className="mb-4 text-xl font-semibold text-primary">Usage</h2>
<div className="flex flex-col gap-[22px]">
<div className="grid grid-cols-1 gap-[22px] lg:grid-cols-3">
<div className="flex lg:col-span-2">
<ActivityChart
daily={dailyActivity}
loading={activityRowsLoading}
theme={theme}
timezone={timezone}
interval={interval}
incompleteTail={activityIncompleteTail}
/>
</div>
<HarnessDonut rows={harnessRows} loading={harnessRowsLoading} theme={theme} />
</div>
<div className="grid grid-cols-1 gap-[22px] lg:grid-cols-2">
<ToolErrorRateChart rows={toolRows} loading={toolRowsLoading} theme={theme} />
<NotableSessionsTable sessions={notableSessions} loading={sessionRowsLoading} />
</div>
<ToolUsageChart
data={toolDailySeries}
loading={toolDailyRowsLoading}
theme={theme}
timezone={timezone}
interval={interval}
/>
</div>
</section>
</div>
)
}