mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
Add configurable global git identity settings with new Git tab (#43)
This commit is contained in:
1 parent
1382916b97
commit
f1a7d36433
7 files changed
+378
-171
No files matched your search
@@ -1,11 +1,12 @@
|
||||
import { useState, useRef, useEffect, useCallback } from 'react'
|
||||
import { GeneralSettings } from '@/components/settings/GeneralSettings'
|
||||
import { GitSettings } from '@/components/settings/GitSettings'
|
||||
import { KeyboardShortcuts } from '@/components/settings/KeyboardShortcuts'
|
||||
import { OpenCodeConfigManager } from '@/components/settings/OpenCodeConfigManager'
|
||||
import { ProviderSettings } from '@/components/settings/ProviderSettings'
|
||||
import { Dialog, DialogContent } from '@/components/ui/dialog'
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
|
||||
import { Settings2, Keyboard, Code, ChevronLeft, X, Key } from 'lucide-react'
|
||||
import { Settings2, Keyboard, Code, ChevronLeft, X, Key, GitBranch } from 'lucide-react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { useSwipeBack } from '@/hooks/useMobile'
|
||||
|
||||
@@ -14,7 +15,7 @@ interface SettingsDialogProps {
|
||||
onOpenChange: (open: boolean) => void
|
||||
}
|
||||
|
||||
type SettingsView = 'menu' | 'general' | 'shortcuts' | 'opencode' | 'providers'
|
||||
type SettingsView = 'menu' | 'general' | 'git' | 'shortcuts' | 'opencode' | 'providers'
|
||||
|
||||
export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
||||
const [mobileView, setMobileView] = useState<SettingsView>('menu')
|
||||
@@ -39,6 +40,7 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
||||
|
||||
const menuItems = [
|
||||
{ id: 'general', icon: Settings2, label: 'General Settings', description: 'App preferences and behavior' },
|
||||
{ id: 'git', icon: GitBranch, label: 'Git', description: 'Git identity and credentials for repositories' },
|
||||
{ id: 'shortcuts', icon: Keyboard, label: 'Keyboard Shortcuts', description: 'Customize keyboard shortcuts' },
|
||||
{ id: 'opencode', icon: Code, label: 'OpenCode Config', description: 'Manage OpenCode configurations, commands, and agents' },
|
||||
{ id: 'providers', icon: Key, label: 'Providers', description: 'Manage AI provider API keys' },
|
||||
@@ -65,10 +67,13 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
||||
</div>
|
||||
<Tabs defaultValue="general" className="w-full flex flex-col flex-1 min-h-0">
|
||||
<div className="px-6 pt-6 pb-4 flex-shrink-0">
|
||||
<TabsList className="grid w-full grid-cols-4 bg-card border border-border p-1">
|
||||
<TabsList className="grid w-full grid-cols-5 bg-card border border-border p-1">
|
||||
<TabsTrigger value="general" className="data-[state=active]:bg-blue-600 data-[state=active]:text-white text-muted-foreground transition-all duration-200">
|
||||
General
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="git" className="data-[state=active]:bg-blue-600 data-[state=active]:text-white text-muted-foreground transition-all duration-200">
|
||||
Git
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="shortcuts" className="data-[state=active]:bg-blue-600 data-[state=active]:text-white text-muted-foreground transition-all duration-200">
|
||||
Shortcuts
|
||||
</TabsTrigger>
|
||||
@@ -84,6 +89,7 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
||||
<div className="flex-1 overflow-y-auto">
|
||||
<div className="px-6 pb-6">
|
||||
<TabsContent value="general" className="mt-0"><GeneralSettings /></TabsContent>
|
||||
<TabsContent value="git" className="mt-0"><GitSettings /></TabsContent>
|
||||
<TabsContent value="shortcuts" className="mt-0"><KeyboardShortcuts /></TabsContent>
|
||||
<TabsContent value="opencode" className="mt-0"><OpenCodeConfigManager /></TabsContent>
|
||||
<TabsContent value="providers" className="mt-0"><ProviderSettings /></TabsContent>
|
||||
@@ -143,6 +149,7 @@ export function SettingsDialog({ open, onOpenChange }: SettingsDialogProps) {
|
||||
)}
|
||||
|
||||
{mobileView === 'general' && <GeneralSettings />}
|
||||
{mobileView === 'git' && <GitSettings />}
|
||||
{mobileView === 'shortcuts' && <KeyboardShortcuts />}
|
||||
{mobileView === 'opencode' && <OpenCodeConfigManager />}
|
||||
{mobileView === 'providers' && <ProviderSettings />}
|
||||
|
||||
Reference in new issue
Block a user