diff --git a/clients/web/src/components/atoms/AnnotationBadge/AnnotationBadge.tsx b/clients/web/src/components/atoms/AnnotationBadge/AnnotationBadge.tsx index bf696577..a7490f70 100644 --- a/clients/web/src/components/atoms/AnnotationBadge/AnnotationBadge.tsx +++ b/clients/web/src/components/atoms/AnnotationBadge/AnnotationBadge.tsx @@ -1,4 +1,4 @@ -import { Badge } from "@mantine/core"; +import { Badge, useComputedColorScheme } from "@mantine/core"; export type AnnotationVariant = | "audience" @@ -17,11 +17,11 @@ const variantMap: Record< AnnotationVariant, { color: string; variant: string } > = { - audience: { color: "gray", variant: "outline" }, - readOnly: { color: "dark", variant: "filled" }, - destructive: { color: "red", variant: "outline" }, - longRun: { color: "yellow", variant: "outline" }, - priority: { color: "orange", variant: "light" }, + audience: { color: "blue", variant: "outline" }, + readOnly: { color: "green", variant: "filled" }, + destructive: { color: "red", variant: "filled" }, + longRun: { color: "yellow", variant: "filled" }, + priority: { color: "orange", variant: "filled" }, default: { color: "gray", variant: "light" }, }; @@ -29,10 +29,13 @@ export function AnnotationBadge({ label, variant = "default", }: AnnotationBadgeProps) { + const colorScheme = useComputedColorScheme(); const { color, variant: badgeVariant } = variantMap[variant]; + const textColor = + (variant === "priority" || variant === "destructive") && colorScheme === "dark" ? "black" : undefined; return ( - + {label} ); diff --git a/clients/web/src/components/atoms/SubscribeButton/SubscribeButton.stories.tsx b/clients/web/src/components/atoms/SubscribeButton/SubscribeButton.stories.tsx new file mode 100644 index 00000000..c2bbdfdb --- /dev/null +++ b/clients/web/src/components/atoms/SubscribeButton/SubscribeButton.stories.tsx @@ -0,0 +1,26 @@ +import type { Meta, StoryObj } from "@storybook/react-vite"; +import { fn } from "storybook/test"; +import { SubscribeButton } from "./SubscribeButton"; + +const meta: Meta = { + title: "Atoms/SubscribeButton", + component: SubscribeButton, + args: { + onToggle: fn(), + }, +}; + +export default meta; +type Story = StoryObj; + +export const Subscribed: Story = { + args: { + subscribed: true, + }, +}; + +export const Unsubscribed: Story = { + args: { + subscribed: false, + }, +}; diff --git a/clients/web/src/components/atoms/SubscribeButton/SubscribeButton.tsx b/clients/web/src/components/atoms/SubscribeButton/SubscribeButton.tsx new file mode 100644 index 00000000..3b0ccc36 --- /dev/null +++ b/clients/web/src/components/atoms/SubscribeButton/SubscribeButton.tsx @@ -0,0 +1,17 @@ +import { Button } from "@mantine/core"; + +export interface SubscribeButtonProps { + subscribed: boolean; + onToggle: () => void; +} + +export function SubscribeButton({ + subscribed, + onToggle, +}: SubscribeButtonProps) { + return ( + + ); +} diff --git a/clients/web/src/components/layouts/ConnectedLayout/ConnectedLayout.stories.tsx b/clients/web/src/components/layouts/ConnectedLayout/ConnectedLayout.stories.tsx index 2980c32b..c86161b9 100644 --- a/clients/web/src/components/layouts/ConnectedLayout/ConnectedLayout.stories.tsx +++ b/clients/web/src/components/layouts/ConnectedLayout/ConnectedLayout.stories.tsx @@ -2,6 +2,9 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { fn } from "storybook/test"; import { Text } from "@mantine/core"; import { ConnectedLayout } from "./ConnectedLayout"; +import { ToolsScreen } from "../../organisms/ToolsScreen/ToolsScreen"; +import { ResourcesScreen } from "../../organisms/ResourcesScreen/ResourcesScreen"; +import { PromptsScreen } from "../../organisms/PromptsScreen/PromptsScreen"; const allTabs = ["Tools", "Resources", "Prompts", "Logs", "Tasks", "History"]; @@ -27,14 +30,153 @@ type Story = StoryObj; export const ToolsActive: Story = { args: { activeTab: "Tools", - children: Tools screen content, + children: ( + + ), }, }; export const ResourcesActive: Story = { args: { activeTab: "Resources", - children: Resources screen content, + children: ( + + ), + }, +}; + +export const PromptsActive: Story = { + args: { + activeTab: "Prompts", + children: ( + + ), }, }; @@ -47,7 +189,7 @@ export const LimitedTabs: Story = { export const LongServerName: Story = { args: { - serverName: "my-very-long-server-name-that-might-overflow", + serverName: "my-very-long-server-name-that-might-overflow-is", children: Tools screen content, }, }; diff --git a/clients/web/src/components/layouts/ConnectedLayout/ConnectedLayout.tsx b/clients/web/src/components/layouts/ConnectedLayout/ConnectedLayout.tsx index 2417be8c..8cc850bb 100644 --- a/clients/web/src/components/layouts/ConnectedLayout/ConnectedLayout.tsx +++ b/clients/web/src/components/layouts/ConnectedLayout/ConnectedLayout.tsx @@ -1,7 +1,9 @@ import type { ReactNode } from "react"; -import { ActionIcon, AppShell, Button, Group, Tabs, Text } from "@mantine/core"; +import { ActionIcon, AppShell, Button, Group, Image, SegmentedControl, Text } from "@mantine/core"; import { useComputedColorScheme } from "@mantine/core"; import { StatusIndicator } from "../../atoms/StatusIndicator/StatusIndicator"; +import mcpLogo from "../../../theme/assets/MCP.svg"; +import mcpLogoDark from "../../../theme/assets/MCP-dark.svg"; export interface ConnectedLayoutProps { serverName: string; @@ -18,6 +20,8 @@ export interface ConnectedLayoutProps { const ServerName = Text.withProps({ fw: 600, size: "lg", + truncate: "end", + maw: "calc(100% - 40px)", }); export function ConnectedLayout({ @@ -36,35 +40,23 @@ export function ConnectedLayout({ return ( - - + + + MCP {serverName} - - value && onTabChange(value)} - variant="default" - > - - {availableTabs.map((tab) => ( - - {tab} - - ))} - - + + + - - - {colorScheme === "dark" ? "\u2600" : "\u263E"} - + + + + {colorScheme === "dark" ? "\u2600" : "\u263E"} + diff --git a/clients/web/src/components/molecules/PromptArgumentsForm/PromptArgumentsForm.tsx b/clients/web/src/components/molecules/PromptArgumentsForm/PromptArgumentsForm.tsx index 3281729f..0194f920 100644 --- a/clients/web/src/components/molecules/PromptArgumentsForm/PromptArgumentsForm.tsx +++ b/clients/web/src/components/molecules/PromptArgumentsForm/PromptArgumentsForm.tsx @@ -34,7 +34,7 @@ export function PromptArgumentsForm({ return ( - Select Prompt + Prompts