Skip to content
TypeScript

feat(web): reorganize settings pages (#9354)

maria343db2c328af
diff --git a/apps/web/src/components/settings/ConnectionsSettings.tsx b/apps/web/src/components/settings/ConnectionsSettings.tsx
index d4a9c949231..1c4e034cf6a 100644
--- a/apps/web/src/components/settings/ConnectionsSettings.tsx
+++ b/apps/web/src/components/settings/ConnectionsSettings.tsx
@@ -1710,7 +1710,7 @@ function ConfiguredCloudLinkRow({ canManageRelay }: { readonly canManageRelay: b
) : null}
<SettingsRow
title={searchableSetting("publish-agent-activity").title}
- description="Send activity from this environment to your mobile clients for push notifications and Live Activities. Works without a T3 Connect tunnel."
+ description="Send activity to mobile notifications and Live Activities without T3 Connect."
control={
<CloudLinkSwitch
ariaLabel="Publish agent activity to mobile clients"
@@ -2907,7 +2907,7 @@ export function ConnectionsSettings() {
return (
<SettingsRow
{...searchableSetting("wsl-backend")}
- description="WSL is no longer available, so the Windows backend is running instead. Switch off the WSL backend to clear this preference."
+ description="WSL is unavailable, so Windows is running instead. Turn WSL off to clear this preference."
status={
desktopWslError ? (
<span className="block text-destructive">{desktopWslError}</span>
@@ -2945,7 +2945,7 @@ export function ConnectionsSettings() {
<>
<SettingsRow
{...searchableSetting("wsl-backend")}
- description="Run a second backend inside a WSL distro alongside the Windows one. Pick a distro to start it; pick Off to stop it. Projects opened against the WSL backend live on the Linux side; Windows projects stay where they are."
+ description="Run the selected WSL distro alongside Windows. Projects remain on their current filesystem."
status={
desktopWslError ? (
<span className="block text-destructive">{desktopWslError}</span>
@@ -2994,7 +2994,7 @@ export function ConnectionsSettings() {
{desktopWslState.enabled ? (
<SettingsRow
title="WSL only"
- description="Stop the Windows backend and run only the WSL backend. Useful if you develop entirely inside WSL and don't want a second backend process. T3 Code restarts when you change this."
+ description="Run only the WSL backend. T3 Code restarts when this changes."
className="bg-muted/20 pl-7 sm:pl-8"
control={
<Switch
@@ -3098,8 +3098,8 @@ export function ConnectionsSettings() {
title={searchableSetting("network-access").title}
description={
currentAuthPolicy === "remote-reachable"
- ? "This backend is already configured for remote access. Network exposure changes must be made where the server is launched."
- : "This backend is only reachable on this machine. Restart it with a non-loopback host to enable remote pairing."
+ ? "Remote access is already configured. Change network exposure where the server starts."
+ : "Only this machine can connect. Restart with a non-loopback host for remote pairing."
}
control={
<Tooltip>
diff --git a/apps/web/src/components/settings/IntegrationsSettings.tsx b/apps/web/src/components/settings/IntegrationsSettings.tsx
index b2b51f5bf1a..5b1d9ba5e21 100644
--- a/apps/web/src/components/settings/IntegrationsSettings.tsx
+++ b/apps/web/src/components/settings/IntegrationsSettings.tsx
@@ -262,7 +262,7 @@ function BrowserViewportSetting({ disabled }: { readonly disabled: boolean }) {
return (
<SettingsRow
{...searchableSetting("browser-default-viewport")}
- description="The viewport a browser tab opens at, for both you and agents. Fill sizes the page to the panel; any other choice opens the device toolbar at that size."
+ description="Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar."
resetAction={
!disabled && viewport._tag !== DEFAULT_BROWSER_VIEWPORT._tag ? (
<SettingResetButton
@@ -460,7 +460,7 @@ function BrowserRecordingFrameRateSetting({ disabled }: { readonly disabled: boo
return (
<SettingsRow
{...searchableSetting("browser-recording-frame-rate")}
- description="Maximum frame rate for browser recordings. 30 fps is the default and uses less CPU and storage; 60 fps captures smoother motion."
+ description="Maximum recording rate. 30 fps saves CPU and storage; 60 fps is smoother."
resetAction={
!disabled && frameRate !== DEFAULT_BROWSER_RECORDING_FRAME_RATE ? (
<SettingResetButton
@@ -557,7 +557,7 @@ function AgentBrowserAccessSetting() {
<SettingsRow
serverScoped
{...searchableSetting("agent-browser-access")}
- description="Let agents open and drive the preview browser. When off, the browser tools and the instructions describing them are withheld from agent sessions. Your own browser panel is unaffected."
+ description="Allow agents to use the preview browser. Off hides browser tools from agents, not you."
status={
settings.enableAgentBrowserAccess
? undefined
@@ -595,7 +595,7 @@ function BrowserAutoShowFloatingPreviewSetting({ disabled }: { readonly disabled
return (
<SettingsRow
{...searchableSetting("browser-auto-show-floating-preview")}
- description="Pop the floating preview into view when an agent uses a browser. An agent that explicitly asks to show or hide its preview still gets what it asked for."
+ description="Show the floating preview when an agent opens a browser unless the agent says otherwise."
resetAction={
!disabled && autoShow !== DEFAULT_BROWSER_AUTO_SHOW_FLOATING_PREVIEW ? (
<SettingResetButton
@@ -638,7 +638,7 @@ function BrowserAutoShowFloatingPreviewSetting({ disabled }: { readonly disabled
*/
function DesktopOnlyBrowserDefaults({ children }: { readonly children: ReactNode }) {
return (
- <div className="rounded-xl border border-border/60 bg-muted/20 py-1.5">
+ <div className="border-border/60 bg-muted/20 py-1.5">
<div className="flex items-start gap-2 px-3 py-2 text-[12px] leading-relaxed text-muted-foreground sm:px-4">
<InfoIcon className="mt-0.5 size-3.5 shrink-0 text-warning" />
<p>Only available in the desktop app.</p>
@@ -933,7 +933,7 @@ function BrowserProfilesSetting({ disabled }: { readonly disabled: boolean }) {
return (
<SettingsRow
{...searchableSetting("browser-profiles")}
- description="Each profile has its own cookies and logins, so you can stay signed in to different accounts at once."
+ description="Profiles separate cookies and logins. Incognito data is cleared when the app closes."
control={
<Menu onOpenChange={(open) => open && loadSources()}>
<MenuTrigger
diff --git a/apps/web/src/components/settings/ProviderAccentColorPicker.tsx b/apps/web/src/components/settings/ProviderAccentColorPicker.tsx
index b6544d46db7..85cb69e0026 100644
--- a/apps/web/src/components/settings/ProviderAccentColorPicker.tsx
+++ b/apps/web/src/components/settings/ProviderAccentColorPicker.tsx
@@ -3,22 +3,12 @@
import { PipetteIcon, XIcon } from "lucide-react";
import { useCallback, useEffect, useMemo, useRef, useState, type PointerEvent } from "react";
-import { ColorSelector } from "../color-selector";
import { Button } from "../ui/button";
-import { Popover, PopoverPopup, PopoverTrigger } from "../ui/popover";
+import { Popover, PopoverClose, PopoverPopup, PopoverTrigger } from "../ui/popover";
import { normalizeProviderAccentColor } from "../../providerInstances";
import { cn } from "../../lib/utils";
-const PROVIDER_ACCENT_SWATCHES = [
- "#2563eb",
- "#16a34a",
- "#ea580c",
- "#dc2626",
- "#7c3aed",
- "#0891b2",
-] as const;
-
-const FALLBACK_ACCENT_COLOR = PROVIDER_ACCENT_SWATCHES[0];
+const FALLBACK_ACCENT_COLOR = "#2563eb";
function clamp(value: number, min = 0, max = 1) {
return Math.min(max, Math.max(min, value));
@@ -88,6 +78,7 @@ function ProviderCustomColorPanel(props: {
const initialHsv = useMemo(() => hexToHsv(props.value), [props.value]);
const [hsv, setHsv] = useState(initialHsv);
const currentColor = hsvToHex(hsv.h, hsv.s, hsv.v);
+ const [hexDraft, setHexDraft] = useState<string | null>(null);
const commitHsv = useCallback(
(nextHsv: typeof hsv) => {
@@ -162,13 +153,15 @@ function ProviderCustomColorPanel(props: {
/>
</div>
<input
- value={currentColor}
+ value={hexDraft ?? currentColor}
onChange={(event) => {
const nextColor = event.currentTarget.value;
+ setHexDraft(nextColor);
if (!/^#[\da-f]{6}$/i.test(nextColor)) return;
setHsv(hexToHsv(nextColor));
props.onCommit(nextColor);
}}
+ onBlur={() => setHexDraft(null)}
className="h-8 rounded-md border border-input bg-background px-2 font-mono text-xs text-foreground outline-none transition-colors focus:border-ring"
aria-label="Custom hex accent color"
spellCheck={false}
@@ -181,8 +174,8 @@ function ProviderCustomColorPanel(props: {
function ProviderCustomColorPicker(props: {
readonly displayName: string;
readonly value: string | undefined;
- readonly selected: boolean;
readonly onCommit: (value: string) => void;
+ readonly onClear: () => void;
}) {
const normalized = normalizeProviderAccentColor(props.value) ?? FALLBACK_ACCENT_COLOR;
@@ -193,20 +186,13 @@ function ProviderCustomColorPicker(props: {
<button
type="button"
className={cn(
- "flex size-6 cursor-pointer items-center justify-center rounded-full text-white transition-transform duration-200 active:scale-90",
- "hover:scale-105",
+ "flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md border border-input text-white shadow-xs transition-transform duration-200 active:scale-95",
+ "hover:scale-105 hover:border-ring/60",
)}
- style={{
- backgroundColor: normalized,
- ...(props.selected
- ? {
- boxShadow: `inset 0 0 0 2px var(--card), 0 0 0 2px ${normalized}`,
- }
- : {}),
- }}
- aria-label={`Choose custom accent color for ${props.displayName}`}
+ style={{ backgroundColor: normalized }}
+ aria-label={`Choose accent color for ${props.displayName}`}
>
- <PipetteIcon className="size-3 text-foreground/25" aria-hidden />
+ <PipetteIcon className="size-3 text-white/70 drop-shadow-sm" aria-hidden />
</button>
}
/>
@@ -217,6 +203,21 @@ function ProviderCustomColorPicker(props: {
className="overflow-hidden rounded-md p-0 [--viewport-inline-padding:0px] [&_[data-slot=popover-viewport]]:p-0"
>
<ProviderCustomColorPanel value={normalized} onCommit={props.onCommit} />
+ <PopoverClose
+ render={
+ <Button
+ type="button"
+ size="sm"
+ variant="ghost"
+ className="h-8 w-full justify-start rounded-none border-t border-border/60 px-3 text-xs text-muted-foreground [--control-icon-color:currentColor]"
+ onClick={props.onClear}
+ disabled={!props.value}
+ >
+ <XIcon className="size-3.5" aria-hidden />
+ Clear color
+ </Button>
+ }
+ />
</PopoverPopup>
</Popover>
);
@@ -297,59 +298,23 @@ export function ProviderAccentColorPicker(props: {
);
const normalized = normalizeProviderAccentColor(optimisticValue);
- const selectedValue =
- normalized &&
- PROVIDER_ACCENT_SWATCHES.includes(normalized as (typeof PROVIDER_ACCENT_SWATCHES)[number])
- ? normalized
- : "";
- const customSelected = Boolean(normalized && selectedValue === "");
-
- const swatchRow = (
- <div
- role="group"
- aria-label="Accent color"
- className="flex min-w-0 flex-wrap items-center gap-2"
- >
- <ProviderCustomColorPicker
- displayName={displayName}
- value={normalized}
- selected={customSelected}
- onCommit={commitAccentColor}
- />
- <ColorSelector
- key={selectedValue}
- colors={[...PROVIDER_ACCENT_SWATCHES]}
- defaultValue={selectedValue}
- size="lg"
- onColorSelect={commitAccentColor}
- className="flex-wrap gap-1.5"
- />
- <Button
- type="button"
- size="icon"
- variant="ghost"
- className={cn(
- "size-7 shrink-0 text-muted-foreground transition-opacity",
- normalized ? "opacity-100" : "pointer-events-none opacity-0",
- )}
- onClick={() => commitAccentColor("")}
- aria-label={`Clear accent color for ${displayName}`}
- aria-hidden={!normalized}
- tabIndex={normalized ? 0 : -1}
- >
- <XIcon className="size-3.5" aria-hidden />
- </Button>
- </div>
+ const picker = (
+ <ProviderCustomColorPicker
+ displayName={displayName}
+ value={normalized}
+ onCommit={commitAccentColor}
+ onClear={() => commitAccentColor("")}
+ />
);
if (layout === "inline") {
- return swatchRow;
+ return picker;
}
return (
<div className="grid gap-2">
<span className="text-xs font-medium text-foreground">Accent color</span>
- {swatchRow}
+ {picker}
{description ? <span className="text-xs text-muted-foreground">{description}</span> : null}
</div>
);
diff --git a/apps/web/src/components/settings/ProviderInstanceCard.tsx b/apps/web/src/components/settings/ProviderInstanceCard.tsx
index 02ca1e20ef5..265030a73ff 100644
--- a/apps/web/src/components/settings/ProviderInstanceCard.tsx
+++ b/apps/web/src/components/settings/ProviderInstanceCard.tsx
@@ -32,17 +32,16 @@ import { Badge } from "../ui/badge";
import { Button } from "../ui/button";
import { DraftInput } from "../ui/draft-input";
import { Popover, PopoverPopup, PopoverTrigger } from "../ui/popover";
-import { ScrollArea } from "../ui/scroll-area";
import { Switch } from "../ui/switch";
import { stackedThreadToast, toastManager } from "../ui/toast";
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
import type { DriverOption } from "./providerDriverMeta";
-import { providerSettingsTabClassName } from "./providerSettingsTabs";
import { ProviderSettingsForm } from "./ProviderSettingsForm";
import { ProviderModelsSection } from "./ProviderModelsSection";
import { ProviderInstanceIcon, providerInstanceInitials } from "../chat/ProviderInstanceIcon";
import { ProviderAccentColorPicker } from "./ProviderAccentColorPicker";
import { RedactedSensitiveText } from "./RedactedSensitiveText";
+import { SettingsRow, SettingsSection } from "./settingsLayout";
import {
getProviderVersionAdvisoryPresentation,
PROVIDER_STATUS_STYLES,
@@ -53,13 +52,6 @@ import {
const ENVIRONMENT_VARIABLE_NAME_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
-/** Label-left field grid for the Configuration tab: one row per field. */
-const PROVIDER_FIELD_GRID_CLASS_NAME =
- "grid gap-x-4 gap-y-2.5 sm:grid-cols-[8rem_minmax(0,1fr)] sm:items-start";
-/** Full-width divider row that names the group of fields below it. */
-const PROVIDER_FIELD_GROUP_LABEL_CLASS_NAME =
- "col-span-full mt-1 border-t border-border/60 pt-2.5 text-[11px] text-muted-foreground";
-
let environmentVariableDraftId = 0;
const nextEnvironmentVariableDraftId = () => `provider-env-${environmentVariableDraftId++}`;
@@ -254,7 +246,7 @@ function ProviderEnvironmentSection(props: {
]);
return (
- <div className="min-w-0 space-y-1.5">
+ <div className="mt-3 min-w-0 space-y-2">
{rows.map((variable, index) => (
<div key={variable.id} className="flex min-w-0 items-center gap-1.5">
<DraftInput
@@ -329,16 +321,16 @@ function ProviderEnvironmentSection(props: {
</Button>
</div>
))}
- <div className="flex min-h-[1.875rem] flex-wrap items-center gap-x-3 gap-y-1">
+ <div className="flex min-h-[1.875rem] flex-wrap items-center justify-end gap-x-3 gap-y-1">
+ {rows.length > 0 ? (
+ <span className="mr-auto text-xs text-muted-foreground">
+ Sensitive values are stored separately and never returned to the app.
+ </span>
+ ) : null}
<Button type="button" size="xs" variant="ghost-muted" onClick={addVariable}>
<PlusIcon className="size-3" />
Add variable
</Button>
- <span className="text-xs text-muted-foreground">
- {rows.length === 0
- ? "API keys, base URLs, or other per-instance CLI settings."
- : "Sensitive values are stored separately and never returned to the app."}
- </span>
</div>
</div>
);
@@ -421,7 +413,6 @@ export function ProviderInstanceCard({
onRunUpdate,
isUpdating = false,
}: ProviderInstanceCardProps) {
- const [activeTab, setActiveTab] = useState<"configuration" | "models">("configuration");
const enabled = resolveProviderInstanceEnabled(instance);
// A locally disabled provider reads "Disabled" with a muted dot even if its
// last server status is stale. Enabled providers use the server status.
@@ -433,9 +424,6 @@ export function ProviderInstanceCard({
? getProviderSummary(liveProvider)
: { headline: "Disabled", detail: null };
const authEmail = liveProvider?.auth.email?.trim();
- // The editor header folds the account email into the status line —
- // "Authenticated as <email> · <plan>" — with the email redacted until its
- // reveal toggle is clicked.
const isAuthenticated = enabled && liveProvider?.auth.status === "authenticated";
const authLabel =
enabled && liveProvider?.auth.status === "authenticated"
@@ -474,8 +462,6 @@ export function ProviderInstanceCard({
const driverKind: ProviderDriverKind | null = isProviderDriverKind(instance.driver)
? instance.driver
: null;
- const visibleTab = driverOption === undefined ? "configuration" : activeTab;
-
const customModels =
instance.driver === "antigravity" ? [] : readConfigStringArray(instance.config, "customModels");
// Server-returned models may lag behind settings writes. Treat probe
@@ -485,10 +471,6 @@ export function ProviderInstanceCard({
liveModels: liveProvider?.models,
customModels,
});
- const hiddenModelCount = modelsForDisplay.filter(
- (model) => !model.isCustom && hiddenModels.includes(model.slug),
- ).length;
-
const updateDisplayName = (value: string) => {
const trimmed = value.trim();
const { displayName: _omit, ...rest } = instance;
@@ -561,25 +543,6 @@ export function ProviderInstanceCard({
</span>
);
- const titleHeadNode = (
- <>
- {titleIconNode}
- <h3 className="truncate text-sm font-medium tracking-[-0.005em] text-foreground">
- {displayName}
- </h3>
- {String(instanceId) !== String(instance.driver) ? (
- <code className="truncate rounded bg-muted/60 px-1 py-0.5 text-[10px] text-muted-foreground">
- {instanceId}
- </code>
- ) : null}
- {driverOption?.badgeLabel ? (
- <Badge variant="warning" size="sm" className="shrink-0">
- {driverOption.badgeLabel}
- </Badge>
- ) : null}
- </>
- );
-
const titleTailNode = headerAction ? (
<span className="inline-flex h-5 w-5 shrink-0 items-center justify-center">{headerAction}</span>
) : null;
@@ -593,29 +556,43 @@ export function ProviderInstanceCard({
statusKey === "warning" || statusKey === "error" ? (
<span className={cn("size-1.5 shrink-0 rounded-full", statusStyle.dot)} aria-hidden />
) : null;
- const statusHeadlineNode = <span>{summary.headline}</span>;
// Trouble states carry the server's explanation (a failed probe, a shadow
// home entry that is not a symlink, a missing binary). Show it wherever the
// headline shows so the user can act without opening the editor.
const needsAttention = statusKey === "warning" || statusKey === "error";
- const statusLineClassName =
- "flex min-w-0 flex-wrap items-center gap-x-1.5 text-[13px] leading-[1.45] text-muted-foreground/80";
-
+ const editorStatusNode =
+ isAuthenticated && authEmail ? (
+ <>
+ {needsAttention ? statusDotNode : null}
+ <span>Authenticated as</span>
+ <ProviderAuthEmail email={authEmail} />
+ {authLabel ? <span>· {authLabel}</span> : null}
+ {summary.detail ? (
+ <span className="min-w-0 [overflow-wrap:anywhere]">· {summary.detail}</span>
+ ) : null}
+ </>
+ ) : (
+ <>
+ {statusDotNode}
+ <span>{summary.headline}</span>
+ {summary.detail ? (
+ <span className="min-w-0 [overflow-wrap:anywhere]">· {summary.detail}</span>
+ ) : null}
+ </>
+ );
if (mode === "list") {
return (
<div
+ data-slot="settings-row"
className={cn(
- // Sidebar-style selection with a fixed row height so the list stays
- // even; the status line clamps to two lines instead of growing.
- "group flex min-h-19 items-start gap-3 rounded-md px-3 py-2 transition-colors",
- // Foreground-alpha tint so the fill reads the same in light and dark themes.
- selected ? "bg-foreground/8" : "hover:bg-foreground/4",
+ "group flex min-h-18 items-center gap-3 px-3 py-3 transition-colors sm:px-4",
+ selected ? "bg-muted/45" : "hover:bg-muted/25",
)}
>
<button
type="button"
className={cn(
- "flex min-w-0 flex-1 cursor-pointer items-start gap-3 rounded-sm text-left outline-none transition-opacity focus-visible:ring-2 focus-visible:ring-ring",
+ "flex min-w-0 flex-1 cursor-pointer items-start gap-3 rounded-md text-left outline-none transition-opacity focus-visible:ring-2 focus-visible:ring-ring",
!enabled && !selected && "opacity-60 group-hover:opacity-100",
)}
onClick={onSelect}
@@ -660,260 +637,227 @@ export function ProviderInstanceCard({
);
}
- return (
- <div className="min-w-0 lg:flex lg:h-full lg:min-h-0 lg:flex-col">
- <div className="flex min-h-16 shrink-0 items-start justify-between gap-3 border-b border-border/70 px-4 py-3">
- <div className="min-w-0 flex-1 space-y-1">
- <div className="flex min-w-0 flex-wrap items-center gap-2">
- {titleHeadNode}
- {versionCodeNode}
- {/*
- Only the write actions go inert on read-only sessions; the
- status line below keeps its email reveal clickable.
- */}
- <span
- inert={readOnly}
- aria-disabled={readOnly || undefined}
- className={cn("inline-flex items-center gap-2", readOnly && "opacity-50")}
+ const editorHeaderAction = (
+ <div className="flex min-w-0 items-center gap-1.5">
+ {driverOption?.badgeLabel ? (
+ <Badge variant="warning" size="sm" className="shrink-0">
+ {driverOption.badgeLabel}
+ </Badge>
+ ) : null}
+ {versionCodeNode}
+ <span
+ inert={readOnly}
+ aria-disabled={readOnly || undefined}
+ className={cn("inline-flex items-center gap-1", readOnly && "opacity-50")}
+ >
+ {versionAdvisory ? (
+ <Popover>
+ <PopoverTrigger
+ render={
+ <Button
+ type="button"
+ size="icon-micro"
+ variant="ghost"
+ className={cn(
+ "[--control-icon-color:currentColor]",
+ versionAdvisory.emphasis === "strong"
+ ? "text-warning hover:text-warning"
+ : "text-muted-foreground hover:text-foreground",
+ )}
+ aria-label="Update available — view details"
+ >
+ <ArrowUpCircleIcon className="size-3.5" />
+ </Button>
+ }
+ />
+ <PopoverPopup
+ side="bottom"
+ align="end"
+ className="w-[min(21rem,calc(100vw-1.5rem))] [--popup-width:min(21rem,calc(100vw-1.5rem))]"
>
- {versionAdvisory ? (
- <Popover>
- <PopoverTrigger
- render={
- <Button
- type="button"
- size="icon-micro"
- variant="ghost"
- className={cn(
- "[--control-icon-color:currentColor]",
- versionAdvisory.emphasis === "strong"
- ? "text-warning hover:text-warning"
- : "text-muted-foreground hover:text-foreground",
- )}
- aria-label="Update available — view details"
- >
- <ArrowUpCircleIcon className="size-3.5" />
- </Button>
- }
- />
- <PopoverPopup
- side="bottom"
- align="start"
- className="w-[min(21rem,calc(100vw-1.5rem))] [--popup-width:min(21rem,calc(100vw-1.5rem))]"
+ <div className="grid min-w-0 gap-3">
+ <div className="grid gap-0.5">
+ <p className="text-[13px] font-semibold leading-tight text-foreground">
+ Update available
+ </p>
+ <p
+ className={cn(
+ "text-xs leading-snug",
+ versionAdvisory.emphasis === "strong"
+ ? "text-warning"
+ : "text-muted-foreground",
+ )}
>
- <div className="grid min-w-0 gap-3">
- <div className="grid gap-0.5">
- <p className="text-[13px] font-semibold leading-tight text-foreground">
- Update available
- </p>
- <p
- className={cn(
- "text-xs leading-snug",
- versionAdvisory.emphasis === "strong"
- ? "text-warning"
- : "text-muted-foreground",
- )}
- >
- {versionAdvisory.detail}
- </p>
- </div>
- {onRunUpdate ? (
- <Button
- type="button"
- size="xs"
- variant="outline"
- className="w-full"
- disabled={isUpdating}
- onClick={onRunUpdate}
- >
- {isUpdating ? <LoaderIcon className="animate-spin" /> : <DownloadIcon />}
- {isUpdating ? "Updating" : "Update now"}
- </Button>
- ) : null}
- {onRunUpdate && updateCommand ? (
- <div className="flex items-center gap-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground">
- <span aria-hidden className="h-px flex-1 bg-border" />
- or, update manually using
- <span aria-hidden className="h-px flex-1 bg-border" />
- </div>
- ) : null}
- {updateCommand ? (
- <div className="flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-muted/40 py-0.5 pr-0.5 pl-2">
- <ScrollArea scrollFade className="h-8 min-w-0 flex-1 rounded-none">
- <code className="flex h-full w-max items-center whitespace-nowrap pr-3 font-mono text-[11px] text-foreground">
- {updateCommand}
- </code>
- </ScrollArea>
- <Tooltip>
- <TooltipTrigger
- render={
- <Button
- type="button"
- size="icon-xs"
- variant="ghost"
- className="shrink-0 text-muted-foreground hover:text-foreground"
- onClick={() =>
- copyToClipboard(updateCommand, {
- providerName: displayName,
- })
- }
- aria-label="Copy update command"
- >
- <CopyIcon className="size-3" />
- </Button>
- }
- />
- <TooltipPopup side="top">Copy command</TooltipPopup>
- </Tooltip>
- </div>
- ) : null}
- </div>
- </PopoverPopup>
- </Popover>
- ) : null}
- {titleTailNode}
- </span>
- </div>
- <p className={statusLineClassName}>
- {statusDotNode}
- {isAuthenticated && authEmail ? (
- <>
- <span>Authenticated as</span>
- <ProviderAuthEmail email={authEmail} />
- {authLabel ? <span>· {authLabel}</span> : null}
- </>
- ) : (
- statusHeadlineNode
- )}
- {summary.detail && !needsAttention ? <span>· {summary.detail}</span> : null}
- </p>
- {summary.detail && needsAttention ? (
- <p className="text-[13px] leading-[1.45] text-muted-foreground/80 [overflow-wrap:anywhere]">
- {summary.detail}
- </p>
- ) : null}
- </div>
- {onDelete ? (
- <span
- inert={readOnly}
- aria-disabled={readOnly || undefined}
- className={cn("shrink-0", readOnly && "opacity-50")}
- >
- <Button
- type="button"
- size="xs"
- variant="ghost"
- className="[--control-icon-color:currentColor] text-muted-foreground hover:text-destructive"
- onClick={onDelete}
- aria-label={`Delete instance ${instanceId}`}
- >
- <Trash2Icon className="size-3" />
- Delete instance
- </Button>
- </span>
+ {versionAdvisory.detail}
+ </p>
+ </div>
+ {onRunUpdate ? (
+ <Button
+ type="button"
+ size="xs"
+ variant="outline"
+ className="w-full"
+ disabled={isUpdating}
+ onClick={onRunUpdate}
+ >
+ {isUpdating ? <LoaderIcon className="animate-spin" /> : <DownloadIcon />}
+ {isUpdating ? "Updating" : "Update now"}
+ </Button>
+ ) : null}
+ {onRunUpdate && updateCommand ? (
+ <div className="flex items-center gap-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground">
+ <span aria-hidden className="h-px flex-1 bg-border" />
+ or, update manually using
+ <span aria-hidden className="h-px flex-1 bg-border" />
+ </div>
+ ) : null}
+ {updateCommand ? (
+ <div className="flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-muted/40 py-0.5 pr-0.5 pl-2">
+ <code className="min-w-0 flex-1 truncate font-mono text-[11px] text-foreground">
+ {updateCommand}
+ </code>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ type="button"
+ size="icon-xs"
+ variant="ghost"
+ className="shrink-0 text-muted-foreground hover:text-foreground"
+ onClick={() =>
+ copyToClipboard(updateCommand, { providerName: displayName })
+ }
+ aria-label="Copy update command"
+ >
+ <CopyIcon className="size-3" />
+ </Button>
+ }
+ />
+ <TooltipPopup side="top">Copy command</TooltipPopup>
+ </Tooltip>
+ </div>
+ ) : null}
+ </div>
+ </PopoverPopup>
+ </Popover>
) : null}
- </div>
-
- <div className="flex h-11 shrink-0 border-b border-border/70 px-1">
- <button
- type="button"
- aria-pressed={visibleTab === "configuration"}
- className={providerSettingsTabClassName(visibleTab === "configuration")}
- onClick={() => setActiveTab("configuration")}
- >
- Configuration
- </button>
- {driverOption !== undefined ? (
- <button
+ {titleTailNode}
+ {onDelete ? (
+ <Button
type="button"
- aria-pressed={visibleTab === "models"}
- className={cn(providerSettingsTabClassName(visibleTab === "models"), "gap-1.5")}
- onClick={() => setActiveTab("models")}
+ size="icon-micro"
+ variant="ghost-muted"
+ disabled={readOnly}
+ className="[--control-icon-color:currentColor] hover:text-destructive"
+ onClick={onDelete}
+ aria-label={`Delete instance ${instanceId}`}
>
- Models
- <span className="font-normal text-muted-foreground/70">
- {modelsForDisplay.length}
- {hiddenModelCount > 0 ? ` · ${hiddenModelCount} hidden` : ""}
- </span>
- </button>
+ <Trash2Icon className="size-3" />
+ </Button>
) : null}
- </div>
+ </span>
+ </div>
+ );
- <div className="lg:min-h-0 lg:flex-1">
- <ScrollArea
- scrollFade
- chainVerticalScroll
- className="lg:h-full"
- hidden={visibleTab !== "configuration"}
- >
- {setup ? <div className="border-b border-border/60 px-4 py-3">{setup}</div> : null}
- <div
- inert={readOnly}
- aria-disabled={readOnly || undefined}
- className={cn("px-4 py-4", readOnly && "opacity-50 select-none")}
- >
- <div className={PROVIDER_FIELD_GRID_CLASS_NAME}>
- <label
- htmlFor={`provider-instance-${instanceId}-display-name`}
- className="pt-1.5 text-xs font-medium text-foreground"
- >
- Display name
- </label>
- <div className="flex min-w-0 flex-wrap items-center gap-3">
- <DraftInput
- id={`provider-instance-${instanceId}-display-name`}
- size="sm"
- className="w-44"
- value={instance.displayName ?? ""}
- onCommit={updateDisplayName}
- placeholder={driverOption?.label ?? "Instance label"}
- spellCheck={false}
- />
- <ProviderAccentColorPicker
- layout="inline"
- displayName={displayName}
- value={accentColor}
- onCommit={updateAccentColor}
- commitDelayMs={120}
- />
- </div>
- <div className={PROVIDER_FIELD_GROUP_LABEL_CLASS_NAME}>Runtime</div>
- {driverOption ? (
- <ProviderSettingsForm
- definition={driverOption}
- value={instance.config}
- idPrefix={`provider-instance-${instanceId}`}
- variant="grid"
- onChange={updateConfig}
- />
- ) : (
- <>
- <span className="pt-1.5 text-xs font-medium text-foreground">Driver</span>
- <p className="text-xs text-muted-foreground">
- This instance uses a driver (
- <code className="text-foreground">{String(instance.driver)}</code>) that is not
- shipped with the current build. Configuration values are preserved but cannot be
- edited from this surface.
- </p>
- </>
+ return (
+ <>
+ <SettingsSection
+ title={displayName}
+ description={editorStatusNode}
+ icon={titleIconNode}
+ headerAction={editorHeaderAction}
+ >
+ <SettingsRow
+ title="Display name"
+ control={
+ <div
+ inert={readOnly}
+ aria-disabled={readOnly || undefined}
+ className={cn(
+ "flex w-full items-center justify-end gap-2 sm:w-auto",
+ readOnly && "opacity-50 select-none",
)}
- <div className={PROVIDER_FIELD_GROUP_LABEL_CLASS_NAME}>Environment</div>
- <div className="col-span-full">
- <ProviderEnvironmentSection
- environment={instance.environment ?? []}
- onChange={updateEnvironment}
- />
- </div>
+ >
+ <ProviderAccentColorPicker
+ layout="inline"
+ displayName={displayName}
+ value={accentColor}
+ onCommit={updateAccentColor}
+ commitDelayMs={120}
+ />
+ <DraftInput
+ id={`provider-instance-${instanceId}-display-name`}
+ size="sm"
+ className="min-w-0 flex-1 sm:w-56 sm:flex-none"
+ value={instance.displayName ?? ""}
+ onCommit={updateDisplayName}
+ placeholder={driverOption?.label ?? "Instance label"}
+ spellCheck={false}
+ />
</div>
- </div>
- </ScrollArea>
- {driverOption !== undefined ? (
- <div
- inert={readOnly}
- aria-disabled={readOnly || undefined}
- className={cn("px-4 py-5 lg:h-full lg:min-h-0", readOnly && "opacity-50 select-none")}
- hidden={visibleTab !== "models"}
- >
+ }
+ />
+ </SettingsSection>
+
+ {setup ? (
+ <SettingsSection title="Setup">
+ <div className="px-3 py-3 sm:px-4">{setup}</div>
+ </SettingsSection>
+ ) : null}
+
+ <SettingsSection
+ title="Runtime"
+ inert={readOnly}
+ aria-disabled={readOnly || undefined}
+ className={readOnly ? "opacity-50 select-none" : undefined}
+ >
+ {driverOption ? (
+ <ProviderSettingsForm
+ definition={driverOption}
+ value={instance.config}
+ idPrefix={`provider-instance-${instanceId}`}
+ variant="settings"
+ onChange={updateConfig}
+ />
+ ) : (
+ <SettingsRow
+ title="Driver"
+ description={
+ <span>
+ This instance uses{" "}
+ <code className="text-foreground">{String(instance.driver)}</code>, which is not
+ available in this build. Its configuration is preserved.
+ </span>
+ }
+ />
+ )}
+ </SettingsSection>
+
+ <SettingsSection
+ title="Environment"
+ inert={readOnly}
+ aria-disabled={readOnly || undefined}
+ className={readOnly ? "opacity-50 select-none" : undefined}
+ >
+ <SettingsRow
+ title="Variables"
+ description="API keys, base URLs, and other per-instance CLI settings."
+ >
+ <ProviderEnvironmentSection
+ environment={instance.environment ?? []}
+ onChange={updateEnvironment}
+ />
+ </SettingsRow>
+ </SettingsSection>
+
+ {driverOption !== undefined ? (
+ <SettingsSection
+ title="Models"
+ inert={readOnly}
+ aria-disabled={readOnly || undefined}
+ className={readOnly ? "opacity-50 select-none" : undefined}
+ >
+ <div className="px-3 py-3 sm:px-4">
<ProviderModelsSection
instanceId={instanceId}
driverKind={driverKind}
@@ -928,8 +872,8 @@ export function ProviderInstanceCard({
onModelOrderChange={onModelOrderChange}
/>
</div>
- ) : null}
- </div>
- </div>
+ </SettingsSection>
+ ) : null}
+ </>
);
}
diff --git a/apps/web/src/components/settings/ProviderSettingsForm.tsx b/apps/web/src/components/settings/ProviderSettingsForm.tsx
index c94b7da9d34..902fd408b54 100644
--- a/apps/web/src/components/settings/ProviderSettingsForm.tsx
+++ b/apps/web/src/components/settings/ProviderSettingsForm.tsx
@@ -17,6 +17,7 @@ import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../
import { Switch } from "../ui/switch";
import { Textarea } from "../ui/textarea";
import type { ProviderClientDefinition } from "./providerDriverMeta";
+import { SettingsRow } from "./settingsLayout";
export interface ProviderSettingsFieldModel {
readonly key: string;
@@ -167,11 +168,9 @@ interface ProviderSettingsFormProps {
readonly idPrefix: string;
/**
* `card` stacks label over control, `dialog` is the compact wizard layout,
- * `grid` emits a label cell and a control cell per field for a parent
- * two-column grid (label column left, control right), with the description
- * beside a fixed-width control so each field stays on one line.
+ * and `settings` renders the shared settings row treatment.
*/
- readonly variant: "card" | "dialog" | "grid";
+ readonly variant: "card" | "dialog" | "settings";
readonly onChange: (nextConfig: Record<string, unknown> | undefined) => void;
}
@@ -252,74 +251,64 @@ function ProviderSettingsFieldRow({
<span className={descriptionClassName}>{field.description}</span>
) : null;
- if (variant === "grid") {
- // Label cell, then a control cell where the description sits beside a
- // fixed-width control and wraps under it when the pane is narrow. The
- // description is outside the label, so the control points at it instead.
+ if (variant === "settings") {
const descriptionId = field.description ? `${inputId}-description` : undefined;
+ const control =
+ field.control === "switch" ? (
+ <Switch
+ checked={readProviderConfigBoolean(value, field.key, field.defaultBooleanValue)}
+ onCheckedChange={(checked) =>
+ onChange(nextProviderConfigWithFieldValue(value, field, Boolean(checked)))
+ }
+ aria-label={field.label}
+ aria-describedby={descriptionId}
+ />
+ ) : field.control === "select" ? (
+ <ProviderSettingsSelect
+ field={field}
+ value={value}
+ inputId={inputId}
+ size="sm"
+ className="w-full sm:w-56"
+ onChange={onChange}
+ />
+ ) : field.control === "textarea" ? (
+ <Textarea
+ id={inputId}
+ aria-describedby={descriptionId}
+ className="w-full sm:w-96"
+ value={readProviderConfigString(value, field.key)}
+ onChange={(event) =>
+ onChange(nextProviderConfigWithFieldValue(value, field, event.target.value))
+ }
+ placeholder={field.placeholder}
+ spellCheck={false}
+ />
+ ) : (
+ <DraftInput
+ id={inputId}
+ aria-describedby={descriptionId}
+ size="sm"
+ className="w-full sm:w-56"
+ type={field.control === "password" ? "password" : undefined}
+ autoComplete={field.control === "password" ? "off" : undefined}
+ value={readProviderConfigString(value, field.key)}
+ onCommit={(next) => onChange(nextProviderConfigWithFieldValue(value, field, next))}
+ placeholder={field.placeholder}
+ spellCheck={false}
+ />
+ );
+
return (
- <>
- {field.control === "switch" ? (
- <span className="pt-1.5 text-xs font-medium text-foreground">{field.label}</span>
- ) : (
- <label htmlFor={inputId} className="pt-1.5 text-xs font-medium text-foreground">
- {field.label}
- </label>
- )}
- <div className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1">
- {field.control === "switch" ? (
- <span className="flex h-8 items-center sm:h-7">
- <Switch
- checked={readProviderConfigBoolean(value, field.key, field.defaultBooleanValue)}
- onCheckedChange={(checked) =>
- onChange(nextProviderConfigWithFieldValue(value, field, Boolean(checked)))
- }
- aria-label={field.label}
- aria-describedby={descriptionId}
- />
- </span>
- ) : field.control === "select" ? (
- <ProviderSettingsSelect
- field={field}
- value={value}
- inputId={inputId}
- size="xs"
- className="w-56"
- onChange={onChange}
- />
- ) : field.control === "textarea" ? (
- <Textarea
- id={inputId}
- aria-describedby={descriptionId}
- className="w-full max-w-sm"
- value={readProviderConfigString(value, field.key)}
- onChange={(event) =>
- onChange(nextProviderConfigWithFieldValue(value, field, event.target.value))
- }
- placeholder={field.placeholder}
- spellCheck={false}
- />
- ) : (
- <DraftInput
- id={inputId}
- aria-describedby={descriptionId}
- size="sm"
- className="w-56"
- type={field.control === "password" ? "password" : undefined}
- autoComplete={field.control === "password" ? "off" : undefined}
- value={readProviderConfigString(value, field.key)}
- onCommit={(next) => onChange(nextProviderConfigWithFieldValue(value, field, next))}
- placeholder={field.placeholder}
- spellCheck={false}
- />
- )}
- {field.description ? (
- <span id={descriptionId} className="text-[11px] leading-snug text-muted-foreground">
- {field.description}
- </span>
- ) : null}
- </div>
- </>
+ <SettingsRow
+ title={
+ field.control === "switch" ? field.label : <label htmlFor={inputId}>{field.label}</label>
+ }
+ description={
+ field.description ? <span id={descriptionId}>{field.description}</span> : undefined
+ }
+ control={control}
+ />
);
}
diff --git a/apps/web/src/components/settings/ProviderSettingsPanel.environment.test.tsx b/apps/web/src/components/settings/ProviderSettingsPanel.environment.test.tsx
index 003469361f3..9cbac447972 100644
--- a/apps/web/src/components/settings/ProviderSettingsPanel.environment.test.tsx
+++ b/apps/web/src/components/settings/ProviderSettingsPanel.environment.test.tsx
@@ -164,17 +164,6 @@ function isAddProviderButton(element: ReactElement<Record<string, unknown>>): bo
return element.props["aria-label"] === "Add provider";
}
-function findAdvancedPanel(panel: ReactElement<Record<string, unknown>>) {
- return visitElements(
- panel,
- (element) => element.props.className === "mt-1" && typeof element.props.open === "boolean",
- );
-}
-
-function flushEffects(): void {
- for (const effect of settingsSearchState.effects.splice(0)) effect();
-}
-
async function flushPromises(): Promise<void> {
await Promise.resolve();
await Promise.resolve();
@@ -297,15 +286,19 @@ describe("EnvironmentProviderSettings routing", () => {
expect(visitElements(panel, isAddProviderButton)).not.toBeNull();
});
- it("opens Advanced when search targets the provider health interval", () => {
- settingsSearchState.targetId = "provider-health-check-interval";
+ it("keeps Advanced visible when search targets the provider health interval", () => {
let panel = renderPanel();
+ expect(visitElements(panel, (element) => element.props.title === "Advanced")).not.toBeNull();
+ expect(
+ visitElements(panel, (element) => element.props.id === "provider-health-check-interval"),
+ ).not.toBeNull();
- expect(findAdvancedPanel(panel)?.props.open).toBe(false);
- flushEffects();
-
+ settingsSearchState.targetId = "provider-health-check-interval";
panel = renderPanel();
- expect(findAdvancedPanel(panel)?.props.open).toBe(true);
+ expect(visitElements(panel, (element) => element.props.title === "Advanced")).not.toBeNull();
+ expect(
+ visitElements(panel, (element) => element.props.id === "provider-health-check-interval"),
+ ).not.toBeNull();
});
it("deletes and resets provider configuration without erasing shared preferences", () => {
diff --git a/apps/web/src/components/settings/ProviderSettingsPanel.tsx b/apps/web/src/components/settings/ProviderSettingsPanel.tsx
index 01f759b8de4..88ea31a8ffe 100644
--- a/apps/web/src/components/settings/ProviderSettingsPanel.tsx
+++ b/apps/web/src/components/settings/ProviderSettingsPanel.tsx
@@ -24,7 +24,7 @@ import * as Arr from "effect/Array";
import * as Duration from "effect/Duration";
import * as Equal from "effect/Equal";
import * as Result from "effect/Result";
-import { ChevronDownIcon, LoaderIcon, PlusIcon, RefreshCwIcon } from "lucide-react";
+import { PlusIcon, RefreshCwIcon } from "lucide-react";
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from "react";
import { isDesktopLocalConnectionTarget } from "../../connection/desktopLocal";
@@ -56,7 +56,6 @@ import {
type ProviderUpdateCandidate,
} from "../ProviderUpdateLaunchNotification.logic";
import { Button } from "../ui/button";
-import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible";
import {
NumberField,
NumberFieldDecrement,
@@ -196,7 +195,7 @@ interface ProviderSettingsTarget {
export function ProviderSettingsPanel(target: ProviderSettingsTarget) {
return (
- <SettingsPageContainer className="gap-8">
+ <SettingsPageContainer width="wide" className="gap-8">
<ProviderSettingsPanelContent
key={`${target.environmentId ?? ""}:${target.instanceId ?? ""}`}
{...target}
@@ -254,11 +253,7 @@ function ProviderSettingsPanelContent(target: ProviderSettingsTarget) {
const deviceTabs =
!onlyPrimaryDevice && options.length > 0 ? (
<ScrollArea hideScrollbars scrollFade className="mx-3 h-11 min-w-0 rounded-none sm:mx-4">
- <div
- role="group"
- aria-label="Devices"
- className="flex h-full w-max min-w-full border-b border-border/70 px-1"
- >
+ <div role="group" aria-label="Devices" className="flex h-full w-max min-w-full px-1">
{options.map((environment) => {
const machine = resolveEnvironmentMachineKind(environment.serverConfig);
const selected = environment.environmentId === effectiveEnvironmentId;
@@ -484,10 +479,9 @@ export function EnvironmentProviderSettings({
readonly targetInstanceId?: ProviderInstanceId | undefined;
/**
* Grey out and freeze every write control when this session's credential
- * lacks `orchestration:operate` on the environment. Selecting providers and
- * opening Advanced still work so the real configuration stays readable;
- * switches, forms, and the health interval are inert so no write is
- * offered and then rejected.
+ * lacks `orchestration:operate` on the environment. Selecting providers
+ * still works so the real configuration stays readable; switches, forms,
+ * and the health interval are inert so no write is offered and then rejected.
*/
readonly readOnly?: boolean;
}) {
@@ -506,20 +500,12 @@ export function EnvironmentProviderSettings({
const [selectedInstanceId, setSelectedInstanceId] = useState<ProviderInstanceId | null>(
targetInstanceId ?? null,
);
- const [advancedOpen, setAdvancedOpen] = useState(false);
- const searchTargetId = useSettingsSearchTargetId();
const [updatingProviderDrivers, setUpdatingProviderDrivers] = useState<
ReadonlySet<ProviderDriverKind>
>(() => new Set());
const refreshingRef = useRef(false);
const updatingDriversRef = useRef<Set<ProviderDriverKind>>(new Set());
- useEffect(() => {
- if (searchTargetId === searchableSetting("provider-health-check-interval").id) {
- setAdvancedOpen(true);
- }
- }, [searchTargetId]);
-
const providerUpdateCandidates = useMemo(
() => collectProviderUpdateCandidates(serverProviders),
[serverProviders],
@@ -924,6 +910,7 @@ export function EnvironmentProviderSettings({
<>
<SettingsSection
{...searchableSetting("providers")}
+ variant="plain"
headerAction={
<div className="flex min-w-0 items-center gap-2">
{readOnly ? (
@@ -978,121 +965,109 @@ export function EnvironmentProviderSettings({
>
{deviceTabs}
{readOnly ? (
- <SettingsRow
- title="Limited permissions"
- description={`This session can view ${environmentLabel}'s providers, but its credential does not allow changing their configuration.`}
- />
+ <div className="overflow-hidden rounded-xl border border-border/60 bg-card/40 shadow-xs/5">
+ <SettingsRow
+ title="Limited permissions"
+ description={`This session can view ${environmentLabel}'s providers but can't change their settings.`}
+ />
+ </div>
) : null}
- <div className="space-y-1">
- <div className="mx-3 overflow-hidden rounded-lg border border-border/70 sm:mx-4 lg:grid lg:h-[min(38rem,calc(100dvh-16rem))] lg:min-h-[30rem] lg:grid-cols-[20rem_minmax(0,1fr)]">
- <div className="border-b border-border/70 lg:flex lg:min-h-0 lg:flex-col lg:border-r lg:border-b-0">
- <ScrollArea scrollFade chainVerticalScroll className="lg:min-h-0 lg:flex-1">
- <div className="divide-y divide-border/60">
- {rows.map((row) => (
- <div key={row.instanceId} className="p-1">
- {renderProviderInstance(row, "list")}
- </div>
- ))}
- </div>
- </ScrollArea>
- </div>
+ <div className="overflow-hidden rounded-xl border border-border/60 bg-card/40 shadow-xs/5 lg:grid lg:h-[min(44rem,calc(100dvh-11rem))] lg:min-h-[32rem] lg:grid-cols-[17rem_minmax(0,1fr)]">
+ <div className="border-b border-border/60 bg-muted/10 lg:flex lg:min-h-0 lg:flex-col lg:border-r lg:border-b-0">
+ <ScrollArea scrollFade chainVerticalScroll className="lg:min-h-0 lg:flex-1">
+ <div className="divide-y divide-border/50">
+ {rows.map((row) => renderProviderInstance(row, "list"))}
+ </div>
+ </ScrollArea>
+ </div>
- <div className="min-w-0 lg:min-h-0">
- {selectedRow ? (
- renderProviderInstance(selectedRow, "editor")
- ) : (
- <div className="p-6 text-sm text-muted-foreground">
- {targetInstanceMissing
- ? "This provider instance is no longer available on this device."
- : "No providers configured."}
- </div>
- )}
- </div>
+ <div className="min-w-0 lg:min-h-0">
+ {selectedRow ? (
+ <ScrollArea scrollFade chainVerticalScroll className="lg:h-full">
+ <div className="space-y-6 p-4">{renderProviderInstance(selectedRow, "editor")}</div>
+ </ScrollArea>
+ ) : (
+ <div className="p-6 text-sm text-muted-foreground">
+ {targetInstanceMissing
+ ? "This provider instance is no longer available on this device."
+ : "No providers configured."}
+ </div>
+ )}
</div>
+ </div>
+ </SettingsSection>
- <Collapsible open={advancedOpen} onOpenChange={setAdvancedOpen} className="mt-1">
- <CollapsibleTrigger className="flex h-10 w-full items-center gap-2 px-3 text-xs text-muted-foreground hover:text-foreground sm:px-4">
- <ChevronDownIcon
- className={cn("size-3 transition-transform", advancedOpen && "rotate-180")}
- />
- Advanced
- </CollapsibleTrigger>
- <CollapsibleContent>
- {/* Only the write controls go inert; the title and its policy tooltip stay readable. */}
- <SettingsRow
- id={searchableSetting("provider-health-check-interval").id}
- title={
- <span className="inline-flex items-center gap-1.5">
- {searchableSetting("provider-health-check-interval").title}
- <PolicyTooltip>
- This interval is configured here, then the shared Background activity policy
- decides whether provider probes may run when the timer fires. Custom intervals
- appear as Advanced in General settings.
- </PolicyTooltip>
- </span>
- }
- description="Refresh availability, versions, auth state, and models in the background. 0 seconds turns background checks off."
- resetAction={
- providerHealthRefreshIntervalSeconds !==
- defaultProviderHealthRefreshIntervalSeconds ? (
- <span inert={readOnly} className={readOnly ? "opacity-50" : undefined}>
- <SettingResetButton
- label="provider health check interval"
- onClick={() =>
- updateSettings(
- backgroundActivityOverrideSettings(
- settings.backgroundActivity,
- resolvedBackgroundActivity,
- { providerHealthRefreshInterval: undefined },
- ),
- )
- }
- />
- </span>
- ) : null
- }
- control={
- <div
- inert={readOnly}
- aria-disabled={readOnly || undefined}
- className={cn(
- "flex shrink-0 items-center gap-2",
- readOnly && "opacity-50 select-none",
- )}
- >
- <NumberField
- value={providerHealthRefreshIntervalSeconds}
- min={0}
- step={PROVIDER_HEALTH_INTERVAL_STEP_SECONDS}
- size="sm"
- className="w-32"
- onValueChange={(value) =>
- updateSettings(
- backgroundActivityOverrideSettings(
- settings.backgroundActivity,
- resolvedBackgroundActivity,
- {
- providerHealthRefreshInterval: Duration.seconds(
- normalizeIntervalSeconds(value),
- ),
- },
- ),
- )
- }
- >
- <NumberFieldGroup>
- <NumberFieldDecrement aria-label="Decrease provider health check interval" />
- <NumberFieldInput aria-label="Provider health check interval in seconds" />
- <NumberFieldIncrement aria-label="Increase provider health check interval" />
- </NumberFieldGroup>
- </NumberField>
- <span className="text-xs text-muted-foreground">seconds</span>
- </div>
+ <SettingsSection title="Advanced">
+ <SettingsRow
+ id={searchableSetting("provider-health-check-interval").id}
+ title={
+ <span className="inline-flex items-center gap-1.5">
+ {searchableSetting("provider-health-check-interval").title}
+ <PolicyTooltip>
+ This interval is configured here, then the shared Background activity policy decides
+ whether provider probes may run when the timer fires. Custom intervals appear as
+ Advanced in General settings.
+ </PolicyTooltip>
+ </span>
+ }
+ description="Refresh provider status, versions, and models in the background. Set to 0 to disable."
+ resetAction={
+ providerHealthRefreshIntervalSeconds !== defaultProviderHealthRefreshIntervalSeconds ? (
+ <span inert={readOnly} className={readOnly ? "opacity-50" : undefined}>
+ <SettingResetButton
+ label="provider health check interval"
+ onClick={() =>
+ updateSettings(
+ backgroundActivityOverrideSettings(
+ settings.backgroundActivity,
+ resolvedBackgroundActivity,
+ { providerHealthRefreshInterval: undefined },
+ ),
+ )
+ }
+ />
+ </span>
+ ) : null
+ }
+ control={
+ <div
+ inert={readOnly}
+ aria-disabled={readOnly || undefined}
+ className={cn(
+ "flex shrink-0 items-center gap-2",
+ readOnly && "opacity-50 select-none",
+ )}
+ >
+ <NumberField
+ value={providerHealthRefreshIntervalSeconds}
+ min={0}
+ step={PROVIDER_HEALTH_INTERVAL_STEP_SECONDS}
+ size="sm"
+ className="w-32"
+ onValueChange={(value) =>
+ updateSettings(
+ backgroundActivityOverrideSettings(
+ settings.backgroundActivity,
+ resolvedBackgroundActivity,
+ {
+ providerHealthRefreshInterval: Duration.seconds(
+ normalizeIntervalSeconds(value),
+ ),
+ },
+ ),
+ )
}
- />
- </CollapsibleContent>
- </Collapsible>
- </div>
+ >
+ <NumberFieldGroup>
+ <NumberFieldDecrement aria-label="Decrease provider health check interval" />
+ <NumberFieldInput aria-label="Provider health check interval in seconds" />
+ <NumberFieldIncrement aria-label="Increase provider health check interval" />
+ </NumberFieldGroup>
+ </NumberField>
+ <span className="text-xs text-muted-foreground">seconds</span>
+ </div>
+ }
+ />
</SettingsSection>
{isAddInstanceDialogOpen ? (
diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsx
index 6ee1b7e2d0d..6dd9310d9ea 100644
--- a/apps/web/src/components/settings/SettingsPanels.tsx
+++ b/apps/web/src/components/settings/SettingsPanels.tsx
@@ -154,6 +154,7 @@ import {
SettingsPageContainer,
SettingsRow,
SettingsSection,
+ useSettingsSearchTarget,
useSettingsSearchTargetId,
} from "./settingsLayout";
import { searchableSetting } from "./settingsSearch";
@@ -203,14 +204,12 @@ const BACKGROUND_ACTIVITY_PROFILE_OPTION_LABELS: Record<BackgroundActivityProfil
};
const BACKGROUND_ACTIVITY_PROFILE_DESCRIPTIONS: Record<BackgroundActivityProfile, string> = {
- balanced:
- "Pauses background probes when clients are idle, the host is locked, or low power mode is active.",
+ balanced: "Pauses probes for idle clients, locked hosts, or low power mode.",
performance: "Allows scoped background probes while any subscribed client remains connected.",
"battery-saver": "Also pauses background probes when the host or client is on battery.",
};
-const ADVANCED_BACKGROUND_ACTIVITY_DESCRIPTION =
- "Uses custom background intervals with the selected shared power policy.";
+const ADVANCED_BACKGROUND_ACTIVITY_DESCRIPTION = "Uses custom intervals.";
const DEFAULT_DRIVER_KIND = ProviderDriverKind.make("codex");
const BACKGROUND_ACTIVITY_BOOLEAN_OVERRIDES: ReadonlyArray<{
@@ -422,7 +421,7 @@ function AboutVersionSection() {
{hasDesktopBridge ? (
<SettingsRow
title="Update track"
- description="Stable follows full releases. Nightly follows the nightly desktop channel and can switch back to stable immediately."
+ description="Use stable releases or nightly builds. Switch back anytime."
control={
<Select
value={selectedUpdateChannel}
@@ -1091,7 +1090,7 @@ export function AppearanceSettingsPanel() {
return (
<SettingsPageContainer>
- <SettingsSection id="appearance" title="Appearance">
+ <SettingsSection id="appearance" title="Colors & themes" variant="plain" hideTitle>
<div id={searchableSetting("theme").id}>
<ThemeLibrary
appearanceMode={appearanceMode}
@@ -1107,7 +1106,9 @@ export function AppearanceSettingsPanel() {
onImportOpenChange={setIsImportThemeOpen}
/>
</div>
+ </SettingsSection>
+ <SettingsSection id="appearance-interface" title="Interface">
<SettingsRow
{...searchableSetting("setting-appearance-contrast")}
description="Adjust the contrast of colors and borders across the interface."
@@ -1158,7 +1159,7 @@ export function AppearanceSettingsPanel() {
<SettingsRow
{...searchableSetting("setting-glass-opacity")}
- description="Control how transparent glass surfaces are. Higher values make menus, dialogs, and the composer more solid."
+ description="Higher values make menus, dialogs, and the composer more solid."
resetAction={
settings.glassOpacity !== DEFAULT_UNIFIED_SETTINGS.glassOpacity ? (
<SettingResetButton
@@ -1479,7 +1480,7 @@ function FontSmoothingRow() {
return (
<SettingsRow
{...searchableSetting("font-smoothing")}
- description="Render text with thinner grayscale anti-aliasing instead of macOS's heavier default."
+ description="Use thinner grayscale text smoothing instead of the macOS default."
resetAction={
settings.fontSmoothing !== DEFAULT_UNIFIED_SETTINGS.fontSmoothing ? (
<SettingResetButton
@@ -1610,6 +1611,7 @@ function TypographySection() {
}, [searchTargetId, setAdvanced]);
return (
<SettingsSection
+ id="typography"
title="Typography"
headerAction={
<label className="flex cursor-pointer items-center gap-2 text-xs font-medium text-muted-foreground">
@@ -1889,6 +1891,7 @@ function LegacyFeaturesSection() {
const updateSettings = useUpdatePrimarySettings();
const [open, setOpen] = useState(false);
const searchTargetId = useSettingsSearchTargetId();
+ const targetRef = useSettingsSearchTarget<HTMLElement>("legacy-features");
// Unfold once per search jump; tracking the handled id lets the user fold
// the section back up without the still-set target immediately reopening it.
const lastExpandedTargetRef = useRef<string | null>(null);
@@ -1906,19 +1909,19 @@ function LegacyFeaturesSection() {
}, [searchTargetId]);
return (
- <section className="space-y-3">
+ <section id="legacy-features" ref={targetRef} tabIndex={-1} className="space-y-2.5">
<Collapsible open={open} onOpenChange={setOpen}>
<CollapsibleTrigger className="group flex min-h-8 w-full items-center gap-2 px-3 sm:px-4">
- <h2 className="text-lg font-semibold tracking-[-0.025em] text-muted-foreground transition-colors group-hover:text-foreground">
+ <h2 className="text-sm font-normal tracking-[-0.005em] text-foreground/70 transition-colors group-hover:text-foreground">
Legacy features
</h2>
<ChevronRightIcon className="size-4 text-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90" />
</CollapsibleTrigger>
<CollapsiblePanel>
- <div className="relative space-y-1 overflow-visible pt-3 text-foreground">
+ <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">
<SettingsRow
{...searchableSetting("legacy-plan-mode")}
- description="Brings back the Build/Plan toggle in the composer along with the /plan and /default commands and the Shift+Tab shortcut. While off, every thread runs in build mode."
+ description="Restore Build/Plan, /plan, /default, and Shift+Tab. Off uses build mode."
control={
<Switch
checked={settings.planModeEnabled}
@@ -1967,7 +1970,7 @@ function LegacyFeaturesSection() {
<SettingsRow
serverScoped
{...searchableSetting("legacy-token-streaming")}
- description="Paints assistant output token by token instead of in complete chunks. Not recommended: it is significantly slower, and long responses become harder to follow. Kept only for compatibility with the old behavior."
+ description="Stream output token by token. This legacy mode is slower and harder to follow."
control={
<Switch
checked={settings.enableLegacyTokenStreaming}
@@ -1993,7 +1996,7 @@ function LegacyFeaturesSection() {
/>
<SettingsRow
{...searchableSetting("legacy-sidebar")}
- description="Brings back the original sidebar with per-project thread trees. The default sidebar shows one flat list: active work as rich cards, settled threads as compact rows."
+ description="Restore per-project thread trees instead of the default flat sidebar."
control={
<Switch
checked={settings.legacySidebarEnabled}
@@ -2075,7 +2078,7 @@ export function GeneralSettingsPanel() {
const backgroundActivityProfileOption = resolveBackgroundActivityProfileOption(settings);
const backgroundActivityDescription =
backgroundActivityProfileOption === "advanced"
- ? `${ADVANCED_BACKGROUND_ACTIVITY_DESCRIPTION} Current shared policy: ${
+ ? `${ADVANCED_BACKGROUND_ACTIVITY_DESCRIPTION} Shared policy: ${
BACKGROUND_ACTIVITY_PROFILE_LABELS[activeBackgroundActivityProfile]
}.`
: BACKGROUND_ACTIVITY_PROFILE_DESCRIPTIONS[resolvedBackgroundActivity.profile];
@@ -2087,7 +2090,7 @@ export function GeneralSettingsPanel() {
return (
<SettingsPageContainer>
<SharedSettingsMismatchAlert />
- <SettingsSection title="General">
+ <SettingsSection id="organization" title="Organization">
<SettingsRow
{...searchableSetting("project-grouping")}
description="Combine matching repositories across environments."
@@ -2199,7 +2202,9 @@ export function GeneralSettingsPanel() {
) : null}
</>
) : null}
+ </SettingsSection>
+ <SettingsSection id="behavior" title="Behavior">
<SettingsRow
{...searchableSetting("time-format")}
description="System default follows your browser or OS clock preference."
@@ -2241,7 +2246,6 @@ export function GeneralSettingsPanel() {
</Select>
}
/>
-
<SettingsRow
{...searchableSetting("hide-whitespace-changes")}
description="Set whether the diff panel ignores whitespace-only edits by default."
@@ -2267,7 +2271,6 @@ export function GeneralSettingsPanel() {
/>
}
/>
-
<SettingsRow
{...searchableSetting("diff-layout")}
description="Show diffs stacked or side by side. The toggle in the diff toolbar changes this too."
@@ -2305,7 +2308,7 @@ export function GeneralSettingsPanel() {
<SettingsRow
{...searchableSetting("proactive-panels")}
- description="Automatically open the linked pull request when it appears and the turn diff when agent work finishes."
+ description="Open linked pull requests when found and turn diffs when work finishes."
resetAction={
settings.proactivePanelsEnabled !== DEFAULT_UNIFIED_SETTINGS.proactivePanelsEnabled ? (
<SettingResetButton
@@ -2548,7 +2551,9 @@ export function GeneralSettingsPanel() {
</>
}
/>
+ </SettingsSection>
+ <SettingsSection id="projects-and-threads" title="Projects & threads">
<SettingsRow
serverScoped
{...searchableSetting("new-threads")}
@@ -2626,7 +2631,6 @@ export function GeneralSettingsPanel() {
}
/>
) : null}
-
<SettingsRow
serverScoped
{...searchableSetting("add-project-starts-in")}
@@ -2656,7 +2660,9 @@ export function GeneralSettingsPanel() {
/>
}
/>
+ </SettingsSection>
+ <SettingsSection id="confirmations" title="Confirmations">
<SettingsRow
{...searchableSetting("unpin-confirmation")}
description="Ask before unpinning a thread from the pinned section."
@@ -2776,11 +2782,13 @@ export function GeneralSettingsPanel() {
}
/>
) : null}
+ </SettingsSection>
+ <SettingsSection id="text-generation" title="Text generation">
<SettingsRow
serverScoped
{...searchableSetting("text-generation-model")}
- description="Default model for generated text like thread titles and source control content. Source control settings can override it with a dedicated source control writer model."
+ description="Used for thread titles and other generated text. Source control can override it."
resetAction={
isTextGenerationModelDirty ? (
<SettingResetButton
@@ -2872,7 +2880,7 @@ export function GeneralSettingsPanel() {
/>
</SettingsSection>
- <SettingsSection title="About">
+ <SettingsSection id="about" title="About">
{isElectron || HOSTED_APP_CHANNEL ? (
<AboutVersionSection />
) : (
diff --git a/apps/web/src/components/settings/SettingsSidebarNav.tsx b/apps/web/src/components/settings/SettingsSidebarNav.tsx
index daf1724a38d..0a55a9fe048 100644
--- a/apps/web/src/components/settings/SettingsSidebarNav.tsx
+++ b/apps/web/src/components/settings/SettingsSidebarNav.tsx
@@ -31,6 +31,9 @@ import {
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
+ SidebarMenuSub,
+ SidebarMenuSubButton,
+ SidebarMenuSubItem,
useSidebar,
} from "../ui/sidebar";
import { T3ConnectSidebarAvatar, T3ConnectSidebarSignIn } from "../clerk/T3ConnectSidebarSignIn";
@@ -67,6 +70,33 @@ export const SETTINGS_NAV_ITEMS: ReadonlyArray<{
icon: SETTINGS_SECTION_ICONS[to],
}));
+const SETTINGS_PAGE_SECTIONS: Partial<
+ Readonly<Record<SettingsPath, ReadonlyArray<{ label: string; targetId: string }>>>
+> = {
+ "/settings/general": [
+ { label: "Organization", targetId: "organization" },
+ { label: "Behavior", targetId: "behavior" },
+ { label: "Projects & threads", targetId: "projects-and-threads" },
+ { label: "Confirmations", targetId: "confirmations" },
+ { label: "Text generation", targetId: "text-generation" },
+ { label: "About", targetId: "about" },
+ { label: "Legacy features", targetId: "legacy-features" },
+ ],
+ "/settings/appearance": [
+ { label: "Colors & themes", targetId: "appearance" },
+ { label: "Interface", targetId: "appearance-interface" },
+ { label: "Typography", targetId: "typography" },
+ ],
+ "/settings/source-control": [
+ { label: "Version control", targetId: "source-control" },
+ { label: "Text generation", targetId: "source-control-text-generation" },
+ ],
+ "/settings/connections": [
+ { label: "This environment", targetId: "connections-environment" },
+ { label: "Remote environments", targetId: "remote-environments" },
+ ],
+};
+
function SettingsSectionIcon({ to }: { to: SettingsPath }) {
const Icon = SETTINGS_SECTION_ICONS[to];
return <Icon className="mt-0.5 size-3.5 shrink-0 text-sidebar-muted-foreground/60" />;
@@ -133,10 +163,33 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
if (isMobile) {
setOpenMobile(false);
}
- void navigate({ to, hash: "", replace: true, hashScrollIntoView: false });
+ void navigate({
+ to,
+ hash: "",
+ replace: true,
+ hashScrollIntoView: false,
+ });
},
[isMobile, navigate, setOpenMobile],
);
+ const handlePageSectionClick = useCallback(
+ (to: SettingsPath, targetId: string) => {
+ if (isMobile) {
+ setOpenMobile(false);
+ }
+ if (pathname === to && scrollToSettingsTarget(targetId, { highlight: false })) {
+ return;
+ }
+ void navigate({
+ to,
+ hash: targetId,
+ replace: true,
+ hashScrollIntoView: false,
+ state: { settingsTargetHighlight: false },
+ });
+ },
+ [isMobile, navigate, pathname, setOpenMobile],
+ );
const clearSearch = useCallback(() => {
setQuery("");
setActiveResultIndex(0);
@@ -152,7 +205,13 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
scrollToSettingsTarget(targetId);
return;
}
- void navigate({ to: item.to, hash: targetId, replace: true, hashScrollIntoView: false });
+ void navigate({
+ to: item.to,
+ hash: targetId,
+ replace: true,
+ hashScrollIntoView: false,
+ state: { settingsTargetHighlight: true },
+ });
},
[clearSearch, currentHash, isMobile, navigate, pathname, setOpenMobile],
);
@@ -239,54 +298,75 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
No settings found
</p>
) : null}
- <SidebarMenu
- className="ps-px"
- id={isSearching && hasResults ? "settings-search-results" : undefined}
- role={isSearching && hasResults ? "listbox" : undefined}
- aria-label={isSearching && hasResults ? "Settings search results" : undefined}
- >
- {isSearching
- ? results.map((item, index) => (
- <SidebarMenuItem key={item.id} role="presentation">
+ {isSearching ? (
+ <SidebarMenu
+ className="ps-px"
+ id={hasResults ? "settings-search-results" : undefined}
+ role={hasResults ? "listbox" : undefined}
+ aria-label={hasResults ? "Settings search results" : undefined}
+ >
+ {results.map((item, index) => (
+ <SidebarMenuItem key={item.id} role="presentation">
+ <SidebarMenuButton
+ id={`settings-search-result-${item.id}`}
+ role="option"
+ aria-selected={index === activeResultIndex}
+ tabIndex={-1}
+ size="sm"
+ isActive={index === activeResultIndex}
+ className="h-auto min-h-10 items-start gap-2 rounded-md px-2 py-2 text-left hover:bg-sidebar-row-hover hover:text-sidebar-foreground"
+ onMouseMove={() => setActiveResultIndex(index)}
+ onClick={() => handleSearchResultClick(item)}
+ >
+ <SettingsSectionIcon to={item.to} />
+ <span className="min-w-0 flex-1">
+ <span className="block truncate text-sm font-medium text-sidebar-foreground">
+ {item.title}
+ </span>
+ <span className="block truncate text-[11px] text-sidebar-muted-foreground/75">
+ {SETTINGS_SECTION_LABELS[item.to]}
+ </span>
+ </span>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ ))}
+ </SidebarMenu>
+ ) : (
+ <SidebarMenu className="ps-px">
+ {SETTINGS_NAV_ITEMS.map((item) => {
+ const Icon = item.icon;
+ const isActive = pathname === item.to || pathname.startsWith(`${item.to}/`);
+ const pageSections = SETTINGS_PAGE_SECTIONS[item.to];
+ return (
+ <SidebarMenuItem key={item.to}>
<SidebarMenuButton
- id={`settings-search-result-${item.id}`}
- role="option"
- aria-selected={index === activeResultIndex}
- tabIndex={-1}
- size="sm"
- isActive={index === activeResultIndex}
- className="h-auto min-h-10 items-start gap-2 rounded-md px-2 py-2 text-left hover:bg-sidebar-row-hover hover:text-sidebar-foreground"
- onMouseMove={() => setActiveResultIndex(index)}
- onClick={() => handleSearchResultClick(item)}
+ isActive={isActive}
+ onClick={() => handleSectionClick(item.to)}
>
- <SettingsSectionIcon to={item.to} />
- <span className="min-w-0 flex-1">
- <span className="block truncate text-sm font-medium text-sidebar-foreground">
- {item.title}
- </span>
- <span className="block truncate text-[11px] text-sidebar-muted-foreground/75">
- {SETTINGS_SECTION_LABELS[item.to]}
- </span>
- </span>
+ <Icon />
+ <span className="truncate">{item.label}</span>
</SidebarMenuButton>
+ {isActive && pageSections ? (
+ <SidebarMenuSub className="border-l-0">
+ {pageSections.map((section) => (
+ <SidebarMenuSubItem key={section.targetId}>
+ <SidebarMenuSubButton
+ render={<button type="button" />}
+ size="sm"
+ className="text-sidebar-muted-foreground/65"
+ onClick={() => handlePageSectionClick(item.to, section.targetId)}
+ >
+ <span className="ms-0.5">{section.label}</span>
+ </SidebarMenuSubButton>
+ </SidebarMenuSubItem>
+ ))}
+ </SidebarMenuSub>
+ ) : null}
</SidebarMenuItem>
- ))
- : SETTINGS_NAV_ITEMS.map((item) => {
- const Icon = item.icon;
- const isActive = pathname === item.to || pathname.startsWith(`${item.to}/`);
- return (
- <SidebarMenuItem key={item.to}>
- <SidebarMenuButton
- isActive={isActive}
- onClick={() => handleSectionClick(item.to)}
- >
- <Icon />
- <span className="truncate">{item.label}</span>
- </SidebarMenuButton>
- </SidebarMenuItem>
- );
- })}
- </SidebarMenu>
+ );
+ })}
+ </SidebarMenu>
+ )}
</SidebarGroup>
</SidebarContent>
<SidebarFooter className="p-[var(--sidebar-content-inset)]">
diff --git a/apps/web/src/components/settings/SourceControlSettings.tsx b/apps/web/src/components/settings/SourceControlSettings.tsx
index 480ff26cc7f..ee1fa66a3db 100644
--- a/apps/web/src/components/settings/SourceControlSettings.tsx
+++ b/apps/web/src/components/settings/SourceControlSettings.tsx
@@ -390,8 +390,7 @@ function GitFetchIntervalSettings() {
</span>
</div>
<p className="max-w-2xl text-xs leading-relaxed text-muted-foreground">
- Refresh remote branch status in the background. Set this to 0 seconds if Git credentials
- or security keys should only be prompted by explicit Git actions.
+ Refresh remote branches in the background. Set to 0 to avoid automatic Git prompts.
</p>
</div>
<div className="flex shrink-0 items-center gap-2">
diff --git a/apps/web/src/components/settings/SourceControlWritingSettings.tsx b/apps/web/src/components/settings/SourceControlWritingSettings.tsx
index 67893b00494..448c6c623ea 100644
--- a/apps/web/src/components/settings/SourceControlWritingSettings.tsx
+++ b/apps/web/src/components/settings/SourceControlWritingSettings.tsx
@@ -38,13 +38,12 @@ const MODE_OPTIONS: Record<SourceControlWritingStyleMode, { label: string; descr
},
conventional_commits: {
label: "Conventional Commits",
- description:
- "Uses Conventional Commit prefixes for change descriptions; change request titles and descriptions stay concise.",
+ description: "Use Conventional Commit prefixes and keep change request text concise.",
},
custom: {
label: "Custom instructions",
description:
- "Applies your instructions to change descriptions and change request titles and descriptions in every project.",
+ "Use your instructions for change descriptions and change requests in every project.",
},
};
@@ -90,7 +89,7 @@ export function SourceControlWritingSettingsSection() {
);
return (
- <SettingsSection title="Text generation">
+ <SettingsSection id="source-control-text-generation" title="Text generation">
<SettingsRow
serverScoped
{...searchableSetting("source-control-writing-style")}
@@ -163,7 +162,7 @@ export function SourceControlWritingSettingsSection() {
<SettingsRow
serverScoped
{...searchableSetting("follow-change-request-templates")}
- description="Structures change request descriptions using the current repository's template when one is available."
+ description="Use the repository's template for change request descriptions when available."
resetAction={
style.followChangeRequestTemplates !== defaults.followChangeRequestTemplates ? (
<SettingResetButton
@@ -196,7 +195,7 @@ export function SourceControlWritingSettingsSection() {
<SettingsRow
serverScoped
{...searchableSetting("source-control-writer-model")}
- description="Optional model override for change descriptions, change request titles and descriptions, and branch or bookmark names. Off uses the global text generation model."
+ description="Model for source control text and branch or bookmark names. Off uses the global default."
control={
<div className="flex flex-wrap items-center justify-end gap-2">
{usesDedicatedModel && !canEnableDedicatedModel ? (
diff --git a/apps/web/src/components/settings/ThemeSettings.tsx b/apps/web/src/components/settings/ThemeSettings.tsx
index b75d5f40f43..6403555c484 100644
--- a/apps/web/src/components/settings/ThemeSettings.tsx
+++ b/apps/web/src/components/settings/ThemeSettings.tsx
@@ -719,11 +719,7 @@ export function ThemeLibrary({
);
const renderModeTiles = () => (
- <div
- aria-label="Appearance mode"
- className="mx-auto grid w-full max-w-[56rem] grid-cols-3 gap-3 px-3 sm:px-4"
- role="group"
- >
+ <div aria-label="Appearance mode" className="grid w-full grid-cols-3 gap-3" role="group">
{(["system", "light", "dark"] as const).map((mode) => {
const isActive = appearanceMode === mode;
return (
@@ -777,7 +773,7 @@ export function ThemeLibrary({
// accepted — scoping the group tighter makes the handoffs feel sluggish.
<TooltipProvider>
<div
- className="mx-auto grid w-full max-w-[56rem] gap-2 px-3 sm:px-4"
+ className="grid w-full gap-2"
style={{ gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 16rem), 1fr))" }}
>
{STANDARD_THEME_CARDS.map((standardTheme) => (
@@ -889,15 +885,12 @@ export function ThemeLibrary({
return (
<div className="space-y-3">
- <p className="px-3 text-[13px] leading-[1.45] text-muted-foreground/80 sm:px-4">
- Choose how T3 Code looks. Use a built-in theme or make your own.
- </p>
- <h3 className="px-3 text-sm font-medium tracking-[-0.005em] text-foreground sm:px-4">
+ <h3 className="px-3 text-sm font-normal tracking-[-0.005em] text-foreground/70 sm:px-4">
{searchableSetting("color-scheme").title}
</h3>
{renderModeTiles()}
<div className="flex min-h-8 flex-wrap items-center justify-between gap-3 px-3 pt-2 sm:px-4">
- <h3 className="text-sm font-medium tracking-[-0.005em] text-foreground">
+ <h3 className="text-sm font-normal tracking-[-0.005em] text-foreground/70">
{searchableSetting("theme").title}
</h3>
<div className="flex flex-wrap items-center justify-end gap-2">
diff --git a/apps/web/src/components/settings/settingsLayout.tsx b/apps/web/src/components/settings/settingsLayout.tsx
index 35451ba8813..82fbed96459 100644
--- a/apps/web/src/components/settings/settingsLayout.tsx
+++ b/apps/web/src/components/settings/settingsLayout.tsx
@@ -20,36 +20,54 @@ import { WorkspacePageContainer, type WorkspacePageWidth } from "../WorkspacePag
import { Button } from "../ui/button";
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
+declare module "@tanstack/react-router" {
+ interface HistoryState {
+ settingsTargetHighlight?: boolean;
+ }
+}
+
interface SettingsSearchTargetContextValue {
readonly targetId: string | null;
+ readonly highlightTarget: boolean;
readonly onTargetHandled: () => void;
}
const noop = () => undefined;
const SettingsSearchTargetContext = createContext<SettingsSearchTargetContextValue>({
targetId: null,
+ highlightTarget: true,
onTargetHandled: noop,
});
export function SettingsSearchTargetProvider({
targetId,
+ highlightTarget = true,
onTargetHandled = noop,
children,
}: {
targetId: string | null;
+ highlightTarget?: boolean;
onTargetHandled?: () => void;
children: ReactNode;
}) {
- const value = useMemo(() => ({ targetId, onTargetHandled }), [onTargetHandled, targetId]);
+ const value = useMemo(
+ () => ({ targetId, highlightTarget, onTargetHandled }),
+ [highlightTarget, onTargetHandled, targetId],
+ );
return <SettingsSearchTargetContext value={value}>{children}</SettingsSearchTargetContext>;
}
-function scrollAndFocusSettingsTarget(target: HTMLElement): void {
+function scrollAndFocusSettingsTarget(target: HTMLElement, highlight = true): void {
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
+ const markedScrollTarget =
+ typeof target.querySelector === "function"
+ ? target.querySelector<HTMLElement>(":scope > [data-settings-scroll-target]")
+ : null;
const scrollTarget =
- target.tagName === "SECTION" && target.firstElementChild
+ markedScrollTarget ??
+ (target.tagName === "SECTION" && target.firstElementChild
? (target.firstElementChild as HTMLElement)
- : target;
+ : target);
scrollTarget.scrollIntoView({
behavior: prefersReducedMotion ? "auto" : "smooth",
@@ -57,7 +75,7 @@ function scrollAndFocusSettingsTarget(target: HTMLElement): void {
});
target.focus({ preventScroll: true });
target.classList.remove("settings-search-target-pulse");
- if (prefersReducedMotion) return;
+ if (!highlight || prefersReducedMotion) return;
void target.offsetWidth;
target.classList.add("settings-search-target-pulse");
// The class also suppresses the focus outline (the pulse is the destination
@@ -72,17 +90,17 @@ export function useSettingsSearchTargetId(): string | null {
return useContext(SettingsSearchTargetContext).targetId;
}
-function useSettingsSearchTarget<T extends HTMLElement>(id: string | undefined) {
- const { targetId, onTargetHandled } = useContext(SettingsSearchTargetContext);
+export function useSettingsSearchTarget<T extends HTMLElement>(id: string | undefined) {
+ const { targetId, highlightTarget, onTargetHandled } = useContext(SettingsSearchTargetContext);
const isSearchTarget = id !== undefined && id === targetId;
const targetRef = useCallback(
(target: T | null) => {
if (target && isSearchTarget) {
- scrollAndFocusSettingsTarget(target);
+ scrollAndFocusSettingsTarget(target, highlightTarget);
onTargetHandled();
}
},
- [isSearchTarget, onTargetHandled],
+ [highlightTarget, isSearchTarget, onTargetHandled],
);
return targetRef;
@@ -139,15 +157,21 @@ export function useRelativeTimeTick(intervalMs = 1_000) {
export function SettingsSection({
title,
+ description,
+ hideTitle = false,
icon,
headerAction,
+ variant = "grouped",
children,
className,
...sectionProps
}: ComponentPropsWithoutRef<"section"> & {
title: string;
+ description?: ReactNode;
+ hideTitle?: boolean;
icon?: ReactNode;
headerAction?: ReactNode;
+ variant?: "grouped" | "plain";
children: ReactNode;
}) {
const targetRef = useSettingsSearchTarget<HTMLElement>(sectionProps.id);
@@ -157,16 +181,40 @@ export function SettingsSection({
{...sectionProps}
ref={targetRef}
tabIndex={sectionProps.id ? -1 : sectionProps.tabIndex}
- className={cn("space-y-3", className)}
+ className={cn(!hideTitle && "space-y-2.5", className)}
>
- <div className="flex min-h-8 items-center justify-between gap-4 px-3 sm:px-4">
- <h2 className="flex items-center gap-2 text-lg font-semibold tracking-[-0.025em] text-foreground">
- {icon}
- {title}
- </h2>
- <div className="flex min-h-7 min-w-7 items-center justify-end">{headerAction}</div>
+ {hideTitle ? (
+ <h2 className="sr-only">{title}</h2>
+ ) : (
+ <div
+ data-settings-scroll-target
+ className="flex min-h-7 items-start justify-between gap-4 px-3 sm:px-4"
+ >
+ <div className="min-w-0">
+ <h2 className="flex min-h-7 items-center gap-2 text-sm font-normal tracking-[-0.005em] text-foreground/70">
+ {icon}
+ {title}
+ </h2>
+ {description ? (
+ <div className="flex min-w-0 flex-wrap items-center gap-x-1.5 text-[13px] leading-[1.45] text-muted-foreground/80">
+ {description}
+ </div>
+ ) : null}
+ </div>
+ <div className="flex min-h-7 min-w-7 items-center justify-end">{headerAction}</div>
+ </div>
+ )}
+ <div
+ data-settings-scroll-target={hideTitle ? "" : undefined}
+ className={cn(
+ "relative overflow-visible text-foreground",
+ variant === "grouped"
+ ? "rounded-xl border border-border/60 bg-card/40 shadow-xs/5 [&>*+*]:border-t [&>*+*]:border-border/50 [&>[data-slot=settings-row]]:rounded-none"
+ : "space-y-1",
+ )}
+ >
+ {children}
</div>
- <div className="relative space-y-1 overflow-visible text-foreground">{children}</div>
</section>
);
}
@@ -235,6 +283,7 @@ export function SettingsRow({
{...rowProps}
ref={targetRef}
tabIndex={rowProps.id ? -1 : rowProps.tabIndex}
+ data-slot="settings-row"
className={cn("rounded-xl px-3 sm:px-4", children ? "pt-3 pb-1" : "py-3", className)}
>
<div className="flex flex-col gap-3 sm:grid sm:grid-cols-[minmax(0,1fr)_minmax(10rem,auto)] sm:items-center sm:gap-8">
@@ -312,18 +361,31 @@ export function SettingsPageContainer({
}) {
const navigate = useNavigate();
const hash = useLocation({ select: (location) => location.hash });
+ const highlightTarget = useLocation({
+ select: (location) => location.state.settingsTargetHighlight !== false,
+ });
const targetId = hash.replace(/^#/, "") || null;
const clearTargetHash = useCallback(() => {
- void navigate({ hash: "", replace: true, resetScroll: false, hashScrollIntoView: false });
+ void navigate({
+ hash: "",
+ replace: true,
+ resetScroll: false,
+ hashScrollIntoView: false,
+ state: { settingsTargetHighlight: true },
+ });
}, [navigate]);
return (
- <SettingsSearchTargetProvider targetId={targetId} onTargetHandled={clearTargetHash}>
+ <SettingsSearchTargetProvider
+ targetId={targetId}
+ highlightTarget={highlightTarget}
+ onTargetHandled={clearTargetHash}
+ >
<div
className="topbar-scroll-fade scrollbar-gutter-both flex-1 overflow-y-auto"
data-settings-page-scroll
>
- <WorkspacePageContainer width={width} className={cn("gap-12", className)}>
+ <WorkspacePageContainer width={width} className={cn("gap-8", className)}>
{children}
</WorkspacePageContainer>
</div>
@@ -331,9 +393,12 @@ export function SettingsPageContainer({
);
}
-export function scrollToSettingsTarget(targetId: string): boolean {
+export function scrollToSettingsTarget(
+ targetId: string,
+ { highlight = true }: { readonly highlight?: boolean } = {},
+): boolean {
const target = document.getElementById(targetId);
if (!target) return false;
- scrollAndFocusSettingsTarget(target);
+ scrollAndFocusSettingsTarget(target, highlight);
return true;
}
diff --git a/apps/web/src/components/settings/settingsSearch.test.ts b/apps/web/src/components/settings/settingsSearch.test.ts
index b33857003fa..6176f51121e 100644
--- a/apps/web/src/components/settings/settingsSearch.test.ts
+++ b/apps/web/src/components/settings/settingsSearch.test.ts
@@ -197,7 +197,7 @@ describe("searchSettings", () => {
expect(searchSettings("environment identification")[0]).toMatchObject({
id: "environment-identification",
to: "/settings/appearance",
- targetId: "appearance",
+ targetId: "appearance-interface",
});
});
diff --git a/apps/web/src/components/settings/settingsSearch.ts b/apps/web/src/components/settings/settingsSearch.ts
index 5eaaac9ebab..ea1a221036d 100644
--- a/apps/web/src/components/settings/settingsSearch.ts
+++ b/apps/web/src/components/settings/settingsSearch.ts
@@ -105,7 +105,7 @@ export const SETTINGS_SEARCH_ITEMS = [
to: "/settings/appearance",
searchTerms: ["dev nightly artwork pill label hide none"],
// The setting is stage-dependent, so its parent section is the stable destination.
- targetId: "appearance",
+ targetId: "appearance-interface",
},
{
id: "interface-font",