feat(control-plane): revamp bank stats view and modernize shared UI primitives#1055
Merged
nicoloboschi merged 2 commits intomainfrom Apr 14, 2026
Merged
feat(control-plane): revamp bank stats view and modernize shared UI primitives#1055nicoloboschi merged 2 commits intomainfrom
nicoloboschi merged 2 commits intomainfrom
Conversation
…rimitives
Rework the bank stats tab to be dashboard-grade. Adds a new memories-ingested
time-series endpoint (1h/12h/1d/7d/30d/90d, zero-filled UTC buckets, per
fact-type breakdown), per-fact-type toggleable area chart, consolidated card
layout, modern palette, period switcher, and a memory-type staleness card for
mental models.
Also modernizes shared UI primitives so the new look propagates everywhere:
- ui/card.tsx: drop the harsh white border, use a soft ring + dark-mode-aware
shadow, rounded-xl.
- ui/table.tsx: self-contained rounded card with subtle ring, modern uppercase
header tint, softer row borders, last-row border collapse. Callers no longer
need border/rounded wrapping divs.
- fact-type-filter.tsx: align memory-type switch colors (World=violet,
Experience=pink, Observation=indigo) with the stats chart palette.
Backend:
- BankStatsResponse gains operations_by_status (all statuses grouped).
- GET /v1/default/banks/{bank_id}/stats/memories-timeseries returns padded
bucket sets anchored on UTC for a stable, timezone-independent response.
- Both fields/endpoints covered by tests in tests/test_bank_stats.py.
Clients: OpenAPI + Python/TypeScript/Go SDKs regenerated.
…overage
- bank-stats-view.tsx: use recharts TooltipContentProps (not TooltipProps) with
Partial<> so <Tooltip content={<ChartTooltip />}> type-checks in recharts v3;
introduce OpsStatusEntry to widen the tuple-inferred literal union.
- Regenerate skills/hindsight-docs/references/openapi.json via
scripts/generate-docs-skill.sh so verify-generated-files passes.
- Add get_memories_timeseries to hindsight-cli/.openapi-coverage.toml skip
list; this endpoint only makes sense for the UI chart.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backend
GET /v1/default/banks/{bank_id}/stats/memories-timeseries?period=<1h|12h|1d|7d|30d|90d>returning a fully-padded bucket set broken down by fact type. Buckets are anchored on UTC boundaries (deterministic across deployments; matches client-side ISO keys for zero-fill). Response shape:MemoriesTimeseriesResponse { bank_id, period, trunc, buckets: [MemoryTimeseriesBucket] }.BankStatsResponsegainsoperations_by_status: dict[str, int].tests/test_bank_stats.py(10 cases: all periods, empty-bank zero-fill, retained memories land in the right bucket, invalid period fallback, ops-status passthrough).Client / UI
/api/stats/[agentId]/memories-timeseries.bank-stats-view.tsxrewritten: unified card layout, palette driven by CSS vars (--primary/--chart-1..5where appropriate, with brand hexes kept for link types to match the graph view), customChartTooltip, reusableDistribution+ProgressRowhelpers, period & toggleable-series state.Test plan
cd hindsight-api-slim && uv run pytest tests/test_bank_stats.py -v— 10 passing../scripts/hooks/lint.sh— passing.