Address PR #1219 minor observations
- Tighten ElicitationFormPanel story fixtures from satisfies ElicitRequest["params"] to satisfies ElicitRequestFormParams - Show model preferences container when modelPreferences exists even without hints, so costPriority/speedPriority/intelligencePriority are visible independently - Fix stop reason ordering to match SDK enum: endTurn, stopSequence, maxTokens Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
513582ad50
commit
4b2d4d1622
2 changed files with 14 additions and 12 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||||
import type { ElicitRequest } from "@modelcontextprotocol/sdk/types.js";
|
import type { ElicitRequestFormParams } from "@modelcontextprotocol/sdk/types.js";
|
||||||
import { fn } from "storybook/test";
|
import { fn } from "storybook/test";
|
||||||
import { ElicitationFormPanel } from "./ElicitationFormPanel";
|
import { ElicitationFormPanel } from "./ElicitationFormPanel";
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ const dbRequest = {
|
||||||
database: { type: "string" as const, title: "Database" },
|
database: { type: "string" as const, title: "Database" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} satisfies ElicitRequest["params"];
|
} satisfies ElicitRequestFormParams;
|
||||||
|
|
||||||
const sslRequest = {
|
const sslRequest = {
|
||||||
message: "Please select your SSL mode preference.",
|
message: "Please select your SSL mode preference.",
|
||||||
|
|
@ -42,7 +42,7 @@ const sslRequest = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} satisfies ElicitRequest["params"];
|
} satisfies ElicitRequestFormParams;
|
||||||
|
|
||||||
const deployRequest = {
|
const deployRequest = {
|
||||||
message: "Please confirm the deployment.",
|
message: "Please confirm the deployment.",
|
||||||
|
|
@ -57,7 +57,7 @@ const deployRequest = {
|
||||||
confirm: { type: "boolean" as const, title: "Confirm deployment" },
|
confirm: { type: "boolean" as const, title: "Confirm deployment" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} satisfies ElicitRequest["params"];
|
} satisfies ElicitRequestFormParams;
|
||||||
|
|
||||||
export const SimpleForm: Story = {
|
export const SimpleForm: Story = {
|
||||||
args: { request: dbRequest },
|
args: { request: dbRequest },
|
||||||
|
|
|
||||||
|
|
@ -85,16 +85,18 @@ export function SamplingRequestPanel({
|
||||||
<MessageBubble key={index} index={index} message={message} />
|
<MessageBubble key={index} index={index} message={message} />
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{hints.length > 0 && (
|
{modelPreferences && (
|
||||||
<PreferencesContainer>
|
<PreferencesContainer>
|
||||||
<Stack gap="xs">
|
<Stack gap="xs">
|
||||||
<Title order={5}>Model Preferences:</Title>
|
<Title order={5}>Model Preferences:</Title>
|
||||||
<Group gap="xs">
|
{hints.length > 0 && (
|
||||||
<Text size="sm">Hints:</Text>
|
<Group gap="xs">
|
||||||
{hints.map((hint) => (
|
<Text size="sm">Hints:</Text>
|
||||||
<Badge key={hint}>{hint}</Badge>
|
{hints.map((hint) => (
|
||||||
))}
|
<Badge key={hint}>{hint}</Badge>
|
||||||
</Group>
|
))}
|
||||||
|
</Group>
|
||||||
|
)}
|
||||||
{modelPreferences?.costPriority !== undefined && (
|
{modelPreferences?.costPriority !== undefined && (
|
||||||
<Text size="sm">
|
<Text size="sm">
|
||||||
Cost Priority: {formatPriority(modelPreferences.costPriority)}
|
Cost Priority: {formatPriority(modelPreferences.costPriority)}
|
||||||
|
|
@ -160,7 +162,7 @@ export function SamplingRequestPanel({
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
label="Stop Reason"
|
label="Stop Reason"
|
||||||
data={["endTurn", "maxTokens", "stopSequence"]}
|
data={["endTurn", "stopSequence", "maxTokens"]}
|
||||||
value={draftResult.stopReason ?? null}
|
value={draftResult.stopReason ?? null}
|
||||||
onChange={(value) =>
|
onChange={(value) =>
|
||||||
onResultChange({
|
onResultChange({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue