From 8483b98c3715fe7c29b2538172a78457bc1f035e Mon Sep 17 00:00:00 2001 From: cliffhall Date: Sun, 5 Apr 2026 09:36:14 -0400 Subject: [PATCH] Collapse ServerSettingsForm into accordion and add subtle ListToggle variant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wraps every section of ServerSettingsForm (Connection Mode, Custom Headers, Request Metadata, Timeouts, OAuth Settings) in a controlled Mantine Accordion. The accordion is driven by new required `expandedSections` / `onExpandedSectionsChange` props so the parent owns expand/collapse state — consistent with the dumb-component principle. Adds a `variant?: "default" | "subtle"` prop to ListToggle. In subtle mode it renders as an ActionIcon with `variant="subtle"`, `color="gray"`, and a 16px icon so it visually matches Mantine's CloseButton in modal headers (transparent until hover). Adds a WithSettingsModal story on UnconnectedView that presents the form inside a Mantine Modal with a custom three-column header: subtle ListToggle on the left (expands/collapses all sections at once), "Server Settings" Title centered, CloseButton on the right. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../ListToggle/ListToggle.stories.tsx | 16 ++ .../elements/ListToggle/ListToggle.tsx | 17 +- .../ServerSettingsForm.stories.tsx | 2 + .../ServerSettingsForm/ServerSettingsForm.tsx | 220 +++++++++++------- .../UnconnectedView.stories.tsx | 97 ++++++++ 5 files changed, 260 insertions(+), 92 deletions(-) diff --git a/clients/web/src/components/elements/ListToggle/ListToggle.stories.tsx b/clients/web/src/components/elements/ListToggle/ListToggle.stories.tsx index fca3a320..dd31d814 100644 --- a/clients/web/src/components/elements/ListToggle/ListToggle.stories.tsx +++ b/clients/web/src/components/elements/ListToggle/ListToggle.stories.tsx @@ -23,3 +23,19 @@ export const Collapsed: Story = { onToggle: fn(), }, }; + +export const SubtleExpanded: Story = { + args: { + compact: false, + variant: "subtle", + onToggle: fn(), + }, +}; + +export const SubtleCollapsed: Story = { + args: { + compact: true, + variant: "subtle", + onToggle: fn(), + }, +}; diff --git a/clients/web/src/components/elements/ListToggle/ListToggle.tsx b/clients/web/src/components/elements/ListToggle/ListToggle.tsx index 0d12ca1c..27964ddd 100644 --- a/clients/web/src/components/elements/ListToggle/ListToggle.tsx +++ b/clients/web/src/components/elements/ListToggle/ListToggle.tsx @@ -1,14 +1,27 @@ -import { Button } from "@mantine/core"; +import { ActionIcon, Button } from "@mantine/core"; import { RiExpandVerticalLine, RiCollapseVerticalLine } from "react-icons/ri"; export interface ListToggleProps { compact: boolean; onToggle: () => void; + variant?: "default" | "subtle"; } -export function ListToggle({ compact, onToggle }: ListToggleProps) { +export function ListToggle({ + compact, + onToggle, + variant = "default", +}: ListToggleProps) { const Icon = compact ? RiExpandVerticalLine : RiCollapseVerticalLine; + if (variant === "subtle") { + return ( + + + + ); + } + return (