Skip to content

Comments

fix: resolve user emails in Knowledge UI and audit chart timescale#147

Merged
cjimti merged 1 commit intomainfrom
fix/knowledge-user-emails-audit-chart
Feb 22, 2026
Merged

fix: resolve user emails in Knowledge UI and audit chart timescale#147
cjimti merged 1 commit intomainfrom
fix/knowledge-user-emails-audit-chart

Conversation

@cjimti
Copy link
Member

@cjimti cjimti commented Feb 22, 2026

Summary

Three bugs in the Admin portal:

  • Knowledge > Insights tab: "Captured By" column displayed raw UUIDs instead of user email addresses. Same for "Reviewed By" and "Applied By" in the insight detail drawer.
  • Knowledge > Changesets tab: "Applied By" column displayed raw UUIDs. Same for "Approved By", "Applied By", and "Rolled Back By" in the changeset detail drawer.
  • Audit > Overview tab: Activity chart X-axis labels didn't adapt to the selected time range (always showed HH:MM regardless of 1h/6h/24h/7d selection).

Changes

Knowledge user email resolution (KnowledgePage.tsx)

The audit filters endpoint already returns user_labels: Record<string, string> mapping user IDs to emails, and formatUser(id, email?) already handles display. The Knowledge page simply wasn't consuming this data.

  • Added useAuditFilters() hook call in both InsightsTab and ChangesetsTab
  • Updated all 8 formatUser(id) calls to formatUser(id, userLabels[id]):
    • InsightsTab table row (captured_by)
    • InsightDrawer metadata (captured_by), lifecycle (reviewed_by, applied_by)
    • ChangesetsTab table row (applied_by)
    • ChangesetDrawer metadata (approved_by, applied_by), rollback (rolled_back_by)
  • Passed userLabels as a prop from tab components into drawer components

Audit chart timescale (AuditLogPage.tsx)

The TimeseriesChart component already accepts an optional preset prop that controls X-axis label formatting (HH:MM for 1h/6h, hour-only for 24h, Mon DD for 7d). The OverviewTab had preset from useTimeRangeStore() but wasn't passing it through.

  • Added preset={preset} to the TimeseriesChart invocation (one-line fix)

Dependency bump (go.mod, go.sum, test)

  • Bumped mcp-datahub v0.8.0 → v0.8.1 (fixes Query mutation schema for flat subjects array)
  • Aligned datahub_client_writer_test.go mock response with the new response format

Test plan

  • npm run build in admin-ui/ — no TypeScript errors
  • make verify — full CI suite passes (fmt, test, lint, security, coverage, mutation, release-check)
  • Open Admin UI → Knowledge → Insights tab: "Captured By" shows email addresses instead of UUIDs
  • Click an insight row → drawer shows email for "Captured By", "Reviewed By", "Applied By"
  • Knowledge → Changesets tab: "Applied By" shows email addresses
  • Click a changeset row → drawer shows email for "Approved By", "Applied By", "Rolled Back By"
  • Audit → Overview tab: switch between 1h/6h/24h/7d and verify X-axis labels adapt (HH:MM → hour → Mon DD)

Knowledge Insights/Changesets tabs showed raw UUIDs instead of email
addresses. Wire useAuditFilters() user_labels map into all formatUser()
calls across InsightsTab, InsightDrawer, ChangesetsTab, and
ChangesetDrawer.

Audit Overview Activity chart X-axis labels didn't adapt to the selected
time range — pass the missing preset prop to TimeseriesChart.

Bump mcp-datahub to v0.8.1 and align writer test mock with flat subjects
array format.
@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (4dded54) to head (138b197).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #147   +/-   ##
=======================================
  Coverage   90.65%   90.65%           
=======================================
  Files         113      113           
  Lines       11032    11032           
=======================================
  Hits        10001    10001           
  Misses        743      743           
  Partials      288      288           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cjimti cjimti merged commit 8bf1ccd into main Feb 22, 2026
8 checks passed
@cjimti cjimti deleted the fix/knowledge-user-emails-audit-chart branch February 22, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant