Normalize screen layouts: extract control groups, unify sidebar widths, and refactor PromptsScreen
- Extract ToolControls group from ToolsScreen (search, list, list-changed indicator) - Extract PromptControls and PromptListItem groups for PromptsScreen sidebar - Refactor PromptsScreen to sidebar + detail layout (matching ResourcesScreen pattern) - Refactor PromptArgumentsForm to accept a single prompt instead of a dropdown - Normalize all screen sidebar widths to 340px (Tools, Resources, Prompts, Logs, Tasks, History) - Convert ToolsScreen from Grid-only to sidebar + Grid layout - Replace LogControls checkboxes with full-width toggle buttons - Move Clear/Export buttons from LogControls to LogStreamPanel toolbar - Make PromptArgumentsForm "Get Prompt" button right-aligned and compact - Update all affected stories and ConnectedView Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
eca6cf7665
commit
a6724626b7
1 changed files with 627 additions and 233 deletions
|
|
@ -0,0 +1,55 @@
|
|||
import { ScrollArea, Stack, TextInput, Title } from "@mantine/core";
|
||||
import { ListChangedIndicator } from "../../elements/ListChangedIndicator/ListChangedIndicator";
|
||||
import { ToolListItem } from "../ToolListItem/ToolListItem";
|
||||
import type { ToolListItemProps } from "../ToolListItem/ToolListItem";
|
||||
|
||||
export interface ToolControlsProps {
|
||||
tools: ToolListItemProps[];
|
||||
listChanged: boolean;
|
||||
searchText: string;
|
||||
onSearchChange: (text: string) => void;
|
||||
onRefreshList: () => void;
|
||||
onSelectTool: (name: string) => void;
|
||||
}
|
||||
|
||||
function listMaxHeight(): string {
|
||||
return "calc(100vh - var(--app-shell-header-height, 0px) - var(--mantine-spacing-xl) * 2 - 160px)";
|
||||
}
|
||||
|
||||
export function ToolControls({
|
||||
tools,
|
||||
listChanged,
|
||||
searchText,
|
||||
onSearchChange,
|
||||
onRefreshList,
|
||||
onSelectTool,
|
||||
}: ToolControlsProps) {
|
||||
const filteredTools = searchText
|
||||
? tools.filter((tool) =>
|
||||
tool.name.toLowerCase().includes(searchText.toLowerCase()),
|
||||
)
|
||||
: tools;
|
||||
|
||||
return (
|
||||
<Stack gap="sm">
|
||||
<Title order={4}>Tools</Title>
|
||||
<ListChangedIndicator visible={listChanged} onRefresh={onRefreshList} />
|
||||
<TextInput
|
||||
placeholder="Search tools..."
|
||||
value={searchText}
|
||||
onChange={(e) => onSearchChange(e.currentTarget.value)}
|
||||
/>
|
||||
<ScrollArea.Autosize mah={listMaxHeight()}>
|
||||
<Stack gap="xs">
|
||||
{filteredTools.map((tool) => (
|
||||
<ToolListItem
|
||||
key={tool.name}
|
||||
{...tool}
|
||||
onClick={() => onSelectTool(tool.name)}
|
||||
/>
|
||||
))}
|
||||
</Stack>
|
||||
</ScrollArea.Autosize>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue