Phase 2: Refactor History cluster to use MessageEntry#1218
Phase 2: Refactor History cluster to use MessageEntry#1218
Conversation
Replace ad hoc flat props with MessageEntry from core/mcp/types.ts
across the History group components and HistoryScreen.
- HistoryEntry: accept `entry: MessageEntry` instead of flat props
(timestamp, method, target, status, durationMs, parameters, response);
derive method/target/status from embedded JSON-RPC objects; fix
Collapse animation by removing outer {isExpanded && ...} wrapper;
drop childEntries (not part of MessageEntry)
- HistoryControls: type onMethodFilterChange as (string | undefined)
- HistoryListPanel: accept `MessageEntry[]` + `pinnedIds: Set<string>`
instead of separate entries/pinnedEntries arrays with pre-bound
callbacks; pass onReplay/onTogglePin by entry ID
- HistoryScreen: accept `MessageEntry[]` + `pinnedIds` + ID-based
callbacks; collapse two-array model into single list with pinned
overlay
- Delete local HistoryEntryProps data shape, HistoryChildEntry type
- Update all stories with real JSON-RPC MessageEntry fixtures
- Update ConnectedView HistoryActive story
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@claude review |
|
Claude finished @cliffhall's task in 2m 3s —— View job PR Review: Phase 2 — Refactor History cluster to use MessageEntry
This is a clean, well-scoped refactoring. The structural direction is correct: components now receive Issues1.
|
- Extract duplicated extractMethod into shared historyUtils.ts - Include response content in search (was accidentally dropped) - Show Parameters instead of raw Request in expanded view; gate on params existing so parameterless requests don't show empty block Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for the review — all three issues addressed in 986659a:
|
Summary
entry: MessageEntryinstead of 12 flat props; derives method/target/status from embedded JSON-RPC objects; fixes Collapse animation (same bug as TaskCard PR Phase 2: Refactor Tasks cluster to MCP SDK types #1217); dropschildEntries(not part of MessageEntry)onMethodFilterChangeas(string | undefined)instead of(string)MessageEntry[]+pinnedIds: Set<string>instead of two separateHistoryEntryProps[]arrays; passesonReplay/onTogglePinby entry ID instead of pre-bound callbacksMessageEntry[]+pinnedIds+ ID-based callbacks; collapses the two-array model into a single list with pinned overlayDeleted local types
HistoryEntryPropsas data shapeMessageEntryfromcore/mcp/types.tsHistoryChildEntrytimestamp: string,method,target,status,durationMs,parameters,responseMessageEntry.message(JSONRPCRequest) andMessageEntry.responseAdditional fixes
{isExpanded && <Collapse>}wrapper (same fix as TaskCard in PR Phase 2: Refactor Tasks cluster to MCP SDK types #1217)Dateobjects (viaMessageEntry.timestamp) instead of ISO stringsTest plan
npm run format— passesnpm run lint— passesnpm run build(includestsc -b) — passes🤖 Generated with Claude Code