Address PR #1212 code review feedback
- Fix hasAnyAnnotation checking annotations.title which is never rendered - Reset formValues when switching tools via onSelectTool handler - Extract ToolProgress type from ToolDetailPanel, reuse in ToolsScreen - Fix contradictory readOnlyHint + destructiveHint in story fixture - Replace listMaxHeight function with LIST_MAX_HEIGHT constant Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
92ecfcbd6c
commit
16f4d9b50f
2 changed files with 20 additions and 22 deletions
|
|
@ -50,7 +50,6 @@ const deleteRecordsTool: Tool = {
|
|||
name: "delete_records",
|
||||
description: "Deletes records matching the given criteria",
|
||||
annotations: {
|
||||
readOnlyHint: true,
|
||||
destructiveHint: true,
|
||||
},
|
||||
inputSchema: {
|
||||
|
|
|
|||
|
|
@ -8,14 +8,16 @@ import { AnnotationBadge } from "../../elements/AnnotationBadge/AnnotationBadge"
|
|||
import { ProgressDisplay } from "../../elements/ProgressDisplay/ProgressDisplay";
|
||||
import { SchemaForm } from "../SchemaForm/SchemaForm";
|
||||
|
||||
export type ToolProgress = Pick<
|
||||
ProgressNotification["params"],
|
||||
"progress" | "total" | "message"
|
||||
>;
|
||||
|
||||
export interface ToolDetailPanelProps {
|
||||
tool: Tool;
|
||||
formValues: Record<string, unknown>;
|
||||
isExecuting: boolean;
|
||||
progress?: Pick<
|
||||
ProgressNotification["params"],
|
||||
"progress" | "total" | "message"
|
||||
>;
|
||||
progress?: ToolProgress;
|
||||
onFormChange: (values: Record<string, unknown>) => void;
|
||||
onExecute: () => void;
|
||||
onCancel: () => void;
|
||||
|
|
@ -44,8 +46,7 @@ function resolveTitle(name: string, title?: string): string {
|
|||
function hasAnyAnnotation(annotations?: ToolAnnotations): boolean {
|
||||
return !!(
|
||||
annotations &&
|
||||
(annotations.title ||
|
||||
annotations.readOnlyHint ||
|
||||
(annotations.readOnlyHint ||
|
||||
annotations.destructiveHint ||
|
||||
annotations.idempotentHint ||
|
||||
annotations.openWorldHint)
|
||||
|
|
|
|||
Loading…
Reference in a new issue