Skip to content

Wire Export JSON on the History and Logging screens #1354

@cliffhall

Description

@cliffhall

Summary

The History (Requests) and Logging screens each render an Export JSON button, but the handlers wired from App.tsx are still todoNoop placeholders. Clicking the button does nothing. This is the follow-up to #1352-era observation that these buttons are no-ops in v2 today.

Files

  • clients/web/src/components/screens/HistoryScreen/HistoryScreen.tsxonExport: () => void prop, already wired through HistoryListPanel.
  • clients/web/src/components/screens/LoggingScreen/LoggingScreen.tsxonExport: () => void prop, already wired through LogStreamPanel.
  • clients/web/src/App.tsx — currently passes onExportHistory={todoNoop} and onExportLogs={todoNoop}.

Proposal

  • Build a small useExport helper (or inline handlers in App.tsx) that serializes the current in-memory entries to JSON and triggers a download via the existing downloadJsonFile helper in clients/web/src/lib/downloadFile.ts (already used by onServerExport).
  • History export shape: array of MessageEntry objects from the active MessageLogState. Include direction, timestamp, message, response, duration so a round-trip is meaningful for offline review.
  • Logging export shape: array of LogEntryData objects (the notifications/message entries the screen already renders). Use the same shape the screen consumes.
  • Filename suggestion: inspector-history-<server-id>-<iso-timestamp>.json and inspector-logs-<server-id>-<iso-timestamp>.json so multiple exports stay sortable.

Test plan

  • Unit-level: assert the exported JSON contains the expected entries when given a populated MessageLogState / log entries.
  • Manual: connect to a server, exercise a few tool calls, click Export JSON on each screen, verify a file downloads and re-importing into a JSON viewer shows the expected entries.

Out of scope

  • Re-importing exported files (load-from-file). That can be a separate feature.
  • Filtering exports by method / level. The current screen filters affect display only; export the full list and let the user filter offline.

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions