"use client"; import { useState } from "react"; import { useAppStore } from "@/store/app-store"; import { Label } from "@/components/ui/label"; import { Key, Palette, Terminal, Atom, FlaskConical, Trash2, Settings2, Volume2, VolumeX, } from "lucide-react"; import { Checkbox } from "@/components/ui/checkbox"; import { useCliStatus } from "./settings-view/hooks/use-cli-status"; import { useScrollTracking } from "@/hooks/use-scroll-tracking"; import { SettingsHeader } from "./settings-view/components/settings-header"; import { KeyboardMapDialog } from "./settings-view/components/keyboard-map-dialog"; import { DeleteProjectDialog } from "./settings-view/components/delete-project-dialog"; import { SettingsNavigation } from "./settings-view/components/settings-navigation"; import { ApiKeysSection } from "./settings-view/api-keys/api-keys-section"; import { ClaudeCliStatus } from "./settings-view/cli-status/claude-cli-status"; import { CodexCliStatus } from "./settings-view/cli-status/codex-cli-status"; import { AppearanceSection } from "./settings-view/appearance/appearance-section"; import { KeyboardShortcutsSection } from "./settings-view/keyboard-shortcuts/keyboard-shortcuts-section"; import { FeatureDefaultsSection } from "./settings-view/feature-defaults/feature-defaults-section"; import { DangerZoneSection } from "./settings-view/danger-zone/danger-zone-section"; import type { Project as SettingsProject, Theme, } from "./settings-view/shared/types"; import type { Project as ElectronProject } from "@/lib/electron"; // Navigation items for the side panel const NAV_ITEMS = [ { id: "api-keys", label: "API Keys", icon: Key }, { id: "claude", label: "Claude", icon: Terminal }, { id: "codex", label: "Codex", icon: Atom }, { id: "appearance", label: "Appearance", icon: Palette }, { id: "audio", label: "Audio", icon: Volume2 }, { id: "keyboard", label: "Keyboard Shortcuts", icon: Settings2 }, { id: "defaults", label: "Feature Defaults", icon: FlaskConical }, { id: "danger", label: "Danger Zone", icon: Trash2 }, ]; export function SettingsView() { const { theme, setTheme, setProjectTheme, defaultSkipTests, setDefaultSkipTests, useWorktrees, setUseWorktrees, showProfilesOnly, setShowProfilesOnly, muteDoneSound, setMuteDoneSound, currentProject, moveProjectToTrash, } = useAppStore(); // Convert electron Project to settings-view Project type const convertProject = ( project: ElectronProject | null ): SettingsProject | null => { if (!project) return null; return { id: project.id, name: project.name, path: project.path, theme: project.theme as Theme | undefined, }; }; const settingsProject = convertProject(currentProject); // Compute the effective theme for the current project const effectiveTheme = (settingsProject?.theme || theme) as Theme; // Handler to set theme - always updates global theme (user's preference), // and also sets per-project theme if a project is selected const handleSetTheme = (newTheme: typeof theme) => { // Always update global theme so user's preference persists across all projects setTheme(newTheme); // Also set per-project theme if a project is selected if (currentProject) { setProjectTheme(currentProject.id, newTheme); } }; // Use CLI status hook const { claudeCliStatus, codexCliStatus, isCheckingClaudeCli, isCheckingCodexCli, handleRefreshClaudeCli, handleRefreshCodexCli, } = useCliStatus(); // Use scroll tracking hook const { activeSection, scrollToSection, scrollContainerRef } = useScrollTracking({ items: NAV_ITEMS, filterFn: (item) => item.id !== "danger" || !!currentProject, initialSection: "api-keys", }); const [showDeleteDialog, setShowDeleteDialog] = useState(false); const [showKeyboardMapDialog, setShowKeyboardMapDialog] = useState(false); return (
{/* Header Section */} {/* Content Area with Sidebar */}
{/* Sticky Side Navigation */} {/* Scrollable Content */}
{/* API Keys Section */} {/* Claude CLI Status Section */} {claudeCliStatus && ( )} {/* Codex CLI Status Section */} {codexCliStatus && ( )} {/* Appearance Section */} {/* Keyboard Shortcuts Section */} setShowKeyboardMapDialog(true)} /> {/* Audio Section */}

Audio

Configure audio and notification settings.

{/* Mute Done Sound Setting */}
setMuteDoneSound(checked === true) } className="mt-0.5" data-testid="mute-done-sound-checkbox" />

When enabled, disables the "ding" sound that plays when an agent completes a feature. The feature will still move to the completed column, but without audio notification.

{/* Feature Defaults Section */} {/* Danger Zone Section - Only show when a project is selected */} setShowDeleteDialog(true)} />
{/* Keyboard Map Dialog */} {/* Delete Project Confirmation Dialog */}
); }