From 215ae87950cbffd50032dcd7467c7d96232ca276 Mon Sep 17 00:00:00 2001 From: Kacper Date: Thu, 11 Dec 2025 00:54:09 +0100 Subject: [PATCH] refactor(settings): extract settings navigation to component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create components/settings-navigation.tsx - Move side navigation JSX to new component - Update settings-view.tsx to use SettingsNavigation component - Remove unused cn utility import - Reduce settings-view.tsx by ~30 lines - Improve component modularity and reusability 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- app/src/components/views/settings-view.tsx | 38 +++----------- .../components/settings-navigation.tsx | 50 +++++++++++++++++++ 2 files changed, 57 insertions(+), 31 deletions(-) create mode 100644 app/src/components/views/settings-view/components/settings-navigation.tsx diff --git a/app/src/components/views/settings-view.tsx b/app/src/components/views/settings-view.tsx index eac56179..db469e2d 100644 --- a/app/src/components/views/settings-view.tsx +++ b/app/src/components/views/settings-view.tsx @@ -3,13 +3,13 @@ import { useState } from "react"; import { useAppStore } from "@/store/app-store"; import { Button } from "@/components/ui/button"; -import { cn } from "@/lib/utils"; import { Settings } from "lucide-react"; import { useCliStatus } from "./settings-view/hooks/use-cli-status"; import { useScrollTracking } from "./settings-view/hooks/use-scroll-tracking"; import { NAV_ITEMS } from "./settings-view/config/navigation"; 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"; @@ -91,36 +91,12 @@ export function SettingsView() { {/* Content Area with Sidebar */}
{/* Sticky Side Navigation */} - + {/* Scrollable Content */}
diff --git a/app/src/components/views/settings-view/components/settings-navigation.tsx b/app/src/components/views/settings-view/components/settings-navigation.tsx new file mode 100644 index 00000000..7a90b7ca --- /dev/null +++ b/app/src/components/views/settings-view/components/settings-navigation.tsx @@ -0,0 +1,50 @@ +import { cn } from "@/lib/utils"; +import type { Project } from "@/store/app-store"; +import type { NavigationItem } from "../config/navigation"; + +interface SettingsNavigationProps { + navItems: NavigationItem[]; + activeSection: string; + currentProject: Project | null; + onNavigate: (sectionId: string) => void; +} + +export function SettingsNavigation({ + navItems, + activeSection, + currentProject, + onNavigate, +}: SettingsNavigationProps) { + return ( + + ); +}