From 27186c2ff7c5e88161f336cc820607835548bb13 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Tue, 24 Mar 2026 14:06:11 -0400 Subject: [PATCH] refactor molecule components to use .withProps() subcomponents and extract inline code - Add UnstyledButton listItem theme variant to replace inline style for border-radius - Extract subcomponent constants with .withProps() across all molecules - Replace raw with Mantine in ResourcePreviewPanel - Extract inline template literals and expressions to named functions Co-Authored-By: Claude Opus 4.6 (1M context) --- .../ElicitationFormPanel.tsx | 20 ++- .../ElicitationUrlPanel.tsx | 40 ++++-- .../ExperimentalFeaturesPanel.tsx | 77 ++++++----- .../molecules/HistoryEntry/HistoryEntry.tsx | 127 +++++++++++------- .../ImportServerJsonPanel.tsx | 15 ++- .../InlineElicitationRequest.tsx | 56 +++++--- .../InlineSamplingRequest.tsx | 77 +++++++---- .../molecules/LogControls/LogControls.tsx | 13 +- .../PendingClientRequests.tsx | 10 +- .../PromptArgumentsForm.tsx | 15 ++- .../PromptMessagesDisplay.tsx | 9 +- .../ResourceListItem/ResourceListItem.tsx | 2 +- .../ResourcePreviewPanel.tsx | 63 ++++++--- .../ResourceTemplateInput.tsx | 9 +- .../molecules/ResultPanel/ResultPanel.tsx | 21 ++- .../molecules/RootsTable/RootsTable.tsx | 31 +++-- .../SamplingRequestPanel.tsx | 63 ++++++--- .../molecules/SchemaForm/SchemaForm.tsx | 26 ++-- .../molecules/ServerCard/ServerCard.tsx | 53 ++++---- .../ServerInfoContent/ServerInfoContent.tsx | 25 ++-- .../ServerSettingsForm/ServerSettingsForm.tsx | 57 ++++---- .../molecules/TaskCard/TaskCard.tsx | 106 ++++++++++----- .../ToolDetailPanel/ToolDetailPanel.tsx | 69 ++++++---- .../molecules/ToolListItem/ToolListItem.tsx | 27 ++-- clients/web/src/theme/UnstyledButton.ts | 10 ++ clients/web/src/theme/index.ts | 1 + clients/web/src/theme/theme.ts | 2 + 27 files changed, 667 insertions(+), 357 deletions(-) create mode 100644 clients/web/src/theme/UnstyledButton.ts diff --git a/clients/web/src/components/molecules/ElicitationFormPanel/ElicitationFormPanel.tsx b/clients/web/src/components/molecules/ElicitationFormPanel/ElicitationFormPanel.tsx index 6b6a0fb7..6507ec5f 100644 --- a/clients/web/src/components/molecules/ElicitationFormPanel/ElicitationFormPanel.tsx +++ b/clients/web/src/components/molecules/ElicitationFormPanel/ElicitationFormPanel.tsx @@ -12,6 +12,19 @@ export interface ElicitationFormPanelProps { onCancel: () => void; } +const QuotedMessage = Text.withProps({ + size: "md", + fs: "italic", +}); + +function formatQuoted(text: string): string { + return `\u201C${text}\u201D`; +} + +function formatWarning(serverName: string): string { + return `Only provide information you trust this server with. The server \u201C${serverName}\u201D is requesting this data.`; +} + export function ElicitationFormPanel({ message, schema, @@ -23,14 +36,11 @@ export function ElicitationFormPanel({ }: ElicitationFormPanelProps) { return ( - - “{message}” - + {formatQuoted(message)} - Only provide information you trust this server with. The server “ - {serverName}” is requesting this data. + {formatWarning(serverName)} + - + )) )} @@ -128,9 +151,7 @@ export function ExperimentalFeaturesPanel({ Advanced JSON-RPC Tester - - Send raw JSON-RPC requests to test ANY method - + Send raw JSON-RPC requests to test ANY method {customHeaders.map((header, index) => ( @@ -148,20 +169,14 @@ export function ExperimentalFeaturesPanel({ onHeaderChange(index, header.key, e.currentTarget.value) } /> - onRemoveHeader(index)} - > + onRemoveHeader(index)}> ✕ - + ))} - + + Add Header