Repository navigation
Description
Problem
When a tool ships with a very long description (e.g. sequential-thinking-server's "Sequential Thinking" tool — see the screenshot below), the ToolDetailPanel body grows past its container's height and pushes the form + Execute Tool button off the bottom of the screen. The ToolsScreen is correctly viewport-bounded (ScreenLayout uses h: "calc(100vh - var(--app-shell-header-height, 0px))" at clients/web/src/components/screens/ToolsScreen/ToolsScreen.tsx:28-34), so we want to keep that constraint and instead make the panel respect it.
Repro: open sequential-thinking-server in v2/main, select the "Sequential Thinking" tool. Description fills most of the viewport; the form fields below it are clipped at the bottom of the panel and the Execute Tool button is off-screen.
Screenshot
Proposed change
Two coordinated edits to clients/web/src/components/groups/ToolDetailPanel/ToolDetailPanel.tsx:
1. Collapsible description
Wrap the existing <DescriptionText>{description}</DescriptionText> (line 101) in a Mantine <Collapse in={descriptionOpen}>. Expose the trigger as a chevron icon on the right side of the tool name row, not as a separate button:
- Anchor inside
<TitleRow>(lines 80-83). Add a third child after<ToolTitle>that is the chevron toggle. The row is alreadywrap: "nowrap"withmiw: 0, so the chevron will pin to the right edge naturally — give the titleflex: 1to absorb the slack, or wrap the title + chevron in aGroup justify="space-between". - Icon set:
react-icons/fa(already a project dependency — see e.g.react-icons/mdandreact-icons/rialready in use inAppListItem.tsx:2,ServerAddMenu.tsx:2, etc.):FaChevronRightwhen description is collapsed (default state — long descriptions are the common case for the gnarly tools).FaChevronDownwhen expanded.
- Use an
UnstyledButtonorActionIconwitharia-label="Show description"/"Hide description"so screen readers can announce the state change. - Only render the chevron when a description actually exists (
descriptiontruthy). If there's no description, no chevron, no Collapse. - Default state: collapsed. Reset to collapsed on tool change so switching tools doesn't carry over the expanded state — the
selectedToolNamechange inToolsScreen.tsx:84-87already clearsformValues; mirror that for the panel's local "expanded" state.
2. Internal scroll for the SchemaForm region
The Execute Tool button (lines 114-124) must stay visible at the bottom of the panel regardless of how long the schema is. Wrap the <SchemaForm> (lines 105-110) + <ProgressDisplay> (line 112) in a ScrollArea.Autosize (or equivalent) so they scroll inside a bounded region while the panel's chrome (title row, annotations, description-when-expanded, divider, button row) stays pinned.
- Use the same idiom we landed in the Connection Info modal's instructions block (
clients/web/src/components/groups/ConnectionInfoContent/ConnectionInfoContent.tsx:138):<ScrollArea.Autosize mah={…}>. Pickmahso the panel always lands flush with the same bottom margin asResourcesScreen/PromptsScreen/ServerListScreen— i.e. it should match theScreenLayout'sp: "xl"padding at the bottom rather than spilling under it. - The outer
<Stack>(line 79) probably needsh: "100%"so it fills theContentCardand lets the ScrollArea claim the remaining vertical space. TheContentCarditself isflex={1}inToolsScreen.tsx:92, which already gives it the viewport-bounded height the ScrollArea needs.
Acceptance criteria
- Loading a tool with a long description renders the description collapsed by default with
FaChevronRightto the right of the tool name. - Clicking the chevron expands the description (with the Mantine Collapse animation) and the icon flips to
FaChevronDown. - Switching to a different tool resets the description to collapsed.
- When the SchemaForm has many fields (or progress output), it scrolls inside its own container — the title row, annotations, description, divider, and Execute Tool button row remain pinned and never leave the viewport.
- The bottom of the
ToolDetailPanellands at the same baseline as other screens (matchingScreenLayout'sp: "xl"bottom padding). - Tools with no description still render the title row cleanly — no orphaned chevron.
- Existing
ToolDetailPanel.test.tsxand.stories.tsxupdated to cover both states (collapsed default + expanded toggle) and the internal-scroll wiring. -
npm run validate+npm run test:storybookpass.
Notes
CollapseandScrollAreaboth come from@mantine/core— no new dependency surface.- Per project conventions: define the chevron button as a
withPropssubcomponent constant (e.g.const DescriptionToggle = ActionIcon.withProps({ variant: "subtle", "aria-label": …, size: "sm" })) rather than inline props. - This is a polish item, not a blocker for new tool development —
BacklogorFit and Finishcolumn on the V2 board, whichever you prefer.
Screenshot
(Attached by the requester — Sequential Thinking tool's description filling the middle column with the form clipped at the bottom.)
Activity
fix(web): show tool description by default, click to hide (#1381)
fix(web): collapsible tool description in ToolDetailPanel — shown by …