From 44b548c5c88f40fcdb0352ad1189e482959dadbe Mon Sep 17 00:00:00 2001 From: Cody Seibert Date: Mon, 15 Dec 2025 23:11:12 -0500 Subject: [PATCH] fix: address PR review comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove redundant case 'api-keys' from switch (handled by default) - Improve type safety by using SettingsViewId in NavigationItem interface - Simplify onCheckedChange callback in AudioSection - Import NAV_ITEMS from config instead of duplicating locally - Update SettingsNavigation props to use SettingsViewId type 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../src/components/views/settings-view.tsx | 31 ++----------------- .../settings-view/audio/audio-section.tsx | 2 +- .../components/settings-navigation.tsx | 5 +-- .../views/settings-view/config/navigation.ts | 3 +- 4 files changed, 9 insertions(+), 32 deletions(-) diff --git a/apps/app/src/components/views/settings-view.tsx b/apps/app/src/components/views/settings-view.tsx index 9f290257..e499d85d 100644 --- a/apps/app/src/components/views/settings-view.tsx +++ b/apps/app/src/components/views/settings-view.tsx @@ -2,21 +2,9 @@ import { useState } from "react"; import { useAppStore } from "@/store/app-store"; -import { - Key, - Palette, - Terminal, - FlaskConical, - Trash2, - Settings2, - Volume2, -} from "lucide-react"; -import { - useCliStatus, - useSettingsView, - type SettingsViewId, -} from "./settings-view/hooks"; +import { useCliStatus, useSettingsView } from "./settings-view/hooks"; +import { NAV_ITEMS } from "./settings-view/config/navigation"; 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"; @@ -34,17 +22,6 @@ import type { } 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: "appearance", label: "Appearance", icon: Palette }, - { id: "keyboard", label: "Keyboard Shortcuts", icon: Settings2 }, - { id: "audio", label: "Audio", icon: Volume2 }, - { id: "defaults", label: "Feature Defaults", icon: FlaskConical }, - { id: "danger", label: "Danger Zone", icon: Trash2 }, -]; - export function SettingsView() { const { theme, @@ -104,8 +81,6 @@ export function SettingsView() { // Render the active section based on current view const renderActiveSection = () => { switch (activeView) { - case "api-keys": - return ; case "claude": return ( navigateTo(id as SettingsViewId)} + onNavigate={navigateTo} /> {/* Content Panel - Shows only the active section */} diff --git a/apps/app/src/components/views/settings-view/audio/audio-section.tsx b/apps/app/src/components/views/settings-view/audio/audio-section.tsx index aa0a1e24..688da5e4 100644 --- a/apps/app/src/components/views/settings-view/audio/audio-section.tsx +++ b/apps/app/src/components/views/settings-view/audio/audio-section.tsx @@ -39,7 +39,7 @@ export function AudioSection({ onMuteDoneSoundChange(checked === true)} + onCheckedChange={onMuteDoneSoundChange} className="mt-1" data-testid="mute-done-sound-checkbox" /> diff --git a/apps/app/src/components/views/settings-view/components/settings-navigation.tsx b/apps/app/src/components/views/settings-view/components/settings-navigation.tsx index d847860a..940441da 100644 --- a/apps/app/src/components/views/settings-view/components/settings-navigation.tsx +++ b/apps/app/src/components/views/settings-view/components/settings-navigation.tsx @@ -1,12 +1,13 @@ import { cn } from "@/lib/utils"; import type { Project } from "@/lib/electron"; import type { NavigationItem } from "../config/navigation"; +import type { SettingsViewId } from "../hooks/use-settings-view"; interface SettingsNavigationProps { navItems: NavigationItem[]; - activeSection: string; + activeSection: SettingsViewId; currentProject: Project | null; - onNavigate: (sectionId: string) => void; + onNavigate: (sectionId: SettingsViewId) => void; } export function SettingsNavigation({ diff --git a/apps/app/src/components/views/settings-view/config/navigation.ts b/apps/app/src/components/views/settings-view/config/navigation.ts index a1e5f8b7..f907d99a 100644 --- a/apps/app/src/components/views/settings-view/config/navigation.ts +++ b/apps/app/src/components/views/settings-view/config/navigation.ts @@ -8,9 +8,10 @@ import { FlaskConical, Trash2, } from "lucide-react"; +import type { SettingsViewId } from "../hooks/use-settings-view"; export interface NavigationItem { - id: string; + id: SettingsViewId; label: string; icon: LucideIcon; }