When the user clicked Clear in the History screen with a method filter applied, the filter persisted across the entry reset. Subsequent entries of a different method then displayed as zero results because the now- orphaned filter still applied. Wraps onClearAll at the screen level to also reset methodFilter to undefined (Option C from the issue) — narrow, no effects, no render-time divergence between the displayed and applied filter. Adds a play-driven story exercising the interaction. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3afb9803fb
commit
9f452807f6
1 changed files with 30 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { useMemo, useState } from "react";
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
import { Card, Flex, Stack } from "@mantine/core";
|
||||
import type { MessageEntry, MessageMethod } from "@inspector/core/mcp/types.js";
|
||||
import { HistoryControls } from "../../groups/HistoryControls/HistoryControls";
|
||||
|
|
@ -47,6 +47,11 @@ export function HistoryScreen({
|
|||
[entries],
|
||||
);
|
||||
|
||||
const handleClearAll = useCallback(() => {
|
||||
setMethodFilter(undefined);
|
||||
onClearAll();
|
||||
}, [onClearAll]);
|
||||
|
||||
return (
|
||||
<ScreenLayout>
|
||||
<Sidebar>
|
||||
|
|
@ -65,7 +70,7 @@ export function HistoryScreen({
|
|||
pinnedIds={pinnedIds}
|
||||
searchText={searchText}
|
||||
methodFilter={methodFilter}
|
||||
onClearAll={onClearAll}
|
||||
onClearAll={handleClearAll}
|
||||
onExport={onExport}
|
||||
onReplay={onReplay}
|
||||
onTogglePin={onTogglePin}
|
||||
|
|
|
|||
Loading…
Reference in a new issue