storybook component fixes and improvements
- Add @storybook/addon-actions for action logging in stories - Add onTestCapability callback to ExperimentalFeaturesPanel - Use CopyButton overlay in ResourcePreviewPanel and ResultPanel - Replace includeContext checkbox with badge in SamplingRequestPanel - Add LongServerName story for ServerCard - Fix long tool name overflow with truncation and contained Paper variant - Add optional title prop to ToolListItem and ToolDetailPanel - Move tool annotations from list to detail panel form - Vertically center static text in ResourceTemplateInput - Fix InlineError blank space when no details Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4a4818e933
commit
1da76c53ef
1 changed files with 167 additions and 110 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Button, Divider, Group, Stack, Text, Title } from "@mantine/core";
|
||||
import { Button, Divider, Group, Stack, Text } from "@mantine/core";
|
||||
import { AnnotationBadge } from "../../atoms/AnnotationBadge/AnnotationBadge";
|
||||
import { ProgressDisplay } from "../../atoms/ProgressDisplay/ProgressDisplay";
|
||||
import { SchemaForm } from "../SchemaForm/SchemaForm";
|
||||
|
|
@ -14,6 +14,7 @@ export interface ToolAnnotations {
|
|||
|
||||
export interface ToolDetailPanelProps {
|
||||
name: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
annotations?: ToolAnnotations;
|
||||
schema: JsonSchema;
|
||||
|
|
@ -27,6 +28,7 @@ export interface ToolDetailPanelProps {
|
|||
|
||||
export function ToolDetailPanel({
|
||||
name,
|
||||
title,
|
||||
description,
|
||||
annotations,
|
||||
schema,
|
||||
|
|
@ -46,8 +48,39 @@ export function ToolDetailPanel({
|
|||
annotations.hints);
|
||||
|
||||
return (
|
||||
<Stack gap="md">
|
||||
<Title order={4}>Tool: {name}</Title>
|
||||
<Stack gap="md" miw={0}>
|
||||
<Text fw={700} size="lg" truncate="end">
|
||||
{title ?? name}
|
||||
</Text>
|
||||
{title && (
|
||||
<Text size="sm" c="dimmed" truncate="end">
|
||||
{name}
|
||||
</Text>
|
||||
)}
|
||||
{hasAnnotations && (
|
||||
<Group gap="xs">
|
||||
{annotations.audience && (
|
||||
<AnnotationBadge
|
||||
label={annotations.audience}
|
||||
variant="audience"
|
||||
/>
|
||||
)}
|
||||
{annotations.readOnly && (
|
||||
<AnnotationBadge label="read-only" variant="readOnly" />
|
||||
)}
|
||||
{annotations.destructive && (
|
||||
<AnnotationBadge label="destructive" variant="destructive" />
|
||||
)}
|
||||
{annotations.longRunning && (
|
||||
<AnnotationBadge label="long-run" variant="longRun" />
|
||||
)}
|
||||
{annotations.hints && (
|
||||
<Text size="xs" c="dimmed" fs="italic">
|
||||
{annotations.hints}
|
||||
</Text>
|
||||
)}
|
||||
</Group>
|
||||
)}
|
||||
|
||||
{description && (
|
||||
<Text size="sm" c="dimmed">
|
||||
|
|
@ -55,34 +88,6 @@ export function ToolDetailPanel({
|
|||
</Text>
|
||||
)}
|
||||
|
||||
{hasAnnotations && (
|
||||
<>
|
||||
<Text size="sm">Annotations:</Text>
|
||||
<Group gap="xs">
|
||||
{annotations.audience && (
|
||||
<AnnotationBadge
|
||||
label={annotations.audience}
|
||||
variant="audience"
|
||||
/>
|
||||
)}
|
||||
{annotations.readOnly && (
|
||||
<AnnotationBadge label="read-only" variant="readOnly" />
|
||||
)}
|
||||
{annotations.destructive && (
|
||||
<AnnotationBadge label="destructive" variant="destructive" />
|
||||
)}
|
||||
{annotations.longRunning && (
|
||||
<AnnotationBadge label="long-run" variant="longRun" />
|
||||
)}
|
||||
{annotations.hints && (
|
||||
<Text size="xs" c="dimmed" fs="italic">
|
||||
{annotations.hints}
|
||||
</Text>
|
||||
)}
|
||||
</Group>
|
||||
</>
|
||||
)}
|
||||
|
||||
<Divider />
|
||||
|
||||
<SchemaForm
|
||||
|
|
|
|||
Loading…
Reference in a new issue