From 7ca024ec003fbfc56fe05808dd164812b3abcfe5 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Wed, 18 Mar 2026 21:24:52 -0700 Subject: [PATCH] fix visual blip --- src/renderer/src/components/Settings.tsx | 42 +++++++++++++++---- .../components/sidebar/AddWorktreeDialog.tsx | 33 ++++++++++++--- 2 files changed, 63 insertions(+), 12 deletions(-) diff --git a/src/renderer/src/components/Settings.tsx b/src/renderer/src/components/Settings.tsx index dd7789ae5b9..aa6d926552f 100644 --- a/src/renderer/src/components/Settings.tsx +++ b/src/renderer/src/components/Settings.tsx @@ -7,7 +7,15 @@ import { Button } from './ui/button' import { Input } from './ui/input' import { Label } from './ui/label' import { Separator } from './ui/separator' -import { ArrowLeft, FolderOpen, Minus, Plus, Trash2 } from 'lucide-react' +import { + ArrowLeft, + FolderOpen, + Minus, + Plus, + SlidersHorizontal, + SquareTerminal, + Trash2 +} from 'lucide-react' type HookName = keyof OrcaHooks['scripts'] const DEFAULT_REPO_HOOK_SETTINGS = getDefaultRepoHookSettings() @@ -22,7 +30,7 @@ function Settings(): React.JSX.Element { const removeRepo = useAppStore((s) => s.removeRepo) const [confirmingRemove, setConfirmingRemove] = useState(null) - const [selectedPane, setSelectedPane] = useState<'general' | 'repo'>('general') + const [selectedPane, setSelectedPane] = useState<'general' | 'terminal' | 'repo'>('general') const [selectedRepoId, setSelectedRepoId] = useState(null) const [repoHooksMap, setRepoHooksMap] = useState< Record @@ -185,7 +193,8 @@ function Settings(): React.JSX.Element { const selectedRepo = repos.find((repo) => repo.id === selectedRepoId) ?? null const selectedYamlHooks = selectedRepo ? (repoHooksMap[selectedRepo.id]?.hooks ?? null) : null - const showGeneralPane = selectedPane === 'general' || !selectedRepo + const showGeneralPane = selectedPane === 'general' + const showTerminalPane = selectedPane === 'terminal' const displayedGitUsername = (selectedRepo ?? repos[0])?.gitUsername ?? '' const effectiveBaseRef = selectedRepo?.worktreeBaseRef ?? defaultBaseRef @@ -245,8 +254,20 @@ function Settings(): React.JSX.Element { : 'text-muted-foreground hover:bg-muted/60 hover:text-foreground' }`} > + General +
@@ -292,7 +313,7 @@ function Settings(): React.JSX.Element {

General

- Workspace, naming, appearance, and terminal defaults. + Workspace, naming, and appearance defaults.

@@ -433,12 +454,19 @@ function Settings(): React.JSX.Element { ))}
- - + + ) : showTerminalPane ? ( +
+
+

Terminal

+

+ Default terminal typography for new panes. +

+
-

Terminal

+

Typography

Default terminal typography for new panes.

diff --git a/src/renderer/src/components/sidebar/AddWorktreeDialog.tsx b/src/renderer/src/components/sidebar/AddWorktreeDialog.tsx index 612a203b75b..2a2a7798a18 100644 --- a/src/renderer/src/components/sidebar/AddWorktreeDialog.tsx +++ b/src/renderer/src/components/sidebar/AddWorktreeDialog.tsx @@ -21,6 +21,8 @@ import RepoDotLabel from '@/components/repo/RepoDotLabel' import { parseGitHubIssueOrPRNumber } from '@/lib/github-links' import { SPACE_NAMES } from '@/constants/space-names' +const DIALOG_CLOSE_RESET_DELAY_MS = 200 + const AddWorktreeDialog = React.memo(function AddWorktreeDialog() { const activeModal = useAppStore((s) => s.activeModal) const modalData = useAppStore((s) => s.modalData) @@ -48,6 +50,7 @@ const AddWorktreeDialog = React.memo(function AddWorktreeDialog() { const [creating, setCreating] = useState(false) const nameInputRef = useRef(null) const lastSuggestedNameRef = useRef('') + const resetTimeoutRef = useRef(null) const isOpen = activeModal === 'create-worktree' const preselectedRepoId = @@ -66,11 +69,6 @@ const AddWorktreeDialog = React.memo(function AddWorktreeDialog() { (open: boolean) => { if (!open) { closeModal() - setRepoId('') - setName('') - setLinkedIssue('') - setComment('') - lastSuggestedNameRef.current = '' } }, [closeModal] @@ -128,6 +126,31 @@ const AddWorktreeDialog = React.memo(function AddWorktreeDialog() { ]) // Auto-select repo when opening. + React.useEffect(() => { + if (resetTimeoutRef.current !== null) { + window.clearTimeout(resetTimeoutRef.current) + resetTimeoutRef.current = null + } + + if (isOpen) return + + resetTimeoutRef.current = window.setTimeout(() => { + setRepoId('') + setName('') + setLinkedIssue('') + setComment('') + lastSuggestedNameRef.current = '' + resetTimeoutRef.current = null + }, DIALOG_CLOSE_RESET_DELAY_MS) + + return () => { + if (resetTimeoutRef.current !== null) { + window.clearTimeout(resetTimeoutRef.current) + resetTimeoutRef.current = null + } + } + }, [isOpen]) + React.useEffect(() => { if (!isOpen || repos.length === 0) return