Phase 5: Lift ServerEntry into core/mcp/types.ts
ServerEntry was previously defined as `Pick<ServerCardProps, ...>` in ServerListScreen, inverting the natural dependency direction (data shape derived from a UI prop type). Phase 5's cleanup pass calls this out specifically. Move the canonical ServerEntry into core/mcp/types.ts and have ServerCardProps extend it. ServerListScreen, InspectorView, and their stories now import ServerEntry from core directly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
56abced72b
commit
c5d02456e0
2 changed files with 23 additions and 22 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import { fn } from "storybook/test";
|
||||
import { ServerListScreen, type ServerEntry } from "./ServerListScreen";
|
||||
import type { ServerEntry } from "@inspector/core/mcp/types.js";
|
||||
import { ServerListScreen } from "./ServerListScreen";
|
||||
|
||||
const meta: Meta<typeof ServerListScreen> = {
|
||||
title: "Screens/ServerListScreen",
|
||||
|
|
|
|||
|
|
@ -1,13 +1,8 @@
|
|||
import { useState } from "react";
|
||||
import { ScrollArea, SimpleGrid, Stack, Text } from "@mantine/core";
|
||||
import type { ServerEntry } from "@inspector/core/mcp/types.js";
|
||||
import { ServerCard } from "../../groups/ServerCard/ServerCard";
|
||||
import { ServerListControls } from "../../groups/ServerListControls/ServerListControls";
|
||||
import type { ServerCardProps } from "../../groups/ServerCard/ServerCard";
|
||||
|
||||
export type ServerEntry = Pick<
|
||||
ServerCardProps,
|
||||
"id" | "name" | "config" | "info" | "connection"
|
||||
>;
|
||||
|
||||
export interface ServerListScreenProps {
|
||||
servers: ServerEntry[];
|
||||
|
|
|
|||
Loading…
Reference in a new issue