@devries-cameron20 / t3code-1 / commits / 4aa841a8d4
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

refactor(web): share settings group surfaces (#12360)

Julius Marminge committed Sep 17, 2026 at 20:19 UTC 4aa841a8d45ccd611a809351db0b693faba6ba13
5 files changed +48 -30
apps/web/src/components/settings/FoldedSettingsSection.tsx
+2 -5
@@ -1,3 +1,4 @@
1 +import { SettingsGroup } from "./SettingsGroup";
2 import { ChevronRightIcon } from "lucide-react";
3 import { type ReactNode, useState } from "react";
4
@@ -35,11 +36,7 @@ export function FoldedSettingsSection({
36
37 return (
38 <section id={id} ref={targetRef} tabIndex={-1} className="outline-none">
38 - <Collapsible
39 - open={open}
40 - onOpenChange={setOpen}
41 - className="rounded-xl border border-border/60 bg-card/40 text-foreground shadow-xs/5"
42 - >
39 + <Collapsible open={open} onOpenChange={setOpen} render={<SettingsGroup divided={false} />}>
40 <div className="flex items-center gap-4 px-3 sm:px-4">
41 <CollapsibleTrigger className="flex min-h-11 min-w-0 flex-1 items-center gap-2 py-2 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-md">
42 <ChevronRightIcon
apps/web/src/components/settings/ProviderSettingsPanel.tsx
+10 -13
@@ -1,3 +1,4 @@
1 +import { SettingsGroup } from "./SettingsGroup";
2 import { RefreshIcon } from "~/components/ui/refresh-icon";
3 import { useAtomValue } from "@effect/atom-react";
4 import { connectionStatusTitle } from "@t3tools/client-runtime/connection";
@@ -171,7 +172,6 @@ function providerEnvironmentDetail(environment: EnvironmentPresentation): string
172 return environment.displayUrl ?? "Remote device";
173 }
174
174 -const providerCardClassName = "rounded-xl border border-border/60 bg-card/40 shadow-xs/5";
175 // Shared by the editor grid and the placeholder states so switching devices
176 // never changes the card's footprint.
177 const providerCardHeightClassName =
@@ -199,12 +199,9 @@ function ProviderSettingsPlaceholder({
199 {deviceTabs ? (
200 <div className="flex min-h-11 min-w-0 items-center px-3 sm:px-4">{deviceTabs}</div>
201 ) : null}
202 - <div
203 - className={cn(
204 - providerCardClassName,
205 - providerCardHeightClassName,
206 - "flex overflow-x-hidden overflow-y-auto",
207 - )}
202 + <SettingsGroup
203 + divided={false}
204 + className={cn(providerCardHeightClassName, "flex overflow-x-hidden overflow-y-auto")}
205 >
206 <Empty className="min-h-88">
207 <EmptyMedia variant="icon">{icon}</EmptyMedia>
@@ -214,7 +211,7 @@ function ProviderSettingsPlaceholder({
211 </EmptyHeader>
212 {children ? <EmptyContent className="max-w-xl">{children}</EmptyContent> : null}
213 </Empty>
217 - </div>
214 + </SettingsGroup>
215 </SettingsSection>
216 );
217 }
@@ -1044,16 +1041,16 @@ export function EnvironmentProviderSettings({
1041 </div>
1042 </div>
1043 {readOnly ? (
1047 - <div className={cn(providerCardClassName, "overflow-hidden")}>
1044 + <SettingsGroup divided={false} className="overflow-hidden">
1045 <SettingsRow
1046 title="Limited permissions"
1047 description={`This session can view ${environmentLabel}'s providers but can't change their settings.`}
1048 />
1052 - </div>
1049 + </SettingsGroup>
1050 ) : null}
1054 - <div
1051 + <SettingsGroup
1052 + divided={false}
1053 className={cn(
1056 - providerCardClassName,
1054 providerCardHeightClassName,
1055 "overflow-hidden @min-[48rem]/providers:grid @min-[48rem]/providers:grid-cols-[17rem_minmax(0,1fr)]",
1056 )}
@@ -1083,7 +1080,7 @@ export function EnvironmentProviderSettings({
1080 </div>
1081 )}
1082 </div>
1086 - </div>
1083 + </SettingsGroup>
1084 </SettingsSection>
1085
1086 <UsageProviderSettings
apps/web/src/components/settings/SettingsGroup.tsx new
+30
@@ -0,0 +1,30 @@
1 +import type { ComponentProps } from "react";
2 +
3 +import { cn } from "../../lib/utils";
4 +
5 +/** Shared settings card surface, with optional separators between rows. */
6 +export function SettingsGroup({
7 + variant = "grouped",
8 + divided = true,
9 + className,
10 + ...props
11 +}: ComponentProps<"div"> & {
12 + variant?: "grouped" | "plain";
13 + divided?: boolean;
14 +}) {
15 + return (
16 + <div
17 + {...props}
18 + className={cn(
19 + "relative overflow-visible text-foreground",
20 + variant === "grouped"
21 + ? "rounded-xl border border-border/60 bg-card/40 shadow-xs/5"
22 + : "space-y-1",
23 + variant === "grouped" &&
24 + divided &&
25 + "[&>*+*]:border-t [&>*+*]:border-border/50 [&>[data-slot=settings-row]]:rounded-none",
26 + className,
27 + )}
28 + />
29 + );
30 +}
apps/web/src/components/settings/SettingsPanels.tsx
+3 -2
@@ -1,3 +1,4 @@
1 +import { SettingsGroup } from "./SettingsGroup";
2 import { Spinner } from "~/components/ui/spinner";
3 import { NotificationSettings } from "./NotificationSettings";
4 import { ArchiveIcon, ArchiveX, CheckIcon, ChevronRightIcon, SettingsIcon } from "lucide-react";
@@ -2047,7 +2048,7 @@ function LegacyFeaturesSection() {
2048 <ChevronRightIcon className="size-4 text-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90" />
2049 </CollapsibleTrigger>
2050 <CollapsiblePanel>
2050 - <div className="relative overflow-visible rounded-xl border border-border/60 bg-card/40 text-foreground shadow-xs/5 [&>*+*]:border-t [&>*+*]:border-border/50 [&>[data-slot=settings-row]]:rounded-none">
2051 + <SettingsGroup>
2052 <SettingsRow
2053 {...searchableSetting("legacy-plan-mode")}
2054 description="Restore Build/Plan, /plan, /default, and Shift+Tab. Off uses build mode."
@@ -2087,7 +2088,7 @@ function LegacyFeaturesSection() {
2088 />
2089 }
2090 />
2090 - </div>
2091 + </SettingsGroup>
2092 </CollapsiblePanel>
2093 </Collapsible>
2094 </section>
apps/web/src/components/settings/settingsLayout.tsx
+3 -10
@@ -1,3 +1,4 @@
1 +import { SettingsGroup } from "./SettingsGroup";
2 import { InfoIcon, Undo2Icon } from "lucide-react";
3 import { DEFAULT_SERVER_SETTINGS, type ServerSettings } from "@t3tools/contracts";
4 import * as Equal from "effect/Equal";
@@ -215,17 +216,9 @@ export function SettingsSection({
216 <div className="flex min-h-7 min-w-7 items-center justify-end">{headerAction}</div>
217 </div>
218 )}
218 - <div
219 - data-settings-scroll-target={hideTitle ? "" : undefined}
220 - className={cn(
221 - "relative overflow-visible text-foreground",
222 - variant === "grouped"
223 - ? "rounded-xl border border-border/60 bg-card/40 shadow-xs/5 [&>*+*]:border-t [&>*+*]:border-border/50 [&>[data-slot=settings-row]]:rounded-none"
224 - : "space-y-1",
225 - )}
226 - >
219 + <SettingsGroup data-settings-scroll-target={hideTitle ? "" : undefined} variant={variant}>
220 {children}
228 - </div>
221 + </SettingsGroup>
222 </section>
223 );
224 }